From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id AD3493858C36 for ; Fri, 27 Oct 2023 13:39:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD3493858C36 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD3493858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::535 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698413941; cv=none; b=kOTge6WBhcX509CnImJfgwSnfPv+XDZEin87MK5lVyJYIhStke+9k6wIXeSbFyw+iwGg7Cr9G4x1F0Wd+ME32CpyCUhAHkEaKJIj1ow4Ct/YRwl9TptdyWpxW6cOzlB0+ozZ/5fKJz+81UwcF/ibjExjMsT77CKo/ZVqPxqTeY8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698413941; c=relaxed/simple; bh=ytFpU0c2vuidAQ60KaFBKXihnbne0tgj9XMBwIoXTOc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=U8ujd0tsUORObqCs9TM4T9zeWdYlziQ9OlN/TUOWzJxWwrNNs8CYT1flHUNFyhKjP/ZxiOByMcyXz+nuGk1ZKv7OqedVNfYzAX1a27Dmvt2PXDpoJSFaGNWiBioeCWMd4I3JEH3aaR+U/oCylpNcL4bJyZSMK2dM07XtJaj0gsE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-584a761b301so1705487a12.3 for ; Fri, 27 Oct 2023 06:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698413939; x=1699018739; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tSrJh0nJSQyujtFbKeKh+YjCh0obz0bBpIIqDzBubNk=; b=f9PyXrfbL15dZpNWIbFvp3ZeNzMp5OCS9xCfdoT2J5ErRHyfZsALX2O/AshmmF6pnp UGjxeiU3tNAgXJkGSLhFm48AszVmfIDbN7W5nchU75qvfPGgJ2yJfa+cGFUQWgj/0mje dcJRcYGnXY+zUphM4MPC609O3nuD7ZbKLqrsVuU6ddPJ5O7M7QuYg46kxP9DhxLe5Zk2 Ph2PqTuPaxFHFt3Pebo1aHWoLlKmkShkicKDtT2tRgRFiABYjPfHwfrf10XyZtLNPL9F 1B9Hmj2VskS4WIeB7nfrQ+SA4KxdkLZFHuij+aZPOSjSRlMYi4y1E/11CLO1mrMXukgk 9Rmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698413939; x=1699018739; h=content-transfer-encoding:in-reply-to:from:references: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=tSrJh0nJSQyujtFbKeKh+YjCh0obz0bBpIIqDzBubNk=; b=aHunHZF8lnEl6E3+FViq5wUj7UMZv0S9dzga0BnrGhM8FZ4Zp8k21PcC6N8imstqTn jkD7y7EPXqMYLnxCMz61p+kv5azLP/dQ9cPRMfW0JWv9T+Ct+FgqiAbOT6GV361HyNux FPt591YlV4OKdMhIJ6uJzS+nUzPx9OejmTQfsArau8HpDoGAINnoYXgAKkiy2pordJZz nGGjw5lBNOvXUKympshmRZ7P9G+fH1u9424PwcNqHEXkkLUwZDl5cLxMOrUZxBdJIYLE Fa7+dPqcigx7ahqCgiAfW+uyN/93wWHxHCyunm6syfnbOhsBrizMDQxBwXjHfePRWw6n hiJg== X-Gm-Message-State: AOJu0YycwYIZ2GYkJSWwtSjf/6XpBcHl6txu6pJHzXGbZu2nK/N/7n3Y vmbRYS1CQwppO7/reb3ggPM= X-Google-Smtp-Source: AGHT+IE82hMDJbgJMX4NuCzqvRtbn4le737vS4Fjv6pHBpxTTn16JgMvNeGEXZpW0SwtarBdgLQeOw== X-Received: by 2002:a17:90a:db42:b0:27d:a59:ebae with SMTP id u2-20020a17090adb4200b0027d0a59ebaemr2767315pjx.46.1698413939423; Fri, 27 Oct 2023 06:38:59 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id p7-20020a17090a348700b0027ce48022cbsm3658588pjb.14.2023.10.27.06.38.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 06:38:58 -0700 (PDT) Message-ID: Date: Fri, 27 Oct 2023 07:38:53 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] RISC-V: Add rawmemchr expander. Content-Language: en-US To: Robin Dapp , =?UTF-8?B?6ZKf5bGF5ZOy?= , gcc-patches , palmer , "kito.cheng" References: <207cb501-558a-445b-95b5-b891819aefb6@gmail.com> <8C2D8235D4C8D5F4+20231027063748273099110@rivai.ai> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 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 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 10/27/23 01:38, Robin Dapp wrote: >> Suggested adapt codes as follows: >> >> unsigned int element_size = GET_MODE_SIZE (mode).to_constant (); >> poly_int64 nunits = exact_div (BYTES_PER_RISCV_VECTOR *TARGET_MAX_LMUL, element_size); >> if (!get_vector_mode(mode, nunits).exists(&vmode)) >>   gcc_unreachable (); > > Actually I was initially considering using lmul = m8 here, > unconditionally, but the param is probably the more intuitive choice. > > Attached v2 with that included. Also moved the riscv test to > autovec/builtin/ so we can add the other builtins as well. > >> Also, this patch reminds me we are missing some more similiar builtin >> function which can use RVV: >> >> strlen, strcpy, strcmp...etc > > Yes we should still have them but I'd rather not work on that right > now. How about I open a PR for it so we can still add them in stage 3? > Their impact is pretty localized and the risk should be low. > Kito, Palmer, Jeff - would that be acceptable? I'd definitely like to see them get included. Those routines often have efficient and relatively simple vector implementations. I'd open the PR, mostly so we don't lose track of them. Whether or not to include after stage1 closes would be done on an individual review basis -- the deeper we get into stage3/stage4 the higher the bar would be. What I'm keen to avoid is lots of new work going in after stage1 closes. Jeff