From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802599; cv=none; d=zohomail.com; s=zohoarc; b=mTRYR0MM9Q2TucXt51TXXBkJC4txqlUxYUB912mV9Mx6k9f/re6fFPcMFTjWxf8F2cCjkNhBe8X1tb+ebV0kv16q0R6epLAv8azNVC80ZYKZKsCbSF0ZD7dL2ev0Inm5guMdOJHIAwjw4Xr5eJkxMsGpvbyNNIimVnf5fRcglSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802599; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2fa17cJ4to23Vkyj/pItGbFPaud9AZDIssGKp3/2djs=; b=dAOPUdovdbkP0OPqCB6Ne0HhvGYc6UbmpQJMQtkerMQEO4yfdp78YmtFJSMgaY4Lkaf4NWtI8uXVeIcHcOW6dQsMqkm68/RVaMW5g20q+bmh8qRM0h90MZEBthfe548fGyHn6O29VUGOdWjHm8z/ZYWKmBhQcfJCrbG5DhI8XVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802599110805.2162507153782; Wed, 23 Aug 2023 07:56:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHJ-0006oE-Ss; Wed, 23 Aug 2023 10:56:13 -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 1qYpH0-0006lH-7J for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:55:54 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpGy-0007Vc-Ni for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:55:53 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-525bd0b2b48so7358794a12.0 for ; Wed, 23 Aug 2023 07:55:52 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id e25-20020a50ec99000000b0052a404e5929sm5669edr.66.2023.08.23.07.55.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802551; x=1693407351; 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=2fa17cJ4to23Vkyj/pItGbFPaud9AZDIssGKp3/2djs=; b=FDUirXKB2YDaamuXR3GE8d8OsGozU7lp1DZPjr9N4IWWs5i5DUPQ5yt/9k01iRk35X HpYF8KnKqbYuSes7dDSEgLtOfA8VRCUb7MPT66B5gYgVOxyrlW4UOCZfI8+Lhm/9eRVB ZQ1ahkvOh5axcXkpCe3slvsUxO0ycGUqX8V30UeWYC/hIiCTva6I0BGYpiMdqFEdD8Hu yZC4D7PZAmCxCgMlpUOKBfvUTpBCzR4i9VmehfNp1DnJIxY11MYj7ehQV+dL6iovj2Kk mVgoegGr0kY4HNPQh2CbFsqouEsVn/lXwSe7r5dkMukDHZBWpxhsdqPDkMn9Ea9cwQ13 1q4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802551; x=1693407351; 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=2fa17cJ4to23Vkyj/pItGbFPaud9AZDIssGKp3/2djs=; b=JIGvm90o+hInpbT9/iDRlK0+AFTMD7fDVEvIz4PQs+77+g0AwNcTS2yRB+ODKhXd4g dwJD6H4t1l/RjSGJSSLVdiKrZMdBJO+4ikSSMDjoxzL/YGLMpbG1RWG7tjed/cPwea2k x8nxTN9uREDNO05ZgT4KKUBuJTeItwE6LQlLsYj4lPfUlYwKn4anLyzHhaUZoZKeHEhp auKIwKiU7hM9fyDHAU9o9Jx6ah9yBbSucp/iAcyKYZjcBqmxWjmFSlfg6Tf37m4GTZjE 2trQj/GUx9VbceHXO6Nyq5Nu5ILXt7AACwY3hnRwGqsuU/NJQktihfHVdKZwrtjhv+mi IoOg== X-Gm-Message-State: AOJu0Yz5qEdHz2+ffNh5bgRKdCVMtJrmJc9DvhSl4ak/0Z05qKBNEGSd 4ybwawIwLAR5aK4dHx7f162jYeC949+gN1meP0N0Vg== X-Google-Smtp-Source: AGHT+IEj0q9KTw3727ve+8hX6YuaKO2XRo0HAZ09tWZpKLdBWF3vNNh2J+sFSg0K073YI8VUsVxNqQ== X-Received: by 2002:aa7:c1d3:0:b0:523:d1e0:7079 with SMTP id d19-20020aa7c1d3000000b00523d1e07079mr9077876edp.21.1692802550807; Wed, 23 Aug 2023 07:55:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/8] tcg/tcg-op: Document bswap16_i32() byte pattern Date: Wed, 23 Aug 2023 16:55:35 +0200 Message-ID: <20230823145542.79633-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802600166100003 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 7aadb37756..c1b9a3e34c 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1021,6 +1021,15 @@ void tcg_gen_ext16u_i32(TCGv_i32 ret, TCGv_i32 arg) } } =20 +/* + * bswap16_i32: 16-bit byte swap on the low bits of a 32-bit value. + * + * flags + * Byte pattern: bswap16_i32(..ab) -> .aba (TCG_BSWAP_IZ) + * bswap16_i32(xxab) -> ..ba (TCG_BSWAP_OZ) + * bswap16_i32(xxab) -> ssba (TCG_BSWAP_OS) + * bswap16_i32(xxab) -> xaba + */ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags) { /* Only one extension flag may be present. */ @@ -1032,22 +1041,29 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg= , int flags) TCGv_i32 t0 =3D tcg_temp_ebb_new_i32(); TCGv_i32 t1 =3D tcg_temp_ebb_new_i32(); =20 - tcg_gen_shri_i32(t0, arg, 8); + /* arg =3D xxab (IZ=3D0) */ + /* =3D ..ab (IZ=3D1) */ + tcg_gen_shri_i32(t0, arg, 8); /* t0 =3D .xxa (IZ=3D0) */ + /* =3D ...a (IZ=3D1) */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i32(t0, t0); + tcg_gen_ext8u_i32(t0, t0); /* t0 =3D ...a (IZ=3D0) */ } =20 if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i32(t1, arg, 24); - tcg_gen_sari_i32(t1, t1, 16); + tcg_gen_shli_i32(t1, arg, 24); /* t1 =3D b... (OS=3D1) */ + tcg_gen_sari_i32(t1, t1, 16); /* t1 =3D ssb. (OS=3D1) */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i32(t1, arg); - tcg_gen_shli_i32(t1, t1, 8); + tcg_gen_ext8u_i32(t1, arg); /* t1 =3D ...b (OZ=3D1) */ + tcg_gen_shli_i32(t1, t1, 8); /* t1 =3D ..b. (OZ=3D1) */ } else { - tcg_gen_shli_i32(t1, arg, 8); + tcg_gen_shli_i32(t1, arg, 8); /* t1 =3D xab. (IZ=3D0) */ + /* =3D .ab. (IZ=3D1) */ } =20 - tcg_gen_or_i32(ret, t0, t1); + tcg_gen_or_i32(ret, t0, t1); /* ret =3D ..ba (OZ=3D1) */ + /* =3D ssba (OS=3D1) */ + /* =3D .aba (IZ=3D1) */ + /* =3D xaba (no flag) */ tcg_temp_free_i32(t0); tcg_temp_free_i32(t1); } --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802637; cv=none; d=zohomail.com; s=zohoarc; b=Rdi3+XBAD9v/I72btktqR/blwa/IDjbIUchoYq69HGx5h6SrvPP4uW+TpS9si/GXcbI6Hu0fX/q4b1RSlpru2sZaDJ9WoKW2OUlThh2lFCiavv3yTJkZEW23ZjSM49caYf6p7X0cBWl2td0mw7BiEhIjdeBtUz/aawdfvKGs3wE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802637; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bgZaltKaeNfzqYDJtYBATNYhh0W6KTRpUukWBytbNs8=; b=lBssh+YpmW4X80VvkiNyGXyfsHpkeNJCiRtAiwGzzr2IY6LrXaDhguWRiS6jTOaqDS9QeCc/pRFYiUSUnfRz4dBgTWFp9HSEqq/yxt0HzW4CG3qGLq9ikuWZp8fgFrj+LdtEH2fZoaZcc52mvvUGis/4aHF3ja8mzZZtEC0zuIo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802637506685.7272637937581; Wed, 23 Aug 2023 07:57:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHk-0006vF-Te; Wed, 23 Aug 2023 10:56: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 1qYpH5-0006lY-KF for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:55:59 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpH4-0007WK-40 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:55:59 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-98377c5d53eso725828766b.0 for ; Wed, 23 Aug 2023 07:55:57 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id d16-20020a17090648d000b0098d2d219649sm9942518ejt.174.2023.08.23.07.55.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802556; x=1693407356; 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=bgZaltKaeNfzqYDJtYBATNYhh0W6KTRpUukWBytbNs8=; b=imbUPrQay4ivpe5Hg6tytg00Gi8LZDnmAqBGnTv8aeYRYLu94QSvKsMefHzNCAL5K5 ouE8/ljprGj62ECOTYxtmb8eLj4rX8WClgPiCGUu53EjXbUZDe3B3mb4IW0lIt/0rAyN fJUwzgm2iCsGX3PG4tqkaUHULG1R+9xZKG3SH5dGVXr0IExMTRCZ49/pPorxGnAUOJ4A zfwQTUFVXxfBfc5kA1TXGI+POcCnE9KhVp3WsTRHGCnORBHrLmTIVYceuk5HHLyzsXAo iw2KuNpXUumrKFCOSZNvEwHaNC9rTtFoVhAfQ2vuY/kIe93iR7HA9n2Qqhvmultie+Zf 8kkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802556; x=1693407356; 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=bgZaltKaeNfzqYDJtYBATNYhh0W6KTRpUukWBytbNs8=; b=XKauATygfvhQgNlKraQE6HZob0FeQ9wFPUoN3kmUSNqrpELxm2c010Xf3n5GqHxeVD kDn21jqhRf4gKShpNNojq8MyZsCCR2rirmYJKBT0HiLxqYpUGZ1ctsyW2LCxnABT2RL/ Ki/omMYQQik3yYQdVrYIw6iXVwu6gyddKo2v2cbz0IaSspBGjRyTCN4FTpn+ufcrsC0x Wg12hKj69VEnvhRpbR6OAl2BxyPo2eNOqQbg8QA5aBhZRNEe8621HbmEuElni3D+6hLs uUOUa55MBwDaOBr3uWol1KyHGXWZE1rqq1R+2ga6QeOhZmCeVC7xe6JdL6K+9Ig2ewpZ /2fQ== X-Gm-Message-State: AOJu0YwaXTRP37s5OiMLG2jluIZ55U3iqdiD062HYpdQRW8Lbha+5TmV 8QpN2FVaCSQStJFKp3To+yhwt+BdXFk013ZKaiSKBg== X-Google-Smtp-Source: AGHT+IF4/YMDeTHlZoyjm3/hh9xV7NPJCJ1+ol3K+3o2atLRO+o3MpWdSZoKBp0C+gGAtJPHh8p54w== X-Received: by 2002:a17:906:538d:b0:99d:6dd7:42c2 with SMTP id g13-20020a170906538d00b0099d6dd742c2mr10913390ejo.40.1692802556337; Wed, 23 Aug 2023 07:55:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/8] tcg/tcg-op: Document bswap16_i64() byte pattern Date: Wed, 23 Aug 2023 16:55:36 +0200 Message-ID: <20230823145542.79633-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802638419100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index c1b9a3e34c..80ec6f01c4 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1737,6 +1737,15 @@ void tcg_gen_ext32u_i64(TCGv_i64 ret, TCGv_i64 arg) } } =20 +/* + * bswap16_i64: 16-bit byte swap on the low bits of a 64-bit value. + * + * flags + * Byte pattern: bswap16_i32(......ab) -> ......ba (TCG_BSWAP_IZ) + * bswap16_i32(xxxxxxab) -> ......ba (TCG_BSWAP_OZ) + * bswap16_i32(xxxxxxab) -> ssssssba (TCG_BSWAP_OS) + * bswap16_i32(xxxxxxab) -> xxxxxxba + */ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1755,22 +1764,28 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg= , int flags) TCGv_i64 t0 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); =20 - tcg_gen_shri_i64(t0, arg, 8); + /* arg =3D xxxxxxab (IZ=3D0) */ + /* =3D ......ab (IZ=3D1) */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 =3D .xxxxxxa (IZ=3D0) */ + /* =3D .......a (IZ=3D1) */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i64(t0, t0); + tcg_gen_ext8u_i64(t0, t0); /* t0 =3D .......a (IZ=3D0) */ } =20 if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i64(t1, arg, 56); - tcg_gen_sari_i64(t1, t1, 48); + tcg_gen_shli_i64(t1, arg, 56); /* t1 =3D b....... (OS=3D1) */ + tcg_gen_sari_i64(t1, t1, 48); /* t1 =3D ssssssb. (OS=3D1) */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i64(t1, arg); - tcg_gen_shli_i64(t1, t1, 8); + tcg_gen_ext8u_i64(t1, arg); /* t1 =3D .......b (OZ=3D1) */ + tcg_gen_shli_i64(t1, t1, 8); /* t1 =3D ......b. (OZ=3D1) */ } else { - tcg_gen_shli_i64(t1, arg, 8); + tcg_gen_shli_i64(t1, arg, 8); /* t1 =3D xxxxxxb. (IZ=3D0) */ + /* ......b. (IZ=3D1) */ } =20 - tcg_gen_or_i64(ret, t0, t1); + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ......ba (IZ=3D1 or= OZ=3D1) */ + /* ssssssba (OS=3D1) = */ + /* xxxxxxba (no flag) */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); } --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802650; cv=none; d=zohomail.com; s=zohoarc; b=K1qS33mHwvTfbAfMs89oewpkz8a9PjIEug1yE6+kA3GgMA/fCjD1hoNbyIoaeM6dr85Zgr5w38r5TbWw0dWlkf9Pl9G946UVV21PPl+NEpO1GBFlkTlp2uf1uQea892bvpFDoa30CNnnPNPquCVzyIK2l7LJ+EGvv58xpTrcTns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802650; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x/0A6NRHYgTIgaqFhmzm0vT0TysDa5bmQjI9W3T2tZA=; b=ek7B+3ZzsJoqlwrKJjzbrhawx+JjAOmg7w+vQdTqJ8qNPe1ttvh2QHFLz6/mYdG9T2YIcfxAJ9T0OL5YZmPgcfkT449JhIkJJOZhYa731Ams6KjDmVnvO+cOpbqSpiXd4JyeCMw8mMBtiR7FOGCv2I7MYr+fR1/IEfn5duhlXvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802650645437.46236561105616; Wed, 23 Aug 2023 07:57:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHl-0006w1-4l; Wed, 23 Aug 2023 10:56:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYpHA-0006nV-Na for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:04 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpH9-0007We-86 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:04 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-52a3ff5f0abso171301a12.1 for ; Wed, 23 Aug 2023 07:56:02 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id i26-20020aa7c9da000000b0052333d7e320sm9403473edt.27.2023.08.23.07.56.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802561; x=1693407361; 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=x/0A6NRHYgTIgaqFhmzm0vT0TysDa5bmQjI9W3T2tZA=; b=pPH/2B/vAgDI0Dz+yENsXNTZP92hGmDZzbRTMMKZkiH18Br9QzbgmetXJ2o4QK6JAj 8FYJsQ+9Y3pqlDXbY00+Si+Os1Y1qQ9C3Os+MhSUpoPfXOAwvS5AdZSOiwIMhBCzSky/ oMrHSBK5TKzPpvWeXQiTJlV71HqHRsD8arLI4Z5QVBGnP+KN6ncVMo1W/xsS25FLK+vR j0MIS5rEaHk4IiuGQimLGEZ0WHyIBAi7IBPWod8HYuOsN1orGsTpDGUW1xj/7mTMwk3w nxr8rKvCv4MQGwTZ/BpcWXwZDjAdu6fUKVTR9GZeer4yDjz8vithTQr9mPBGkJpSAHPx bBpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802561; x=1693407361; 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=x/0A6NRHYgTIgaqFhmzm0vT0TysDa5bmQjI9W3T2tZA=; b=iJljPe8g0Bn1OnbpipzPTw7RdFHXBCkH+KL7LujG4rdl45cf12wzb08Qa6MMpxj/2c xTW4n4jauKKUMogRn1mHWYDwlNjVbhLtRxll0cOcETolVmdrunnTULf9747ovbnKtVG5 SBSNsHVzsxPr0o1XY5YryIj6AT3yH6tnSSBDspU4q9qNS0Qt520k/Z5ZgWisFmJgp3Ir fX6x3GJxulKuGvaEqndcQNEx0B8aW1bFK0sEF/wLxlpm+43p+7YoDV/g4VkcApw+gPaG F95lP9viPaVmfZU07DdAKzX75d1/xvLdxpk4XKxaAHKnlb7Jnri3zIcp/qu764zZIPuy u97A== X-Gm-Message-State: AOJu0Yzq7+jNi5CDmHMQlPYMXBs0iFUwj/K2rRJc76bZjQM1ZQByNU8n sNPKJvFz2N16Wx3SdfGa5ZnB47KAwb1TL9yZBA/uYA== X-Google-Smtp-Source: AGHT+IFhGV6BSOAfXdhi1r/YLO+sE0CeN4/QRvdvBabQGiO8T7HNFAX3hb6Tv3o/uhMbvBgHu71xgw== X-Received: by 2002:a05:6402:134f:b0:525:6c9f:e1a3 with SMTP id y15-20020a056402134f00b005256c9fe1a3mr10198188edw.20.1692802561669; Wed, 23 Aug 2023 07:56:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/8] tcg/tcg-op: Document bswap32_i32() byte pattern Date: Wed, 23 Aug 2023 16:55:37 +0200 Message-ID: <20230823145542.79633-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802651306100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 80ec6f01c4..fc9b21d30c 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1069,6 +1069,11 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg,= int flags) } } =20 +/* + * bswap32_i32: 32-bit byte swap on a 32-bit value. + * + * Byte pattern: bswap32_i32(abcd) -> dcba + */ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) { if (TCG_TARGET_HAS_bswap32_i32) { --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802598; cv=none; d=zohomail.com; s=zohoarc; b=fUXdWOmpe1C9wqQb3nC0p9oXWdJSlpWgufRPv5ethM7KccPFWX2x7RRKH+rLOr98YLJOI7YXzOg0QBjdce7C6boRJPd43LV9KpKbpPqBy76cg661kTxvJ3N5zyqqZbDIaCIuvcwWLNOOHlexX8UlAjVokc3AjWgQ8+sIb0PFQqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802598; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=McFIimYCHo/OXuvkXkkETAJuvcbJTu/sEWzfSN2RhFU=; b=UI4GXKA5gAtcaJwck3xVElFeGHFuEzhDMPjGlQVomLiJcA327DArtRtEOcuxFiC7Dl3x7s83PibskZ7PsIkCxClzWy9hRXMrFMLIXa1l/qDbZV2kc+CtmN0uhLvGuqaGSpSX6elrP0cfzkp6lnp6zFCBT9WeKfhZPTnZpJlo6/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802598646137.84007577726095; Wed, 23 Aug 2023 07:56:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHI-0006oC-Af; Wed, 23 Aug 2023 10:56:12 -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 1qYpHG-0006o2-Ra for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:10 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpHF-0007XC-5B for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:10 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-99bdeae1d0aso760338366b.1 for ; Wed, 23 Aug 2023 07:56:08 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id v15-20020a170906564f00b0099cbe71f3b5sm9808715ejr.0.2023.08.23.07.56.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802567; x=1693407367; 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=McFIimYCHo/OXuvkXkkETAJuvcbJTu/sEWzfSN2RhFU=; b=BHDIfhkkByIIf94LwS/wzhWfOxc7glIa+Jv6Tq7SmHbxqOJkPcnOAm5M0XJdj9Fm3h L+LytdnPu1C4I5PF5FPY/KY2dMSbcXzbJavxs81kRxpDFwX9YaoC8VmNjcyDbqWA8pmr qZNpUNdCdvapGATC3i+752k9cQ9ZPt704nJ0px/lg9V43z6LlhdnE+JQPa7BDPC0gIgz XK0IS7W+Nh/qbzTV4iHF+ZWMVMdgg+RQkXlRfH12EteLH8tmTGfwJCe33Iiw7EW6n/rw wBYZYaOUgej1xpHK1qxZEPlZyz+dVwJv3/JSpQQ5LcOyb9wOpE8ifjbG2Ri5LYUwu6iO NzaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802567; x=1693407367; 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=McFIimYCHo/OXuvkXkkETAJuvcbJTu/sEWzfSN2RhFU=; b=iOmEFuLVAy/OPolzgkPb83lirQeFmbegDtw7BmApSkNw+hQdBmC03AhoobnyNZADyg nedwpkh+qkoRAIkgUO4nSHudbN+YAJnW6NIUxKPVymuH9pEOizH2sqYh7gYhZpsqOBKa BEzNn/tIoErGkgmsutXbUbOEoxyw++Z23vVVG/ENN4UBEZNZ0tL0ptRRq+cxYAD69+gV hKK/HktK0yEa+IOECzKuK7dM8yhHfL6pvXGWFaJP1GNyeiOuUuN6DqF7iCa0hzm11Nfg aS1lEBZuH9RVxjwCwIhNlm9dBLgrGUmeqIuCugQiDn71bLPVJ/TqG/52ZDgPvJW6JQQP 7fEw== X-Gm-Message-State: AOJu0YzqZh0hBqGwfGaLI+Cu/mok4BpHQVvNsifzkwuU259wwff//Qhh GmC6TwlnFFF94X6X78VsKCv38j+j8Dyn9aMPRfH70g== X-Google-Smtp-Source: AGHT+IHjiEl5cFBFMTdJynjdaHZKd9Sl55LGEXneAEiQSd0nHL+TV7xAEgdi2bBfR1bHPpAtLBlgmA== X-Received: by 2002:a17:907:78d6:b0:9a1:cbe5:7586 with SMTP id kv22-20020a17090778d600b009a1cbe57586mr2223836ejc.35.1692802567427; Wed, 23 Aug 2023 07:56:07 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 4/8] tcg/tcg-op: Document bswap32_i64() byte pattern Date: Wed, 23 Aug 2023 16:55:38 +0200 Message-ID: <20230823145542.79633-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802600455100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index fc9b21d30c..e6e62c4278 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1796,6 +1796,13 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg,= int flags) } } =20 +/* + * bswap32_i64: 32-bit byte swap on the low bits of a 64-bit value. + * + * flags + * Byte pattern: bswap32_i64(xxxxabcd) -> ssssdcba (TCG_BSWAP_OS) + * bswap32_i64(xxxxabcd) -> ....dcba + */ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1815,8 +1822,10 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg,= int flags) TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t2 =3D tcg_constant_i64(0x00ff00ff); =20 - /* arg =3D xxxxabcd */ - tcg_gen_shri_i64(t0, arg, 8); /* t0 =3D .xxxxabc */ + /* arg =3D xxxxabcd (IZ=3D0) */ + /* ....abcd (IZ=3D1) */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 =3D .xxxxabc (IZ=3D0) */ + /* .....abc (IZ=3D1) */ tcg_gen_and_i64(t1, arg, t2); /* t1 =3D .....b.d */ tcg_gen_and_i64(t0, t0, t2); /* t0 =3D .....a.c */ tcg_gen_shli_i64(t1, t1, 8); /* t1 =3D ....b.d. */ @@ -1825,11 +1834,12 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg= , int flags) tcg_gen_shli_i64(t1, ret, 48); /* t1 =3D dc...... */ tcg_gen_shri_i64(t0, ret, 16); /* t0 =3D ......ba */ if (flags & TCG_BSWAP_OS) { - tcg_gen_sari_i64(t1, t1, 32); /* t1 =3D ssssdc.. */ + tcg_gen_sari_i64(t1, t1, 32); /* t1 =3D ssssdc.. (OS=3D1) */ } else { - tcg_gen_shri_i64(t1, t1, 32); /* t1 =3D ....dc.. */ + tcg_gen_shri_i64(t1, t1, 32); /* t1 =3D ....dc.. (OS=3D0) */ } - tcg_gen_or_i64(ret, t0, t1); /* ret =3D ssssdcba */ + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ssssdcba (OS=3D1) */ + /* ....dcba (OS=3D0) */ =20 tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802628; cv=none; d=zohomail.com; s=zohoarc; b=g8wPZKo6k9FSCVcsdBiM7mpjnQG0/KwThsvUkY1jU45EBv/liWcejhQvEy1vXvmnvyUUHTOvDvRF7MH54KCclKHyNhfmUERTV9o0eEEjnki98hda5gygrTTqKZRpcW9AikyAlwZivrQNeFQF130/aA7suY/XKw55BYEbfY9T9AA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802628; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2TDxedktHF/mlH5ygYaw8lfO5Y3QpjQH82Lwm6XiycI=; b=lz5Finsu1f9YzNq2JRAFENElxiPA1Pyx8XRFYPfXz4bOHMRdLFqESjj9ttmgWBSrx9BeSUY3pNaZS5iEk4lQnmqKw3B2WYBQ7Wcaf1xplIbPTA41DdEj1rT9T4DRobZsRTHcfoBCL2+iMvX9/NXK6I47aZstBcBvuuLDeBD9evA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16928026288091004.3398602144543; Wed, 23 Aug 2023 07:57:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHu-0006xr-IJ; Wed, 23 Aug 2023 10:56:51 -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 1qYpHM-0006oc-C7 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:16 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpHK-0007XP-I9 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:16 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-51bece5d935so7244625a12.1 for ; Wed, 23 Aug 2023 07:56:14 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id v13-20020aa7d80d000000b00522828d438csm9392751edq.7.2023.08.23.07.56.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802573; x=1693407373; 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=2TDxedktHF/mlH5ygYaw8lfO5Y3QpjQH82Lwm6XiycI=; b=hvWL6+3nd4dLOv1KivUwXYLVIasA4s9FKim2Cbzm2CMd9DUvE1pZOu0f0wy5OrWARj 2WhrIzfeyI7kRljvN6vxhwDH3NTNpbVX33OExP8DEG2X4o+OcOaiv9Tg24srSNML3bt8 FriLfZujHWdZ7/ozy6fVmNZt8Dzez0v1HYlLBd6dOHzOBMK4XMhSEUrEFOF48wzLta/8 tvtSZtbcZh0d5t6470lapGxaDK7F4qTsSqmqAS2TTmayfRxrrLpqBw8TjmJdCSrp5+vV VdqmbdkDFbgvigBHfu61cnY8Aj8UdVkGzfnx3/zIl7/KxT3Ub4IKuCKaWDwWtPH+EqUj WCQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802573; x=1693407373; 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=2TDxedktHF/mlH5ygYaw8lfO5Y3QpjQH82Lwm6XiycI=; b=WO7znQ5EjYYIaGpRz3pDGvD2xsIiBVfF1Oqwc9yIe58ln9goaxQJX51+jLQK7UAIXC Ifh4+dJ74a55Uq5LjIaDPRJY84RrpLMqA1T72qomILx6ifLYHSqf+3kJDw/PochGNigv EQgH8Icy/QxzJ5l3RTyeRc7l9w/j552B77GMZL4qXVfpLFpI3uxYiwSjkY/xPJ99sz2H 9ekguxuRiPZ4lTOzK0KJJzcFk6wpycDhTTgwDnVHEGtSFMhRgTZuI6XSvSPyXi7GAX5k ZAcx7nWcwXFW8V1VxUOFjMJEXBex1JDYoGeaIcg4C4qwFX7sc41gAaR0gS9RNSs7y2Ip oO3g== X-Gm-Message-State: AOJu0YxMg3pORlt36nZceGccfjvDq6AzFXQDxmLMzEgNv7JA+KAGGD5F y1sQ7Jw8/Cc5S0GpIyAuA0FjhJdswskGUsfrhpDoNg== X-Google-Smtp-Source: AGHT+IEydd+BE/Y03wkMv7+y/RUl5fr08mpzbI+mMUhWV6z1QAjX/xodxLvBo2phxTkzNRwr36XoeQ== X-Received: by 2002:aa7:d790:0:b0:523:b37e:b83d with SMTP id s16-20020aa7d790000000b00523b37eb83dmr10024633edq.41.1692802572895; Wed, 23 Aug 2023 07:56:12 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/8] tcg/tcg-op: Document bswap64_i64() byte pattern Date: Wed, 23 Aug 2023 16:55:39 +0200 Message-ID: <20230823145542.79633-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802630847100003 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index e6e62c4278..45290cccad 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1846,6 +1846,11 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg,= int flags) } } =20 +/* + * bswap64_i64: 64-bit byte swap on a 64-bit value. + * + * Byte pattern: bswap64_i64(abcdefgh) -> hgfedcba + */ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) { if (TCG_TARGET_REG_BITS =3D=3D 32) { --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802681; cv=none; d=zohomail.com; s=zohoarc; b=fQz/kdPpUDO5YwK4gsGCkvC1B0tKDHX+G9+c1F1AvhrlRTECvdTBFn3RWjFCqIyD8wsJ1MVnRIBlwn+DcbVUAi2HXzLnB63hrjK5POrRUdhkKqbxvdTDYpAVAB8aziNGP8cwHFKLI2qZHbx3aOwHvd3EUmD82yk79AO6FXOA/zU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802681; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4LGg5YkxcJlmoWgJXIWbZP7qpa7parjz3qUn2eNwA1g=; b=jEtkzbOANgoxThP6rdmhQ436op+59JfDo3RG0etmuNw/4pX41l4P9b4BRp7oq7IVTD0Z/MjQZD9sY11QWImZEPNJ4O5OJramnuX9nrBz/ff2LK7by1nX/1qw+zXzLlYy5oOQR5iznfPEdOhsk0HwM/EodD/WncphXxVQpBEBqts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169280268125371.97341064256227; Wed, 23 Aug 2023 07:58:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpI0-00070G-Rm; Wed, 23 Aug 2023 10:56:56 -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 1qYpHR-0006ov-Fd for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:21 -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 1qYpHP-0007YA-Ub for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:21 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99bf3f59905so752840266b.3 for ; Wed, 23 Aug 2023 07:56:19 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id e22-20020a170906249600b0099cc1ffd8f5sm9849863ejb.53.2023.08.23.07.56.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802578; x=1693407378; 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=4LGg5YkxcJlmoWgJXIWbZP7qpa7parjz3qUn2eNwA1g=; b=KDsDjuVf24ibjlFT9+YoE48duOi4nwym7G1+dOaClzlsIOFQsnY/l4eU9PtofSyNCj xCejvyM6tCsElfHOkCXuNQQO4lgQ1TF1VgNjFTFlKr1KjD6zHG4RSQaOi4+39xAvsoyW y8Zbd/sc+1SHDsjhXG02YCq/ZOb0Fq8LGCR19Hng0wHCDFIOvlqW0Tig1lOiSh1sA/ry FthfS/2pDaZbsT9cTroaixG8IE98onIOY/Y8BvSjPK6fTcnTCW08biYM3mW0350SmbVM xiVz1/wULrcZ5l+CnkLWRK5GzmgK/8Q61nmILa/2JQx8Jd0q1VwJfRgVzc/U9NBdO9wn fXJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802578; x=1693407378; 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=4LGg5YkxcJlmoWgJXIWbZP7qpa7parjz3qUn2eNwA1g=; b=QQDoppKmwfWECxAFaPicFwfQkuz++X07ZS5c/ViiF4ajaRvWkJZSG27fjTIxyUg3TY jaUpvKJl8jO0mxI1rvYIyqlZ7zgS+tR8NkFn1Lx3aminA2VIg52G6B17ktkR3rN/EW9P 7vmWjvyrVZywfwMgzniOVAkR3jMd5N/Qgpze8oKb3/1IjDuJnUP5Pu+n2Ugk/z0xhgym fAB+izuC3uNKbg/oUXzTR0Rc3tkhepGA6XIwTfAfWoVbuvUkLdBvNLLQjSD9v3ySZ1Bk TI+z1fX4hLczKgx9Oc2FcZIW4+2cndUY5qsUfc/daz9WKnyG4qD6fwbZplydLgKI7L8M KP5A== X-Gm-Message-State: AOJu0YzVTj+3LK43qeRFNqdHZFldpP89aNetV4pk3cY9MXv8AVcs7OeY fup7O80k0TzmC0n3ZncqoB9Jud+OjM0WrdceM/xFHw== X-Google-Smtp-Source: AGHT+IGsaTz5GYoF+3foQm2A8I2p1X8OlMS18DW6Tr0QI+OICjVi88cEuMYKCsdLA4ntkzf5GItc3A== X-Received: by 2002:a17:906:cca:b0:99c:441:ffa with SMTP id l10-20020a1709060cca00b0099c04410ffamr9436271ejh.29.1692802578422; Wed, 23 Aug 2023 07:56:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 6/8] tcg/tcg-op: Document hswap_i32/64() byte pattern Date: Wed, 23 Aug 2023 16:55:40 +0200 Message-ID: <20230823145542.79633-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802682802100003 Document hswap_i32() and hswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tcg/tcg-op.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 45290cccad..94134981a9 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1099,6 +1099,11 @@ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) } } =20 +/* + * hswap_i32: Swap 16-bit halfwords within a 32-bit value. + * + * Byte pattern: hswap_i32(abcd) -> cdab + */ void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg) { /* Swapping 2 16-bit elements is a rotate. */ @@ -1896,19 +1901,26 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) } } =20 +/* + * hswap_i64: Swap 16-bit halfwords within a 64-bit value. + * + * See hswap64() in include/qemu/bitops.h + * + * Byte pattern: hswap_i64(abcdefgh) -> ghefcdab + */ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) { uint64_t m =3D 0x0000ffff0000ffffull; TCGv_i64 t0 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); =20 - /* See include/qemu/bitops.h, hswap64. */ - tcg_gen_rotli_i64(t1, arg, 32); - tcg_gen_andi_i64(t0, t1, m); - tcg_gen_shli_i64(t0, t0, 16); - tcg_gen_shri_i64(t1, t1, 16); - tcg_gen_andi_i64(t1, t1, m); - tcg_gen_or_i64(ret, t0, t1); + /* arg =3D abcdefgh */ + tcg_gen_rotli_i64(t1, arg, 32); /* t1 =3D efghabcd */ + tcg_gen_andi_i64(t0, t1, m); /* t0 =3D ..gh..cd */ + tcg_gen_shli_i64(t0, t0, 16); /* t0 =3D gh..cd.. */ + tcg_gen_shri_i64(t1, t1, 16); /* t1 =3D ..efghab */ + tcg_gen_andi_i64(t1, t1, m); /* t1 =3D ..ef..ab */ + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ghefcdab */ =20 tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802657; cv=none; d=zohomail.com; s=zohoarc; b=OL/jNJpSj+Bn0QWWlkVysWkExBvcL+fCDnqqXxo7uOs7ButZxQlofO4htYpkb7j7KIW1Yy1Lugvvwb8kM+4rjOTzznq5GbDF6hhy5chOSUCNZySq2rzzzXxt8o7L6GTF9dXao2slhXViZ7BsiJdGEgQmaMeY33GkKivlxHeL1oM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802657; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xCK2VK8xRH2D9lhMRhXp0tgYAA1ZvGcHBcKuN6vO5TM=; b=NEXWlUigJHTaP92ggwtUhsUGp35/mgdcb/cm0A6zSCsGlKRhl6pYAYWI8Ey2ZQiEDFEd8XBtcLO+XkkHXdoTB3tJbQQCMfiA5q5N00rryZz+RpvCDc8YuNmADwKjSgmsAE3goPYiV/0zAmldDmd0CNwq1rd7f5L3emffNgjkjV8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802657825115.15634884559609; Wed, 23 Aug 2023 07:57:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHe-0006q1-Uf; Wed, 23 Aug 2023 10:56:35 -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 1qYpHX-0006pO-Pq for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:29 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpHW-0007cG-2K for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:27 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4ff8cf11b90so8988419e87.1 for ; Wed, 23 Aug 2023 07:56:25 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id v15-20020a170906564f00b0099cbe71f3b5sm9808961ejr.0.2023.08.23.07.56.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802584; x=1693407384; 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=xCK2VK8xRH2D9lhMRhXp0tgYAA1ZvGcHBcKuN6vO5TM=; b=KTGplDGqi2ppZYDvJqr8S/TDHTwHpwrqV1kwV5e5zcNcpp6BdYAmJHQtRxKpA25EYS oYqnnS8O+H2QbwsOH9cZ8KvdwTO3RP8xwEqjWzRPK7AhakO17DKlvOudwuuOq7rSNfSQ p/hLhkoxFUWWUQ6KP5Du5mAZAunm0nAsntAal04AnibwCI0kmTNziGW7gWywEwliZKgZ Z/NG+QfppITAg2fmhYEDQRVYD89/C6/APl1VyuerEGTWnLbfuumNuzZzfw4wRZX+V6Gw +bdGAAFSQqteXiWhyZPMXafIySLWVSbRB256CoFhT/LZ5YtqPdKgc8E3ur9hE5/WJlOf YGOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802584; x=1693407384; 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=xCK2VK8xRH2D9lhMRhXp0tgYAA1ZvGcHBcKuN6vO5TM=; b=A0HkhpbaFzGATkPXnYbeaExU1Q1upvsexilaDDJYUeTOi4S1+qZuA13gnN63x2ntBA SSW+2uznBP/YHUSKQGhun5mNo3tEFrNbqyAuC+1ltBYsXT09nHsB3MrTGDyGGqRU8X1O p/3iHfOHpjDiID8zLVnXYYJiVi8kcws3RBFCgNmo0N/IDNjsbK92mImgu0YFKCFQYDRO uLvTCUjTobi8duv4+cwB3dI86OjXHux6xAIX+PVGpLdGELiAmhFXEdwAfMiPE08N6mJl MA1uO8NNJVMKDyBUltULoM1lvn2ZXjp/iHCOyCWW9ujO81w5lKX4ljodZeHTxYhvlb7i izeA== X-Gm-Message-State: AOJu0YzxvzF20333whcFup4A2HkxrfS6h5UmjpKijfbaEAEH9F02X1CA Ws7SAqGZmbMrzusNoC/5TZ4qVADcmZzEgPjkJ1Bjqg== X-Google-Smtp-Source: AGHT+IHgsOnnrHLP2+LPv8OnJ680iZ3yYk5wOEpbWBRs1CwzjgYN6eycKPGZTg/S/dUySe0UsBOOOg== X-Received: by 2002:a05:6512:3241:b0:4fd:f889:b9d2 with SMTP id c1-20020a056512324100b004fdf889b9d2mr7928402lfr.38.1692802583919; Wed, 23 Aug 2023 07:56:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 7/8] tcg/tcg-op: Document wswap_i64() byte pattern Date: Wed, 23 Aug 2023 16:55:41 +0200 Message-ID: <20230823145542.79633-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802658519100001 Document wswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 94134981a9..65a2e5462e 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1926,6 +1926,11 @@ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) tcg_temp_free_i64(t1); } =20 +/* + * wswap_i64: Swap 32-bit words within a 64-bit value. + * + * Byte pattern: wswap_i64(abcdefgh) -> efghabcd + */ void tcg_gen_wswap_i64(TCGv_i64 ret, TCGv_i64 arg) { /* Swapping 2 32-bit elements is a rotate. */ --=20 2.41.0 From nobody Fri Nov 1 00:29:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692802659; cv=none; d=zohomail.com; s=zohoarc; b=Gj9pZeefUCcMV4oBQLtzvD+ctxCMEqZK53dc0S7Afw/lwQAcaI2QhHOb0fOYR1ZoFU7gpcpvZnjeu4lJz6Foq63jXIwg8FU6TLhSHIZftX7qPu50jMdTyuZk1dtREaky5W/pSrOSJktwv59nKQqoJSu/xpx78Ths131ceX4WMEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692802659; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; b=OyXm+4SLHQoweHkmqioSW9J4Pusrws5WJtKhvKSoodWoHgpe5w6Hp1ruBcCt4A11m+lQUhvogiBbXRPHxmyYEc6XtCP9hgK9JoAZ5vWqVfyWFs23h4XT7AAaNOBbxnUrcHCsVKeNM0AD9++Jm71XOZoXQNvbOFkFyydVa7aSAEg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692802659233249.0341219285416; Wed, 23 Aug 2023 07:57:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpHv-0006zd-6Z; Wed, 23 Aug 2023 10:56:51 -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 1qYpHn-0006xB-Fb for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:44 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpHb-0007er-MD for qemu-devel@nongnu.org; Wed, 23 Aug 2023 10:56:34 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5007f3d3235so5530102e87.2 for ; Wed, 23 Aug 2023 07:56:31 -0700 (PDT) Received: from m1x-phil.lan (gsv95-h03-176-172-10-165.dsl.sta.abo.bbox.fr. [176.172.10.165]) by smtp.gmail.com with ESMTPSA id h2-20020a170906828200b00977cad140a8sm9839290ejx.218.2023.08.23.07.56.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 23 Aug 2023 07:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692802589; x=1693407389; 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; b=eH7VO7+5mrkMBwbWOKoh9s5AiAsIzxYq6AqBb1KHNr0fEmOl0EdTtQKW8axPreSGK1 GhQXkX/8zJBCRjImRlnkcyg6lhJg5X0ziTTuwc8X2kDTbKnbBiqImlc3WJPjW211qGha HpovdJyEjf/N5ur6aWAXh3cm7udQr/SIl2HhjQwzSl2WZ4eIEB8Lt0n6snBQPlBoNw9T j9OxZlDsgzdSOcCU1bPlIEH8IdVROfvXvyCMVoiK/ovnRAv++9Q7fnOctV1Q6f9fnHxX IJOzU0xq14xEDMUbCxmX/JetiPxWRGpI6rm4lqei5qbvXgLmkjDbNj5BHmq1FxBEyCXz UsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802589; x=1693407389; 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; b=Df135+WrWSLWb69tFVAMz9Xgb5wp1+xU406uFyqVK/wvkYAnyqX7DVQlHsGlt2R80Q ThKjJHhG+pl16xCIw06HXOLIFJPZqmf+B6VXTH4op0sC5rN2FyUNGIu3Unj0bnx6AsTD rGv7YbC7u26I409sk3fJrW5owW7vZ5btEOP/p2SPVbHYC9UJEE0AjguxWHXcWCN8oOjG cl1lPOVK+NFRxyRWxza98KTrARMoV3XRQJX2FE7MVDC/WeAlYAUPJn02WWo+mMiCnX0S UDY7dkfWZd2gowVRvB4SmEu/ILHEe0sFMl6IUQoALf87N9BquiL9zgwdhxvWmxtwaw0q s65A== X-Gm-Message-State: AOJu0YxinHmfm/pQuRblBHLKrNNTOfJVvXnQvdWq7Hz5ftBs4yeHp/w6 6Wqr15Z/01Qsei89icty9fD9d5KksvwTdRgeiIwIEA== X-Google-Smtp-Source: AGHT+IEkUhsmL5Bp7KF38u7f30H3Fhe/jrskoe6hcSt9njMpa60+9BNgeXHy1Qy0HBZ4L8hxyeMl6A== X-Received: by 2002:a05:6512:3d0e:b0:500:91c1:9642 with SMTP id d14-20020a0565123d0e00b0050091c19642mr3569483lfv.21.1692802589598; Wed, 23 Aug 2023 07:56:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 8/8] target/cris: Fix a typo in gen_swapr() Date: Wed, 23 Aug 2023 16:55:42 +0200 Message-ID: <20230823145542.79633-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823145542.79633-1-philmd@linaro.org> References: <20230823145542.79633-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692802660587100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Edgar E. Iglesias Reviewed-by: Richard Henderson --- target/cris/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 0b3d724281..42103b5558 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -411,15 +411,17 @@ static inline void t_gen_swapw(TCGv d, TCGv s) tcg_gen_or_tl(d, d, t); } =20 -/* Reverse the within each byte. - T0 =3D (((T0 << 7) & 0x80808080) | - ((T0 << 5) & 0x40404040) | - ((T0 << 3) & 0x20202020) | - ((T0 << 1) & 0x10101010) | - ((T0 >> 1) & 0x08080808) | - ((T0 >> 3) & 0x04040404) | - ((T0 >> 5) & 0x02020202) | - ((T0 >> 7) & 0x01010101)); +/* + * Reverse the bits within each byte. + * + * T0 =3D ((T0 << 7) & 0x80808080) + * | ((T0 << 5) & 0x40404040) + * | ((T0 << 3) & 0x20202020) + * | ((T0 << 1) & 0x10101010) + * | ((T0 >> 1) & 0x08080808) + * | ((T0 >> 3) & 0x04040404) + * | ((T0 >> 5) & 0x02020202) + * | ((T0 >> 7) & 0x01010101); */ static void t_gen_swapr(TCGv d, TCGv s) { --=20 2.41.0