From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id C1D663858D35 for ; Wed, 26 Jul 2023 16:23:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1D663858D35 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-x42b.google.com with SMTP id d2e1a72fcca58-686baccf661so13551b3a.3 for ; Wed, 26 Jul 2023 09:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690388624; x=1690993424; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Etnc/SCdV4sSqnul4JDYzZAFMpVCxYMEf/Txem8Yqdg=; b=lKyTMfJ6joOYGL5ihWYthpF0HmsGJOFnu1V9RVTglIMtHHC7l0+6G9IW7UF5wbo0Qt nj8QhEP1xxQ3YvIW8dE6bh5bwHluzOV7ffKE/OwEuH/Jy6Pk4RHpi6aJ4rja8P03HrZI apYShOtQIrrKUW6Dan9gDgriLAt7M5NhR0lac0TLHPlN2/En7RKhKRDqEXBckt9e7/BJ iuezRWAdetTPFu9NgyuoXaJ2TWjje3CJ99YkDsbSzfHLevGRvWHihugwGSYEykQhWdUh xg3qE0zZY6T1Nns+8L1QEzwl43fjSvueYY/xm64mAlH4py3b99Zt9SeRskUBh6yBXRUq oPbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690388624; x=1690993424; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Etnc/SCdV4sSqnul4JDYzZAFMpVCxYMEf/Txem8Yqdg=; b=BX8fK4oIim2U+N3vRb8A6SxxRq8wO6a8zptnW3HxJLSA9xY6dAGIEUm4+BFcMHyJ9m dqEDqmuPbtwnZd+ChpnnDqUlHhTTfoPtQ/0z5vs3PYFkIbiJ28f7CL3VCc5HMGkGhA0z fDP5+GUcK82ORG0jLvVXXHGKkX2k/LIlG4Rc/OoOg2PY5z8GCAuNZ3G6BqQ9QcIsR7hr k1qhT7aV7KMvlC3m++5Yj2t8I8LOq7qWzjzUwvsQ0mw+7ndYoMejxpB+PeC6+Vm6hYJO r5u7yo10RkcLKf8xUawwMA8Z79ufm//NFv1cQVuJyInv4q1R/+dotc7ENecYCmtpX4K/ FgXw== X-Gm-Message-State: ABy/qLb5Of7dt/3cmd15Yih5oYmsn7fCbOnOJj07pjwZKUc31tCYwo6s 197wpZrsH0cdkWzoWzo2hBo= X-Google-Smtp-Source: APBJJlHwm9CICxeFukCziwvYlBQeOx58JWi7SOfQe0ADVb7J19QHulOGfTDt/qMg95R7cDvUCot3fA== X-Received: by 2002:a05:6a00:1806:b0:668:852a:ffc4 with SMTP id y6-20020a056a00180600b00668852affc4mr2681556pfa.4.1690388623639; Wed, 26 Jul 2023 09:23:43 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id bm1-20020a056a00320100b00679a4b56e41sm11570800pfb.43.2023.07.26.09.23.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jul 2023 09:23:43 -0700 (PDT) Message-ID: Date: Wed, 26 Jul 2023 10:23:41 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: RISC-V: Replace unspec with bitreverse in riscv_brev8_ insn Content-Language: en-US To: Kito Cheng , Jivan Hakobyan Cc: gcc-patches@gcc.gnu.org References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,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 7/26/23 02:21, Kito Cheng via Gcc-patches wrote: > 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] = rs[7...0] > rd[8...15] = rs[15...8] > rd[16...23] = rs[23...16] > rd[16...23] = rs[31...24] > > bitreverse: > rd[0...31] = rs[31...0] Yea, I think you're right Kito. Goof on our side. Jivan, I think this explains why it's not working for all of Mariam's cases -- odds are the cases where it is working are for the reversed crc8. Let's drop this since it doesn't match the semantics of GCC's bitreverse. Mariam's call on whether or not to utilize brev8 for the crc8 cases where it's likely faster than other sequences to reverse bits. jeff