From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) by sourceware.org (Postfix) with ESMTPS id 0A7FF3858C66 for ; Wed, 26 Jul 2023 08:21:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A7FF3858C66 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-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-4863ccc4e8eso471532e0c.1 for ; Wed, 26 Jul 2023 01:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690359689; x=1690964489; 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=6mWQcwZVo8KCBb7QhHlxrkB7cInn7XYk/flKIZgoQ28=; b=UjUewnv2pm4pOqfiIH+F1UlyEl2/h9B/FiKj/LzmaFQQVgs+FhXx3Q2RCRmRnAO9/8 vnyk/SpZ6mfHkKZsOmT/CbgUW0HyxOxUFJPVizqY8aWmooneNswmHS0vqaNfvsZthv7n CFJJWBcMyTLjH5lqsv2SykwotsmAyNY2mV5joR6pqQjzxJqRj3y4UcV+c+/Xg4pDdfZ0 CJGR7iX5vVRx+oRAUGPtANAf2Nbs4gOls0InM92A4kIM/ImlwGBL1H7QXuofz8xQNb3z upoJInXK5UuxAvYluLQ2MBIPX6LxqYQBNCl02FwlumuKYKDRlGTYK0qzpdvGGpEF/m6+ IrBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690359689; x=1690964489; 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=6mWQcwZVo8KCBb7QhHlxrkB7cInn7XYk/flKIZgoQ28=; b=cysm6CI8VP4RDgG88BUN5usOlxwll5Up16rZjJUtJglhUE85yIoJz4RQt+9XlkVUq4 5KA2fmq8hLxAm5VPMQubi3b62qQyP7CEt6Qw3FLyjFlaUH9PFtUjQk09MTSddx/obv13 NjTW5z7BWFa1ExbC8iiL2lT6KfXNBG4fXQhWiGc0wE6nDYuaU0ObNLZ8J5M/P6pG4evd uheE2tmawcshczroUqyAeX36TVmH6uZmUelHUwwHPMkqhTBh5UMWI+bTvQRoN4jJK8Dv RJ24xbyl6p3qZVdCEfGy5yb40VwmqhQgmWW6NFjkE7CAZem+sS8/U0FNKw3X24VZDrPj 3f+Q== X-Gm-Message-State: ABy/qLYw4fEBMZ/AH2AlxyDe5labxXyN8bAzwQCWOtLAQTTv5qv+NVgX jv8eXGLBTnbDu5p8/MSL/O7S9eFW4ni5/Dl8GWE= X-Google-Smtp-Source: APBJJlELXy4ZwsrzPP0emvp8VYE86LpCJak5P6xaF38+ut4fwolgFUezOObADYKBSih+3Nn4e0mumbxKkOLvMzZa8lc= X-Received: by 2002:a05:6122:2189:b0:47d:57a0:b8ba with SMTP id j9-20020a056122218900b0047d57a0b8bamr2541629vkd.6.1690359689043; Wed, 26 Jul 2023 01:21:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kito Cheng Date: Wed, 26 Jul 2023 16:21:18 +0800 Message-ID: Subject: Re: RISC-V: Replace unspec with bitreverse in riscv_brev8_ insn To: Jivan Hakobyan Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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: My understanding is the semantic is slightly different, brev8 is only the bit reverse within each byte, but bitreverse means did bit reverse for the whole content of the mode, e.g. riscv_brev8_si will bit reserved within 32 bit. Using RV32 as example: UNSPEC_BREV8: rd[0...7] =3D rs[7...0] rd[8...15] =3D rs[15...8] rd[16...23] =3D rs[23...16] rd[16...23] =3D rs[31...24] bitreverse: rd[0...31] =3D rs[31...0] On Wed, Jul 26, 2023 at 3:55=E2=80=AFPM Jivan Hakobyan via Gcc-patches wrote: > > This small patch replaces unspec opcode with bitreverse in > riscv_brev8_ insn. > > gcc/ChangeLog: > * config/riscv/crypto.md (UNSPEC_BREV8): Remov. > (riscv_brev8_): Use bitreverse opcode. > > > -- > With the best regards > Jivan Hakobyan