From patchwork Wed Aug 23 14:55:35 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: 716086 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp845594wrp; Wed, 23 Aug 2023 07:56:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuH2TM+ItYHCQz6b0cIvPhAysIe4PPnk4tADc+cb06xEDYVctVy+F7L0UQDiN1hIunNT9V X-Received: by 2002:ac8:7fd0:0:b0:403:adf1:8352 with SMTP id b16-20020ac87fd0000000b00403adf18352mr17340054qtk.24.1692802598663; Wed, 23 Aug 2023 07:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802598; cv=none; d=google.com; s=arc-20160816; b=C2FjXjG8Pia8QAKefm8gGsLvaGxp23xxsCqaTEq5LC3tF9ZzyNxgbmqGePcqS3+MJl bz6pnEQXbUX14OnBD5ywUDkkc0mlA7qT38RYh4RzByzB8PX9k6zKqsD9Og+UAnBaLGSz 18prqmPLMqrIHI3uSum0bg1+5xWy5RFT3qYAC9iLkweubdYFhQ2PI0wABu9nLe+9EsYc QGabRc45RC2YF4+4P8W2dDl9fB8VARYqYYx6sYvqzdVZnkW5jOz6b/iz2DlM6vUXJxIZ uELiV6VpvUUyFK5flWk13iFFcX2aJo9Y0GuV+otA+90Tf7eP2NMP0A9DGuXmxCaW4eQk 7hrQ== 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=2fa17cJ4to23Vkyj/pItGbFPaud9AZDIssGKp3/2djs=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=E7xRzz3gRg0q9CflAxGjW3gP1vH+M6C1KM2fhkzCzW41laZqe8vBVgIKWp2l5c6Osy rCUUtU1hqTmmGjaH9rgebfbxBVNbe0GGI5S6E9HjfOZmBMFsGX5p7/ApkE7GRhnmAa3R lWY+F5UZ5z9nMTfLEFFV3MN/9MimTTvsbD4bpK1OX5ibLVxhNsTXbK6lcn8ZygoPGisr RYHqeGLQKlmFyMcJ0rv+xpqSJkJzLIIaAnxqKdx5nP4PQlvfQcCOHO/eQ44BsYgs2NOL kmAQsMcbM2F8RtEn0pvCTsnrUrfMejpgNA1TRbsCyIShJiucdRJLmiwAdwO87iUJ5XiO PGDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FDUirXKB; 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 f29-20020a05622a1a1d00b00410a99cfc4dsi1812387qtb.341.2023.08.23.07.56.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:56:38 -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=FDUirXKB; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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) } } +/* + * 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 = tcg_temp_ebb_new_i32(); TCGv_i32 t1 = tcg_temp_ebb_new_i32(); - tcg_gen_shri_i32(t0, arg, 8); + /* arg = xxab (IZ=0) */ + /* = ..ab (IZ=1) */ + tcg_gen_shri_i32(t0, arg, 8); /* t0 = .xxa (IZ=0) */ + /* = ...a (IZ=1) */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i32(t0, t0); + tcg_gen_ext8u_i32(t0, t0); /* t0 = ...a (IZ=0) */ } 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 = b... (OS=1) */ + tcg_gen_sari_i32(t1, t1, 16); /* t1 = ssb. (OS=1) */ } 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 = ...b (OZ=1) */ + tcg_gen_shli_i32(t1, t1, 8); /* t1 = ..b. (OZ=1) */ } else { - tcg_gen_shli_i32(t1, arg, 8); + tcg_gen_shli_i32(t1, arg, 8); /* t1 = xab. (IZ=0) */ + /* = .ab. (IZ=1) */ } - tcg_gen_or_i32(ret, t0, t1); + tcg_gen_or_i32(ret, t0, t1); /* ret = ..ba (OZ=1) */ + /* = ssba (OS=1) */ + /* = .aba (IZ=1) */ + /* = xaba (no flag) */ tcg_temp_free_i32(t0); tcg_temp_free_i32(t1); } From patchwork Wed Aug 23 14:55:36 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: 716088 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp845858wrp; Wed, 23 Aug 2023 07:57:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+JTUFnR5GDggTFhMdSww19mwhWTr4OjLAZpjEvwWcSuKUvm4onuF6lFPk+XeMaFc7g902 X-Received: by 2002:a0c:cb8a:0:b0:61f:ace6:e94e with SMTP id p10-20020a0ccb8a000000b0061face6e94emr13016710qvk.0.1692802637128; Wed, 23 Aug 2023 07:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802637; cv=none; d=google.com; s=arc-20160816; b=AhPW38N3sjPMazEUOf/xEI6j6u1oCgWiTvQyeoqI2MyHJnjSA5Dfa8m+QUK9y2xb6o uiNPHUbB35ZUIgTV6KaZGIxB+7/oWKWvfADrilPpVq6CuvgoTwtqRAplCoazPYnk0TK5 BGh2MeuECGHweQSStRdW6bANbfOfsmkhbuhi5mjrO+7/kga066p++h5LVq92PUB6be+C kyNcSr/A2pXObbJnRd66Ahj//sOj0V47+BW5vAfMmwAKjKHcBUkdE/9gXvc7JFPvx0nn 3pada5J+MVg7ML3EJkIzrBT4Z6hOafLe0us51I40xQfOyxF0u3lahV4L+8UxvYhmiN51 mjZA== 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=bgZaltKaeNfzqYDJtYBATNYhh0W6KTRpUukWBytbNs8=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=tshf5ljsBsUN5QrRZZVvOID1QM/lHaSDc+RNJo8vSQ/IhdzH1bSPjnQWdIFp0Mm4O6 7oW3S9trFmoRRmn5NzDUgvHZklt2tc69q64Kcw00wETS+eY+1fsfsD5QqSKZnwrHkbal T66Qv3qyHLsc7hL/2jZi6eKo5uCoPbDfuDeEQzVzosopFH/cOx7ykoRiQFLh8ifGI9L+ Gct1/xm3v6tvaXSI935e8Iqm2zFtoSK1aGQpDjATsqJBdAjH4e02Bk+MeHmo4A3TTJU5 F5mayHz598KZ9BeSX8SI4zWLJsgsDKRES2ejjKyCJ+6kM3LvGb9Prux69TeJulX599vu 0H7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=imbUPrQa; 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 x1-20020a0ce241000000b006418d1582b2si7288936qvl.392.2023.08.23.07.57.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:57:17 -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=imbUPrQa; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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) } } +/* + * 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 = tcg_temp_ebb_new_i64(); TCGv_i64 t1 = tcg_temp_ebb_new_i64(); - tcg_gen_shri_i64(t0, arg, 8); + /* arg = xxxxxxab (IZ=0) */ + /* = ......ab (IZ=1) */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 = .xxxxxxa (IZ=0) */ + /* = .......a (IZ=1) */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i64(t0, t0); + tcg_gen_ext8u_i64(t0, t0); /* t0 = .......a (IZ=0) */ } 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 = b....... (OS=1) */ + tcg_gen_sari_i64(t1, t1, 48); /* t1 = ssssssb. (OS=1) */ } 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 = .......b (OZ=1) */ + tcg_gen_shli_i64(t1, t1, 8); /* t1 = ......b. (OZ=1) */ } else { - tcg_gen_shli_i64(t1, arg, 8); + tcg_gen_shli_i64(t1, arg, 8); /* t1 = xxxxxxb. (IZ=0) */ + /* ......b. (IZ=1) */ } - tcg_gen_or_i64(ret, t0, t1); + tcg_gen_or_i64(ret, t0, t1); /* ret = ......ba (IZ=1 or OZ=1) */ + /* ssssssba (OS=1) */ + /* xxxxxxba (no flag) */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); } From patchwork Wed Aug 23 14:55:37 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: 716089 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp845940wrp; Wed, 23 Aug 2023 07:57:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCKWvLCawqsgxBLKfJJESrBHk2UxQ9L1bFdgYJOqsXYN/aivYA420Ik0EwcI4fw9Ry/gEX X-Received: by 2002:a0c:e24d:0:b0:636:e4f:6b9a with SMTP id x13-20020a0ce24d000000b006360e4f6b9amr14377814qvl.17.1692802650357; Wed, 23 Aug 2023 07:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802650; cv=none; d=google.com; s=arc-20160816; b=ymau1anj4FbXVmWY4f5viaTrpSU5pA59O7B+BVyF4rYFxH3IPHHqoeIeWmkXg0GrFl A4V3MF6eGdz52BrxMkib56zlJuP66vX8UsSTCQjqOlvAsM8NPSLRQJ6wENQJwMMQZgUz FRXcR1995VA5vIa2GDm7Hsg1PBrcccyUhFASJc0qwec7hr0FwE7KNqorqzxTUtEXWubO Mh8cRiwfMWS7RzDYGoUvc+ml2+HDJIA/OHJX7jxYt5uGhaDFXbCqt4PesbpyCCl3j58R jKMUevNAz/LCCVCe6FwFZrM0OUWfH+UKT20cfgfFqC3hjHJo+toRNrLcB/P273z7Tj3K NGyA== 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=x/0A6NRHYgTIgaqFhmzm0vT0TysDa5bmQjI9W3T2tZA=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=wbg3/avX3Dms/rH2UQ1Wd5tJ8TTer4EsHOVMbkK/DD9JloA7auSoGR1SkUlGfRBLn0 0WWRqDY7PYDE/9Tp189ZlrwJmdxF46Z8JepuOrNOWyO/1kA8m+dKULGfTIEXzh7sE8Kt yp4xS8HVovx3WoKC1wCt4cpNxITKBDxUVfOSfjM030T7auNgEx5I2NUzBOGNE7QRPji0 orcjrPz5WMV7PBPdVzJdzH8SsEPKeD7eBSsPaceVw2H7wQpEwudkGqcQveJMJBlouHyU tOR5cB91B9Ue4KSHdI4upS9jnjNVnhCU9SUErVw293qnj8gzObqTNg7GG+PK5yHjpRUI QHMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pPH/2B/v"; 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 ay30-20020a05620a179e00b0076d9a7b0971si2633603qkb.146.2023.08.23.07.57.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:57: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="pPH/2B/v"; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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) } } +/* + * 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) { From patchwork Wed Aug 23 14:55:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 716085 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp845592wrp; Wed, 23 Aug 2023 07:56:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG56f0TQ6ebPLYnH7ciJJ74jWvPb8zYFYSims/7YHrJ6k8FqnmyfquxZ4VQgxZLbOPL0fQ X-Received: by 2002:a05:6214:b0c:b0:63f:7c62:63dd with SMTP id u12-20020a0562140b0c00b0063f7c6263ddmr10312118qvj.46.1692802598176; Wed, 23 Aug 2023 07:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802598; cv=none; d=google.com; s=arc-20160816; b=iA+ZKCPCG02jWXofFxsn9ZFq7Z+Gjb00cBY2JmYljjApBHlcIqXpyvTpViXyWPo48u NQ0xq/U2/Ait56+UjWJSmwdQBO72rxi9e39mtJcVgAWwke4DdJW9GhVetpFezWLWe6XI vXa0iGE67snZoUytua+gTARgUuY3nozkTtv3ldp3qkBsO+SqlDPSx/TwYrnRDYlQqFti oNLnV4k+OkUk+verMA6RIsGNfd24LJHRXb200594vuUhgDm8NCRD2VxSOKDMN+/Ux2pL LS6Exj9VtCHVq8vuwM9zJ3Yrx8kJScMQHhbqtiavSI/GiY+kF/LTxDcDoL/mU8kC9gFn foWw== 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=McFIimYCHo/OXuvkXkkETAJuvcbJTu/sEWzfSN2RhFU=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=BL/lkU5iyVb+B3AGNHDDQovDdhDkzqHuj/pwX0NClrlieB+S5JaaHsniJtbKVbTvYb bhObp8DWekyCOsxJ/hdzCdZsm7UTIc6GhO68E8q2IGwyPz0xuAv3VWMpJusho6quc2M4 cxSqleHoyvt1z9VXN8anBHXC2o4/UQhV1WHMc+XTnL14rC1VLf6ey+Oluj2yVxGMlmpm Ek5CnYHmT2XdzlSnrt9ayIUVLm9QR9gK4k8xiX1b6cICqazLMSEJ6byuY4S3OWWMnTwL BJtIz/IZfuS+ZxKZf8KI8VgRgRsYCXxicLTA65hXv+fSK7Fl7rE/J7RKaVX18igDA+J1 z5OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BHDIfhkk; 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 ay10-20020a05620a178a00b0076db12d14c2si2694487qkb.719.2023.08.23.07.56.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:56:38 -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=BHDIfhkk; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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) } } +/* + * 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 = tcg_temp_ebb_new_i64(); TCGv_i64 t2 = tcg_constant_i64(0x00ff00ff); - /* arg = xxxxabcd */ - tcg_gen_shri_i64(t0, arg, 8); /* t0 = .xxxxabc */ + /* arg = xxxxabcd (IZ=0) */ + /* ....abcd (IZ=1) */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 = .xxxxabc (IZ=0) */ + /* .....abc (IZ=1) */ tcg_gen_and_i64(t1, arg, t2); /* t1 = .....b.d */ tcg_gen_and_i64(t0, t0, t2); /* t0 = .....a.c */ tcg_gen_shli_i64(t1, t1, 8); /* t1 = ....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 = dc...... */ tcg_gen_shri_i64(t0, ret, 16); /* t0 = ......ba */ if (flags & TCG_BSWAP_OS) { - tcg_gen_sari_i64(t1, t1, 32); /* t1 = ssssdc.. */ + tcg_gen_sari_i64(t1, t1, 32); /* t1 = ssssdc.. (OS=1) */ } else { - tcg_gen_shri_i64(t1, t1, 32); /* t1 = ....dc.. */ + tcg_gen_shri_i64(t1, t1, 32); /* t1 = ....dc.. (OS=0) */ } - tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba */ + tcg_gen_or_i64(ret, t0, t1); /* ret = ssssdcba (OS=1) */ + /* ....dcba (OS=0) */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); From patchwork Wed Aug 23 14:55:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 716087 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp845801wrp; Wed, 23 Aug 2023 07:57:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2JGDfeUERU+zDAs9rI9lYcdL1en3aYez5onX1uzoc/h3J5+WwbazBtGbytw9deV1zhQTp X-Received: by 2002:a05:6214:5ecc:b0:641:8ba9:68ab with SMTP id mn12-20020a0562145ecc00b006418ba968abmr11785329qvb.42.1692802628499; Wed, 23 Aug 2023 07:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802628; cv=none; d=google.com; s=arc-20160816; b=hdCeVdEmTBuJHMEok0zF2lWKsMD+b0+eRDw5OVGDZIOdRPYqRqJ3y1qt9d9o6ZXJH7 HefnoZeWDd6YSz3OuCjIzo7y9PqL5i4aE4HLjSBqVLAawFI1IIJnFriHR8QC6s0O2aCZ mvdFrYRW3Zhaog49AX1YaHCMuDNgP6qk0iN241crKxGMRZDZv1IIvQ6KfkJ96psz2WLI AYxdhL3PpkjQRRt7miA9BvQkZWRutoL2C7u0L/ImspufdV5wrEsH1gJBwXf2RFP/wZFX qLTd/JwW1LsHY38id/AuVXX/bbPb+h4StVbdSLIjHKHxr83Sc23FGdZhX6hFn+09dUyQ E+3g== 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=2TDxedktHF/mlH5ygYaw8lfO5Y3QpjQH82Lwm6XiycI=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=EyE1xmw6EE/8ltA/vYwwzo5zTLlqR2dQgBTU27tbwljs5EC36t7YsZwj9gFgTae0Bl LM5lOoLqbR9HbWFLpqjNWI6fc9IvBVohZChWW5tODBXn1Fg/a7rNHuiVKJvN7OcWOGFk E5HpJZxOVg4iolsaJAa5T/E3+il4dnmePkDXC0jpFt7galDI/2sXoFc2uOMt9KuWI9Dr a50VWT1T0Gh7qy2ePdI8ODD4ytge5an0TGSfFxUSMeIBNYlO6ZD0kz9kqVaJpNCw/C8D H84iR4nHUTpsyWfHDmM0gJ1e0O6P18QoG4VO4ekdmc+kyV3ybAkD0fkwiuFtbGhRmxxe M+yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hvWL6+3n; 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 o2-20020a0c8c42000000b0064712f60cd0si7408413qvb.611.2023.08.23.07.57.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:57: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=hvWL6+3n; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé 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) } } +/* + * 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 == 32) { From patchwork Wed Aug 23 14:55:40 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: 716093 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp846156wrp; Wed, 23 Aug 2023 07:58:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRo2uSF5ylm9FCip9B4bC58MUA7uGfU1sLILJTvOESYbqoh2PPbuPfrvlDjSPjuNm+/6tj X-Received: by 2002:a05:620a:2587:b0:767:1d7e:ec40 with SMTP id x7-20020a05620a258700b007671d7eec40mr14483446qko.1.1692802680976; Wed, 23 Aug 2023 07:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802680; cv=none; d=google.com; s=arc-20160816; b=sBjS70DunVVRRK8g5gw1SbsMU7/lpHyg12FZMkCa+DCAjcVDTIbsc9oERskU9osnQa ygxdLGBPQPYAk5baQuBNYeZp/OAwEjrCWVbicND/qEV/Zj4i0TwHAt8e6ixd6vsEtVHX CUA/WA1TZk4eBYJPkB/L8KiQZ5tQeG4MzmnQKZLZ31eXZoEqJb5AeNKo/aKuDZ3SKFlG nH7w7KWBToNPE4U2qV/hy1RVYOWE3gcrlzTyJEJwT15LXEoUSCLOcKrBJf5Wsh0S+xRS fDYdThfRSM48XNY/jMikZ9C15IiKfG+jpB80SVPHNfuBTk+GpfYmK21uE3/mMFOlxKDD lsZw== 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=4LGg5YkxcJlmoWgJXIWbZP7qpa7parjz3qUn2eNwA1g=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=019Th8WYoFLvxT8rpLv8wZ1TA4MZq6X6ocSlRj6tm4+Zn32M0MpUFj+yUwbkasdRqI 02g0uwpUQLlB3P7cnTPOF6nV66F6sQuHgufJN71DI0JO59w8uIv2r91XPNEjJw/nyDyq rf1BP98WHmS9teszwQz7FZeRZqGrUw/5Q5VEtTk5vjM5g99hRi/q9kLMitYNSUw8+2mV IDKng2+52MrMX8buxSHBffTXC/OqByiZCQaomdMVCxMw9a0bCnP0k3y7COeqj7dytZz1 AjO6Rv019SyVXaXDgdrtjoNeWaVzGjXm0bELgohcvPradPzrGthERNjW1MN1rAAfftO1 CDqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KDsDjuVf; 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 bs42-20020a05620a472a00b0076cc7de6bc2si234219qkb.442.2023.08.23.07.58.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:58:00 -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=KDsDjuVf; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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 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é --- 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) } } +/* + * 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) } } +/* + * 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 = 0x0000ffff0000ffffull; TCGv_i64 t0 = tcg_temp_ebb_new_i64(); TCGv_i64 t1 = tcg_temp_ebb_new_i64(); - /* 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 = abcdefgh */ + tcg_gen_rotli_i64(t1, arg, 32); /* t1 = efghabcd */ + tcg_gen_andi_i64(t0, t1, m); /* t0 = ..gh..cd */ + tcg_gen_shli_i64(t0, t0, 16); /* t0 = gh..cd.. */ + tcg_gen_shri_i64(t1, t1, 16); /* t1 = ..efghab */ + tcg_gen_andi_i64(t1, t1, m); /* t1 = ..ef..ab */ + tcg_gen_or_i64(ret, t0, t1); /* ret = ghefcdab */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); From patchwork Wed Aug 23 14:55:41 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: 716090 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp846005wrp; Wed, 23 Aug 2023 07:57:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1U/zc+k5ia+DhEjU1u0MR0E2rgKFI6iTh2HIeaf0/qL5yeQwOCDJ/NbJDx6kRtbsDKr8C X-Received: by 2002:a05:622a:48e:b0:410:9a75:9ff7 with SMTP id p14-20020a05622a048e00b004109a759ff7mr7813025qtx.57.1692802657453; Wed, 23 Aug 2023 07:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802657; cv=none; d=google.com; s=arc-20160816; b=U9LHEKYoKC9jBRT6Ck6d2dRvK24XCxkrNyr4rg1SnGnqXKtFNK5vX7d6yDNFSeKLAV 1m/TrCi28G7Wo6mWYLIjoCAgUCIJaZ8DRDt+WgUtpQa95PZdD3dHwRE+oLHfp3UQmj/k 5isGj58Hyw86vqBQqd+8pyBZtQh/8RhYLt5eXJ+uO1m0ooarqS6tnugySGR/fOYu8FBk 8Q7qUMcM/3Kzmips9aFM4ZVRVk8NkVrOipbHZ18v+++t7cxfkaEiWLh8iT1/xv6N/EVf crqVL8SCO6sw4MJo+I1Xhv13mDBEmHamMOcS4nfRI2bzKbpX/AzZOlW6gS1NoayIIKaY Gixg== 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=xCK2VK8xRH2D9lhMRhXp0tgYAA1ZvGcHBcKuN6vO5TM=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=kS+nstUilxxeHjiKhJa6Fc1til34eKsLq3bpNv6xaM90srX51zb0zGKXzcOAwaG/yz kckEnubg8ilzxlJMj38ix58aMCWSehON4vOuvyrbHCrjliUtwFuOeh0Z4kQfpSI40ZNK gL7+C8+dF0AoC5nyYJyX6/jlwAgjzCx7V9fzyw3e/UsxP+CSAZoweL9Hbwl9OaldG4Bd 9Vtlm7Pv0rWXYTnVR2uzsV8M0HOmdLL5gQ1LsVgmlYJDWW/rBRda9pKGUs9+jBMBSXBk /B/H5dGMXGm3Eg6NYJirZjDPWM3om2Vd23+qzXVmT5g6MVW5BWUasieRFA2BivX3hXdI otjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KTGplDGq; 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-20020a05622a000f00b00403b0f6661asi7651593qtw.94.2023.08.23.07.57.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:57:37 -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=KTGplDGq; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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); } +/* + * 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. */ From patchwork Wed Aug 23 14:55:42 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: 716091 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp846025wrp; Wed, 23 Aug 2023 07:57:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEJy1+85oPDrZmt+iddgGSV7Bt8JVRLf3gSslGuHzU/w0TkiyGGfyzC6TmDXL/x0uQaUjn X-Received: by 2002:ac8:57d6:0:b0:410:9b0f:e67b with SMTP id w22-20020ac857d6000000b004109b0fe67bmr10369414qta.22.1692802658868; Wed, 23 Aug 2023 07:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692802658; cv=none; d=google.com; s=arc-20160816; b=WXORPOUBRs1U07PntY/naW/FL/C2Wq5mAvEMHj0if3HRVfpoK5Mb3SZQrWiS0czRS4 2R552yPRm2aTYKJUop4auSC2rwT1LvzNQgFd44nlDILl+qpG8t1mHHDKdvWvRDBNFFD9 O3l8YEzu3Um9/zFhAdsx1zbtO8/MQ0PjslTvKrNrobedvdUbbJdLXrGRMVe+EgRbTGf9 GTJe1ZNaAGaVaxY9EGdKRuGvmiIMO8d46fjU1pB0vKkquTQUpJ3M+dA08a0swpC2VLkV ESLnwagSsvfpIp4WnGwkAzKvndhBpfVAV8FnAcLbc37ulGkHAgJO9kFSKxPHNCxbhLtw bpfQ== 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=XE9v7foDNFxPe4946YxN3Nb7epPtd1r5RF+iq2i5yko=; fh=yu5WrcKZQNMrhC/JtztxdBEgrd5tmo4xnBF1jMP240s=; b=A8pDoBIdJvosAHo6feI94PpvQLGrAekupS9PAxCJxoMAPDQXshq5ePTlVKYp+CWhko jLyj0niVthoz1LXEv+RGvehp9CYhYzvMJn3Z1BHgnxzh0o0IU4tRlJOcTaf8Tfsp5qgi J+Ic6OLGv0yW30ckUdcXVvcUCpO/zTv+GjwWHomkKKkohAVSkH4c0EEACODxRKHwfyOO qHyerdTdDVBrqQsBlxQcE/YMRYPagZtGpgUa+AAgUkd1W95g5sPmgySgNNKPzz7C/1qC IeIrOQhf8n7YTGjKsrZRa5iAsFe0a5V2jkXUXUOSz6yxtPbfmpQWZKfL4LvGmvu7YL0i 6WzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eH7VO7+5; 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 y14-20020a05622a004e00b0040399b07ccdsi239841qtw.149.2023.08.23.07.57.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 07:57:38 -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=eH7VO7+5; 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 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , "Edgar E. Iglesias" , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias --- 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); } -/* Reverse the within each byte. - T0 = (((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 = ((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) {