From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 623393858D32 for ; Sun, 5 Feb 2023 17:33:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 623393858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pj1-x102d.google.com with SMTP id ge21-20020a17090b0e1500b002308aac5b5eso3389272pjb.4 for ; Sun, 05 Feb 2023 09:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=2shCI5Emu4EHosnXc1/1J/XFJz3fdJ+T4PTaIjTjxoc=; b=zFk58qTAiMRfxYBYa2yPpIuzVQesQI9EYL1Qmv8oGLYCeTEIZfHi9PBX5oWRIaiwNF fgHoDtdqQboEBBi4iCLFAqIuNWhaD1VC0JrgHzYsOwJM9+Bhb2mpV501h/jFtw65Gg4c eEvB5ZIRiQGLu6XUikIDeihEwu6aLPnKsR0pWOgmYxUj7sCyU6A5Sv7KDYIiEg1/g/r5 vlZL1PF1P4jFb3MhdePai6VrWN1tzka+f6hNbsS+nNibHLNYuEz9ah+0uiUbuCw8+n6Y Diwe7yQ7f9U3ajq9QVWKIPk99u9poZc1jKlb/+B/wFCzInWcPO/V4ZBB/bAXc7iFvOSg OqIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2shCI5Emu4EHosnXc1/1J/XFJz3fdJ+T4PTaIjTjxoc=; b=GjZSk23DTODYpgYF9d3r4DRUNSxPhLEaC5/fjq5DxXQ8d36InJvRKBhKRto1DC2m4R 3wUWSRaQGZFrcqZ0V2loiPe4ZXVlsw+zLBGq+dcDvq51zErtZN4IRTN0I3xb1ureA4Bs rJMedM/CwpiVE7pqY0TfYgwmZ56xlWjeeD1+ndgqReMRj0oJ2tnT7yZVLVhBwneerrPG TBNeood3ihLUi8OJNxCrU66RdG71igN3GS/kkKlDjyuY99hWR1cyIeK4Sa2x8rkmXETz LtBZEaYxw1SKFt/aHmx9AcQVqiHEwFSGd++0Fi0k5+zx+BGU2BzPwiGz0l/BCGxdOB7z CSwg== X-Gm-Message-State: AO0yUKXUBMlHyaXwf6CRyoonib/uP46fmsyFvIzSJelDXHtwUsIaEVLP t1+iyo/r1O9LVwC4tvvItZhNUQ== X-Google-Smtp-Source: AK7set9DNeF62iYKBULIysM7IHlv3ygCPv2hE6KIViGAzVphykyJuPrEtDGM3jC1akt5jucVcbDN2A== X-Received: by 2002:a17:90b:33d1:b0:22b:ec81:c36c with SMTP id lk17-20020a17090b33d100b0022bec81c36cmr18401946pjb.45.1675618431317; Sun, 05 Feb 2023 09:33:51 -0800 (PST) Received: from [172.20.101.2] (rrcs-74-87-59-235.west.biz.rr.com. [74.87.59.235]) by smtp.gmail.com with ESMTPSA id c7-20020a17090a020700b0023080c4c3bcsm3728980pjc.31.2023.02.05.09.33.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Feb 2023 09:33:50 -0800 (PST) Message-ID: <7f065909-568e-b922-ecc9-436b506c767b@linaro.org> Date: Sun, 5 Feb 2023 07:33:46 -1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v11 20/29] riscv: Add string-fza.h and string-fzi.h To: Jeff Law , Adhemerval Zanella Netto , libc-alpha@sourceware.org, Noah Goldstein , Xi Ruoyao References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> <20230201170406.303978-21-adhemerval.zanella@linaro.org> Content-Language: en-US From: Richard Henderson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 2/4/23 06:31, Jeff Law wrote: > > > On 2/2/23 05:30, Adhemerval Zanella Netto wrote: >> >> >> On 01/02/23 14:53, Richard Henderson wrote: >>> On 2/1/23 07:03, Adhemerval Zanella wrote: >>>> +static __always_inline unsigned int >>>> +index_first (find_t c) >>>> +{ >>>> +  if (c & 0x80U) >>>> +    return 0; >>>> +  if (c & 0x8000U) >>>> +    return 1; >>>> +  if (c & 0x800000U) >>>> +    return 2; >>>> + >>>> +  if (sizeof (op_t) == 4) >>>> +    return 3; >>>> + >>>> +  if (c & 0x80000000U) >>>> +    return 3; >>>> +  if (c & 0x8000000000UL) >>>> +    return 4; >>>> +  if (c & 0x800000000000UL) >>>> +    return 5; >>>> +  if (c & 0x80000000000000UL) >>>> +    return 6; >>>> +  return 7; >>> >>> There is a -mbig-endian switch to gcc, even if that isn't the normal configuration. >> >> I though about adding BE support, however we explicit do not support it >> (sysdeps/riscv/bits/endianness.h) so I think we can assume LE for now. > I wouldn't bother with BE until someone comes asking for it. My only point is there's a compiler switch, and this function is incorrect in that context. One could either #error or not use this specialization. r~