From patchwork Tue Aug 22 09:37:07 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: 715713 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp163559wrp; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMB289Ws4mJo02Zh+FGklSbaA8uhx5upIfxi+5SWN4FKuQ7gAGa304cqZs4TZeMD1YxVU0 X-Received: by 2002:ac8:7d04:0:b0:403:a0a4:97d5 with SMTP id g4-20020ac87d04000000b00403a0a497d5mr10344493qtb.36.1692697083331; Tue, 22 Aug 2023 02:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692697083; cv=none; d=google.com; s=arc-20160816; b=cD0crftz57MYAsKfW1vmNakArOq1Dh8JJ69opIKJZrcT+uYhlN0fZ4jfrDQyXh0oSG 1UgtTTE76xhwE2N62wHFPvTEg5d+k3nK9O0dLdybi8saARTYPsv6cpjFJv0co/hy2hwK eomh2Td/9h9vU+DaISu43NgiuYW/ub2cgvqgaaUeX7Vn9OwnQ8ITVbvdihqDv6Gem1YV sVfSFkDjFl2hXM79e2HRnLUYM6/BgZKrU5Z++QlD7df0UuA6QnxSl8hBmfQlm2yvwXGM p+HIW/uTHeosg/wj2Q8J+CVFGcYs8/NDuZauhLn8B/OSGbxlB0xd8p5lmf0ImG42s7vu Fu2A== 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; fh=eYtoxxKzGuW/ZzBKGY04QGXjEEWdmzL/9j0dDOZVqP8=; b=0udgzxh3A/HqwuRws0mYlOCIr6m9QgIT7HTGEpbU1EyOzRKgELAgb8s3fmObkSkWyG zp3R9W4bKz8cpYYUMqoPSTR8ukeJ+CEmVgE6rV4U8P+qCe04+cd4FjIAKKzN5TJ10TeR m1l673BqC5cFUBVIWT+ympoBeI1GkpPN84pp7rzGP/h9RPp71fol7gv3atKUq+VClWlq UM3gsSbhnWecKVlmB0D0djR95QgZJVMoWhRvgQ5ZQsAP764uTCxzhWrgPA3DxRKb47vA 9Ez9c8AcUPiUO7US+pbGAMOe/oVx1SwB505CUunvVSneNsCfQsNxaKveu16rp1f+SF4e pkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0pNobUt; 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 n12-20020a05622a11cc00b00403ac829523si985408qtk.304.2023.08.22.02.38.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 02:38:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H0pNobUt; 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 1qYNpM-0000UK-KT; Tue, 22 Aug 2023 05:37:32 -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 1qYNpL-0000U6-92 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:31 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYNpJ-0001f5-6R for qemu-devel@nongnu.org; Tue, 22 Aug 2023 05:37:31 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fed6c2a5cfso36531695e9.3 for ; Tue, 22 Aug 2023 02:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692697047; x=1693301847; 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; b=H0pNobUtiCZdW651FbO/wmC5OXN0Dz7vwvnB0zAGqZtsQiLGN/J4KkaEvb4q4xP1LU XnpZt7jVRHjgP8+fqjl0eZTTeiakV86cVzksBBfLroI9/rAFMcWCM1BJpsuHol4kr7wX ASkPQ1GxPbCzldfmyh6V+wtdIPhwNAinPGN2V3DsnloxmmY2Yh6D9TXluWZYwJN/kxGA 5/+qi2cl1FiT+fO2Rsxh6CPICYAjhIVSlT2PqMPpj+u0b+JbIWqJZ+t9wIxWqcfp5ScF ApFTJmnhZ0Y3JyLag+RsU1P0CYoyv4M4F2y/Phx9gixIIUmGfTLjGTeIpIrhpNBACf6l oI8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692697047; x=1693301847; 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=ScWnOEjDsuqOjg+NrysUJ/0UybO3mydJWW4efYlOcP8=; b=Iv2fC52tVViSVGJiKL8/jW/l6KZvViJ47w7T6iywshjE9S7OMwXz9QKaczWWkYuwyJ cBivK6qMjBonAiuTXdqYrpeo4VjcEpg2Rd1eHbWR0AivkyUDL9tLkBj/V88nReEaRC9n u3D9onWrWGl+Em8k0zhR54IWlwHxhsKp/sEeym3HQu1JFBhbF6ch/CJkHQeedVylQxBS qF+pIx0lZa7e+b9zWpzVpRe0546Ez5kEJmVzpMG5EIoKXspFOkWy+HFOwxlhSGhEhPzi Q61cgFI88Vv5mBCKheEtPgnI1uAwyWmVU7BbKnKUdr2kKXeJMyNR/2ycghMwnzGLIjwc r2ew== X-Gm-Message-State: AOJu0YyVeuqpKLVcQH7dhJSmMgUfWQGuz80Y5IE0+XR9g5aS7f2z2qim ka7ert7UQDa7i8ZN2Z8OMHUJSHQSaV/2qybEtIE96g== X-Received: by 2002:a7b:cb59:0:b0:3fe:f45:772d with SMTP id v25-20020a7bcb59000000b003fe0f45772dmr7038232wmj.28.1692697047571; Tue, 22 Aug 2023 02:37:27 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id q12-20020a05600c040c00b003fe2397c17fsm18871021wmb.17.2023.08.22.02.37.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 02:37:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 2/7] tcg/tcg-op: Document bswap32() byte pattern Date: Tue, 22 Aug 2023 11:37:07 +0200 Message-ID: <20230822093712.38922-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822093712.38922-1-philmd@linaro.org> References: <20230822093712.38922-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index f164ddc95e..e6b0d74a46 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1061,6 +1061,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) { @@ -1776,6 +1781,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. + * + * Byte pattern: bswap32_i64(xxxxabcd) -> ....dcba (TCG_BSWAP_OZ) + * bswap32_i64(xxxxabcd) -> ssssdcba (TCG_BSWAP_OS) + * bswap32_i64(xxxxabcd) -> xxxxdcba + */ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */