From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id C6ECE3858C54 for ; Thu, 11 May 2023 14:21:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6ECE3858C54 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-x42a.google.com with SMTP id d2e1a72fcca58-6439df6c268so5418477b3a.0 for ; Thu, 11 May 2023 07:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683814894; x=1686406894; 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=jUAy2btW7vGWsu7t6hph8KAMfF9oTJl3h8oIdC8xhfw=; b=XO0IlU33f93mjKySuMQwc4T0SBWBvRcOIHKQKPyWCgiangi9ze1dQUY7Vcv2Hi9xLL HV2Dyzy2Qe442prAky2L5Wr19nNjlf5YicwwWLQGcp8a0SxuB3AuZG1bGegDit6V00sE 0fyIv7ddKvbQSdgiqsFIS/zX+FVUp3bwRNwgEb8976q3eAagnik5N/ixfuoPJWmij/Vd 4o4Slz3naEK/zqHhhzAFIlq7NOgauiGQe1mTso/wKLBBs7Eq+bY9d8wW6TXcQ1APjV3U n79X9HqgYuPAPFc4FepnVmpy+djgzDmpVYAdln0QD3og8GDsQyUiTUIMC7ZMFUPH0a2Y uW6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683814894; x=1686406894; 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=jUAy2btW7vGWsu7t6hph8KAMfF9oTJl3h8oIdC8xhfw=; b=CAKzO11Co/lRKlE+cQ67wD6jpatX3ed71p/DpD2QEDADLfwyjcKZL+MJGhdJ5V5jbZ JqEW+G2tUvPXqDNYfQICt5AUH2gyuGJnR9fl7vujXjK6GOTPp273QUhkA6qyUz2QUM24 C7TuIUZI39EWm5dRL8f/3PlrlGEcn3HEBof+4b97ZSRlPyOzssOsAEczlQ5bKyUiS7El 6/PnAMHJT81SvICt704r6pNUdgfXMiFqwIYZuA7QwTUupdThgFLxMFVDQPeP/YaJNfqD zz9NB9SkD4q/SKvZDRkVYzFACnTYV5LmbGnYIfXqnHcd+EZ7AynXwuyYnRcxlyqR60UM b5Vg== X-Gm-Message-State: AC+VfDwjha0ZQVLJccsVAmPEyR+/yHGq0tgAeXsClGQ/dHS7PnJK0bNd ZReglAHmaw3Qy4kz3kPtAQopWpcwSls= X-Google-Smtp-Source: ACHHUZ5IvwjeSfLYjcxN6WPNNWBQdY+VtrdVqclZc6aMZ/o9dPoh/1JS56HMmKLoKYaQVHyN0W4HAg== X-Received: by 2002:a05:6a20:8426:b0:101:90e:c0cb with SMTP id c38-20020a056a20842600b00101090ec0cbmr14450089pzd.59.1683814893550; Thu, 11 May 2023 07:21:33 -0700 (PDT) Received: from ?IPV6:2607:fb90:46e:fe5b:9e7a:a7d5:520e:1fc2? ([2607:fb90:46e:fe5b:9e7a:a7d5:520e:1fc2]) by smtp.gmail.com with ESMTPSA id d34-20020a634f22000000b00513cc8c9597sm4989747pgb.10.2023.05.11.07.21.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 May 2023 07:21:32 -0700 (PDT) Message-ID: Date: Thu, 11 May 2023 08:21:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v2] RISC-V: Split off shift patterns for autovectorization. Content-Language: en-US To: Robin Dapp , Palmer Dabbelt Cc: gcc-patches@gcc.gnu.org, juzhe.zhong@rivai.ai, Kito Cheng , collison@rivosinc.com References: <22063fee-8e38-6da4-8658-4e7c80a3199e@gmail.com> From: Jeff Law In-Reply-To: <22063fee-8e38-6da4-8658-4e7c80a3199e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 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 5/11/23 04:33, Robin Dapp wrote: >> "csr_operand" does seem wrong, though, as that just accepts constants. >> Maybe "arith_operand" is the way to go? I haven't looked at the >> V immediates though. > > I was pondering changing the shift-count operand to QImode everywhere > but that indeed does not help code generation across the board. It can > still work but might require extra patterns here and there. Yea. It's a GCC wart and there hasn't ever been a clear best direction on the mode for the shift count. If you use QImode, as you note you often end up having to add various patterns to avoid useless conversions and such. I suspect QImode isn't ideal on a target like RV where we don't really have QImode operations. So all we do is force the introduction of subregs all over the place to force the operand in to QImode. It's something I'd like to explore, but would obviously require a fair amount of benchmarking to be able to confidently say which is better. Jeff