From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 0A1233858D1E for ; Sat, 6 May 2023 17:31:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A1233858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-64395e741fcso2991004b3a.2 for ; Sat, 06 May 2023 10:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683394314; x=1685986314; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IwiksNHnWCx3TgmZopyO4KVceBPK4LkqyHwxrD6q+Nk=; b=AcXMPqfgPfwJse93FAoZyc5adytNd2lw/I+gQDn9vpZYrwR4HEqArQ5YiRo8DsyHVB bh15wuDXGo1ijaBjkzHYcA7cbBgzDH5QCR64vCjbCDXfXaAzLUR913F+K3CaGoNoPhqv I9i0TFRqvFT06E+YEtj8OpuF/yZ/1SlUhAwnL76wJOlmcOnEfbUMANmukq7bVwZfHcLQ i6osu6hA9ePMBua9IGbSRVH8HnryDw9DKlolJIiSCzmKjLyVQuRwBYy2tM2ftRBZLDuz EhyiAE5XGcX0GRISG/3sw7cFLwKTJka82wURmFoOzIbFpUNwNgDeIFaRAsyinnIw4Hc8 abOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683394314; x=1685986314; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IwiksNHnWCx3TgmZopyO4KVceBPK4LkqyHwxrD6q+Nk=; b=hZU3Jz/nd09htgW8EpY/9pCmvwN2Z7IKxi+p9sgxsOaE1EB4EIFd9s0v7WPLfSUtOW IePqnSEW5coYdwX2+z7dGka5yfxyFdz9Ze9sVWDsol/pIw8h3HtZUEwUuUfGMzT9u1dt CbIbKu9Am1IQ7cg4mDwkqm4sNSGGBvuZN7NkoNRBuC+v0v6X2LTrtPLKdfP02QOzk4V+ EVX8V/CI9VGx51Mq5QEP6v8DedJ3ycxXaxg6ssk/UWX+ory+/0MvsFXJusn5jJ/sZk+8 xe5ie0QZeeeklbcTNf5sQt3+b+ptZzdUF7dAkQAixN4mhUGONg/U4rVCmazpgsJXPbFo cfVw== X-Gm-Message-State: AC+VfDwC/joT6g0lDpfT0W0NcCK3pleUJO9dNH0beSYf9vcJ8L2irGfa 0/dcrTR6o/gW1Wmerkrs/EUHDhBkzjhTj0TxOtM= X-Google-Smtp-Source: ACHHUZ44/54etAWl+lh2iFQ1xIAeVskyS+KbfEjc5BCEjM1BVxteZMebUfJQ3fX7QPdj/9S6m1cdo097wueUPwhyKyI= X-Received: by 2002:a05:6a00:801:b0:63b:64f7:45a0 with SMTP id m1-20020a056a00080100b0063b64f745a0mr7643796pfk.12.1683394313760; Sat, 06 May 2023 10:31:53 -0700 (PDT) MIME-Version: 1.0 References: <00c401d9803f$dafe3c90$90fab5b0$@nextmovesoftware.com> In-Reply-To: <00c401d9803f$dafe3c90$90fab5b0$@nextmovesoftware.com> From: Andrew Pinski Date: Sat, 6 May 2023 10:31:40 -0700 Message-ID: Subject: Re: [libgcc PATCH] Add bit reversal functions __bitrev[qhsd]i2. To: Roger Sayle Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, May 6, 2023 at 10:26=E2=80=AFAM Roger Sayle wrote: > > > This patch proposes adding run-time library support for bit reversal, > by adding a __bitrevsi2 function to libgcc. Thoughts/opinions? Are you going to add a builtin for these functions too? If so that is recorded as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D50481 . Thanks, Andrew > > I'm also tempted to add __popcount[qh]i2 and __parity[qh]i2 to libgcc, > to allow the RTL optimizers to perform narrowing operations, but I'm > curious to hear whether QImode and HImode support, though more efficient, > is frowned by the libgcc maintainers/philosophy. > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap > and make -k check, both with and without --target_board=3Dunix{-m32} and > on nvptx-none, with no new regressions. Ok for mainline? > > > 2023-05-06 Roger Sayle > > gcc/ChangeLog > * doc/libgcc.texi (__bitrevqi2): Document bit reversal run-time > functions; __bitrevqi2, __bitrevhi2, __bitrevsi2 and __bitrevdi2. > > libgcc/ChangeLog > * Makfile.in (lib2funcs): Add __bitrev[qhsd]i2. > * libgcc-std.ver.in (GCC_14.0.0): Add __bitrev[qhsd]i2. > * libgcc2.c (__bitrevqi2): New function. > (__bitrevhi2): Likewise. > (__bitrevsi2): Likewise. > (__bitrevdi2): Likewise. > * libgcc2.h (__bitrevqi2): Prototype here. > (__bitrevhi2): Likewise. > (__bitrevsi2): Likewise. > (__bitrevdi2): Likewise. > > Thanks in advance, > Roger > -- >