From patchwork Tue Aug 22 12:40:30 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: 715746 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp235401wrp; Tue, 22 Aug 2023 05:42:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQNfVw5/71uUX4uZ/8Ce2H45cPJGCq/4OfEjTMKzyP3Uw3FeNlvFLRv7J19fTZElnRAh3o X-Received: by 2002:a05:622a:e:b0:40f:de02:8315 with SMTP id x14-20020a05622a000e00b0040fde028315mr13480524qtw.7.1692708127692; Tue, 22 Aug 2023 05:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692708127; cv=none; d=google.com; s=arc-20160816; b=CUS+/Hw+w/LFt4Mv+YmNx8hQEG8yDuiA+aTC1XfnvVzMDxzM8y9h/5QlTpnAeSfj3g ItQnpx4ROwhxBk5xXXSdyBLa6F8PXUjywwYX8QCF0/YCOC66Kv3ntyotnUp15IdWgIoP VjX/QEanVIfHsD+ZtHh8UUrKf3zw+Hba+Io7hSnFMPL6NCjR3E0QM3ALvNrrw3ylsrcD asgBFR7CJ37uRcr+EY7/s2pmmKeZ97sEEGxbA5v+evacpVaDcvEeuXgPr9MHLWWlojLz IvnKCzdoC8sa/3qy8AqyQ1Eaz9l03jSumTQdBEt/528MfEBwhweZOgh9NZh4Orjyc2AF xTxg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=u8Ncu8aR3h9eMD8scGzi1n3AJbGQYzVdDS6hz26+JPk=; fh=wXqw6aajGBSP4OKAgbWKHj3BSg7Yrdz+j0I8chPJZNc=; b=Nm0ode21eGmasGJ2tGn+2IqC4uWxxdYGqS9xtczr25Wh44D+9ci2LNyrir/gKGNkCJ 95mNyPgPMlbpYGesR3BeFgNC48djNUE8y1XyO9Zh6mT1fdBLnR0Kct9AOI4FcvOxBFsn iNtH/QAJDxE4aH3iSBPaE76gHn929aYwazLIiU43fI/5RwqhF1Kavc40Bho39Hzsfx+e edgOP3g8rHrIX7XDjqE7OX199EvwQy4TKWnqWrfaGGPalbpXrgB1BqikxQuyBc+RmQNc o0lXnqGh5hCikAc7ZDM7su+SsMAuI2o3jy0/BRUWMUyKkisCGLtRoqjDFZiEJBHcQBWN QHug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NF3/NnBq"; 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 x16-20020ac85f10000000b0040afc6ae877si1140574qta.640.2023.08.22.05.42.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 05:42:07 -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="NF3/NnBq"; 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 1qYQgw-0006H8-R7; Tue, 22 Aug 2023 08:41:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYQgo-0006Eu-HX for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:40:57 -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 1qYQgl-0005Tv-Sq for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:40:54 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3feddbb670cso31553555e9.3 for ; Tue, 22 Aug 2023 05:40:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692708048; x=1693312848; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=u8Ncu8aR3h9eMD8scGzi1n3AJbGQYzVdDS6hz26+JPk=; b=NF3/NnBqtM3teswifD6fa3hcHPneD1HhvqQpaLmWGojJnKrQn1HY5lz+I0z1WI0AWp 7+Qlshl5m95u1vi9StXBqznx/BFqzBr26r18dHbbXGH70IpEx51Frn3hcl+Z+UXaPVXS rWqYewYClt1P6981XuXwxekFN2OWDQwQh/KbbztLTMDyqI4t0XChFHtWUMPtOCwv0ZVa C3RpkczLngV7517x95aVMh2mrnaA9aXbfjAj/I2MAFswVbY25gPjdLR9f4aYcJFvwUYy IUOrl/iAQHvcbmMEzUcI4agfHdgQTA9f8olSnC6ynZ4IC60nJ0j5f8dF1CbGuOSvnXAz RiEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692708048; x=1693312848; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=u8Ncu8aR3h9eMD8scGzi1n3AJbGQYzVdDS6hz26+JPk=; b=PyITw8unjPB6E4vbKPJU9U/FcQknpFgz2rDOotswc0HNbl7LU1jqpyIb0Qr3X9CsLB cUQcELsvO7ESS9b6+/52B8X4Q0xRI2lhJ3YnUIarKwXFkEiGSWTR12NUhjC4raQ/5ZTa gdWoPFILqLOJFtT/bMAWqSG55Bez9YpKgTubOLkARKxYB6NZzC5lyrb4CowsJ0VmCS+t ROwyGZco6gCuUvPueNG85dBugMwZTOUjBfRSFS8LWqWXu5FBSZuQrMPqhkU/h62rajw4 uwzvKX1/7qbLAJkH8DjF/tBoTeKIxfcq3GBAw3bpwds6ERwNcAG8RUE43swQilpUS/HI kAtg== X-Gm-Message-State: AOJu0Yxo9hKBiyZ52xErgGWBEn8bj2uhlsF4allmu4qyg38Y5ff1vhKA PEiPzyX+GaTjBDx1x+D1MIQMqmGMh1Y/MIt5vVgpbQ== X-Received: by 2002:a05:600c:2349:b0:3fe:18be:76f8 with SMTP id 9-20020a05600c234900b003fe18be76f8mr7377654wmq.38.1692708047726; Tue, 22 Aug 2023 05:40:47 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id x26-20020a1c7c1a000000b003fc16ee2864sm15541120wmc.48.2023.08.22.05.40.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 05:40:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao , "Edgar E. Iglesias" , Richard Henderson , Greg Kurz , Aurelien Jarno , Peter Maydell , qemu-ppc@nongnu.org, Daniel Henrique Barboza , Aleksandar Rikalo , Paolo Bonzini , David Gibson , Jiaxun Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Yoshinori Sato , Nicholas Piggin , Xiaojuan Yang , qemu-arm@nongnu.org Subject: [PATCH 00/12] tcg: Factor hrev{32,64}_{i32,i64,tl} out Date: Tue, 22 Aug 2023 14:40:30 +0200 Message-ID: <20230822124042.54739-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This series factor the "byteswap each halfword within a 32/64-bit value" code duplication as generic helpers. Modulo the documentation added, there is a good negative diff-stat, so I believe this is a win from a maintainance point of view. I used "hrev" to follow the other bswap/hswap/rev helpers but it isn't very descriptive, so any better name suggestion is welcomed. (In particular because there are other patterns I'd like to factor out and then naming is getting worse, such 'wrev'). Philippe Mathieu-Daudé (12): tcg/tcg-op: Factor tcg_gen_hrev32_i32() out target/arm: Use generic hrev32_i32() in ARM REV16 and VREV16 opcodes target/cris: Use generic hrev32_i32() in SWAPB opcode target/rx: Use generic hrev32_i32() in REVW opcode tcg/tcg-op: Factor tcg_gen_hrev64_i64() out target/mips: Use generic hrev64_i64() in DSBH opcode target/ppc: Use generic hrev64_i64() in BRH / BSWAP16x8 opcodes target/loongarch: Use generic hrev64_i64() in REVB.4H opcode tcg/tcg-op: Add tcg_gen_hrev32_i64() and tcg_gen_hrev_i64() target/arm: Use generic hrev_i64() in Aarch64 REV16 opcode target/loongarch: Use generic hrev64_i32() in REVB.2H opcode target/mips: Use generic hrev32_tl() in WSBH opcode docs/devel/tcg-ops.rst | 10 +++ include/tcg/tcg-op-common.h | 4 + include/tcg/tcg-op.h | 2 + target/arm/tcg/translate-a32.h | 1 - target/arm/tcg/translate-a64.c | 11 +-- target/arm/tcg/translate-neon.c | 2 +- target/arm/tcg/translate.c | 14 +--- target/cris/translate.c | 20 +---- target/mips/tcg/translate.c | 24 +----- target/ppc/translate.c | 10 +-- target/rx/translate.c | 8 +- tcg/tcg-op.c | 81 ++++++++++++++++++--- target/cris/translate_v10.c.inc | 2 +- target/loongarch/insn_trans/trans_bit.c.inc | 30 +------- target/ppc/translate/vsx-impl.c.inc | 19 +---- 15 files changed, 99 insertions(+), 139 deletions(-)