From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id A947B3858C5F for ; Fri, 1 Mar 2024 18:59:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A947B3858C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A947B3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709319593; cv=none; b=cEsWu2z3kc+stVpkn3G3VITbKaf2+hNC5JafuejDz3u4JvYf/84DxCaeNM+gYh7Hr2CaPKuIws7sDSquRGqPcBF0uIr3K+3uDE3nu1hLDB1wm3KZa6WwcdyIvm0faj+Ywmxj6e4JiEtzOaqq4138YalMEsUiWdEGyIe4XX40RC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709319593; c=relaxed/simple; bh=eXB6ra7Q1YapnKiKzK11KUl+75m8r+vfei+sX4r6jfo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=m2Rl80HnrbsXEzvoroN1G83GRM+8ythj4U/IiQVHT87k9P16umew49cK1cQLLUZG95+rdih2D9/CM6/pJY9ryaaLiG5fWO4DW68vJBnYh1esY9Lct/ZDiFVw9SlV3ayf/ZS3mze8K/tuYStsayJXGDLIrWK8E2CPMYySuKr9hno= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-299e4b352cdso1732183a91.0 for ; Fri, 01 Mar 2024 10:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1709319589; x=1709924389; darn=gcc.gnu.org; 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=wGOsm0J0PSjYUjGC/VUfPszuGgelK1jJrZ4IPZNON7g=; b=ZXfOBgxFFAKQ3mb07LA/1skJ0V23HbrF7X84T1WIT/RkY6ASRxZfs0Ua5WDMC4mMNC koSpvhWbCHUhbXVL4B9PZg4WHYN7htXm7JbmuPdJhJRmaTU8T3uwcTxYmIgy8jVieZk+ lfBpo6frHdReBUjrk5zt/NtMwdaN0+F3w6+GFeJnNpXx5xK+pR9/mwH6HHKElwGX3NTY hFA4LKQAYFikhu9MnKukqswO8rOR67VwExMoZefXEWDn3ckGhCrOG5vbPQOIueTnpgni N45Va6KjA7Y2i7AMYG9L4RP1v5CF+TUjbACDm4/k5yY2dAFsttEWlAD1+cB3aWzAaVfS XA3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709319589; x=1709924389; 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=wGOsm0J0PSjYUjGC/VUfPszuGgelK1jJrZ4IPZNON7g=; b=Zbj8BJBZ1gVotnWvGt4m8TVRzviOSzKKAoEyzMtvOsnBCQT16fgUURYtqeO3sJdvAQ y9LRW/3negCPkTIJrawWuIZ3yR+SGiFNey6sfTuLbnDBBwE1xSGpfrecDISn0H8A60i8 AtMltksad/iVpUqeiDL8TyK4lMelZ4VALA/h/jzEgjde2rjoaeM1JKoqJKpiy/zPva0X UT5p9syEV4CKve2Aci2DfplFkuAUdCTaLkuhfqwUbDb1kNvfFVkp87qJt53hRazUuclg UeXBb08xQkii+9Mk7vGj1/3VkKWtiCMxzBKDbpiFakQUuJDwBII016gzl1m4pZRt5WfC 5nwA== X-Gm-Message-State: AOJu0Yw7lhqVEV6kEjDsAFPn2QqmthQNrS6IOZvmw3vzgYai5XPOwFMy TGlmVtYVpDN9cpSGbORfZWKIpeYk7nxoRCxp/PRCql/K1RueOK1IGVcXxtBcnZk= X-Google-Smtp-Source: AGHT+IG2SHGRjuItX6oTY4EJDW3Xm92l3NKrq4K+0yRE+BQG4nZe8Tg8NulWImH4rNCXgmkDX8kHIA== X-Received: by 2002:a17:90a:9ef:b0:29a:eb0f:e356 with SMTP id 102-20020a17090a09ef00b0029aeb0fe356mr2386760pjo.37.1709319589418; Fri, 01 Mar 2024 10:59:49 -0800 (PST) Received: from [192.168.50.117] (c-24-5-188-125.hsd1.ca.comcast.net. [24.5.188.125]) by smtp.gmail.com with ESMTPSA id f2-20020a17090a638200b002992f49922csm3578650pjj.25.2024.03.01.10.59.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Mar 2024 10:59:48 -0800 (PST) Message-ID: <70ba4f77-809c-4d99-8d69-fe2a6ac8a8ce@rivosinc.com> Date: Fri, 1 Mar 2024 10:59:47 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] RISC-V: Introduce gcc option mrvv-vector-bits for RVV Content-Language: en-US To: "Li, Pan2" , Kito Cheng , =?UTF-8?B?6ZKf5bGF5ZOy?= Cc: gcc-patches , "Wang, Yanzhang" , "rdapp.gcc" , Jeff Law References: <20240223080558.2644800-1-pan2.li@intel.com> <20240228103532.2079576-1-pan2.li@intel.com> <1AA40984DD2A43FA+202402282158578616418@rivai.ai> From: Vineet Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,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: Hi Pan, On 2/28/24 17:23, Li, Pan2 wrote: > > Personally I prefer to remove --param=riscv-autovec-preference=none > and only allow > > mrvv-vector-bits, to avoid tricky(maybe) sematic of none preference. > However, let’s > > wait for a while in case there are some comments from others. > We are very interested in this topic. Could you please CC me and Palmer for future versions of the patchset. Thx, -Vineet >   > > Pan > >   > > *From:*Kito Cheng > *Sent:* Wednesday, February 28, 2024 10:55 PM > *To:* 钟居哲 > *Cc:* Li, Pan2 ; gcc-patches > ; Wang, Yanzhang ; > rdapp.gcc ; Jeff Law > *Subject:* Re: Re: [PATCH v3] RISC-V: Introduce gcc option > mrvv-vector-bits for RVV > >   > > Hmm, maybe only keep --param=riscv-autovec-preference=none and remove > other two if we think that might still useful? But anyway I have no > strong opinion to keep that, I mean I am ok to remove whole > --param=riscv-autovec-preference. > >   > > 钟居哲 於 2024年2月28日週三 21:59 寫道: > > I think it makes more sense to remove > --param=riscv-autovec-preference and add -mrvv-vector-bits.... > >   > > ------------------------------------------------------------------------ > > juzhe.zhong@rivai.ai > >   > > *From:* Kito Cheng > > *Date:* 2024-02-28 20:56 > > *To:* pan2.li > > *CC:* gcc-patches ; > juzhe.zhong ; yanzhang.wang > ; rdapp.gcc > ; jeffreyalaw > > > *Subject:* Re: [PATCH v3] RISC-V: Introduce gcc option > mrvv-vector-bits for RVV > > Take one more look, I think this option should work and > integrate with > > --param=riscv-autovec-preference= since they have similar jobs but > > slightly different. > >   > > We have 3 value for  --param=riscv-autovec-preference=: none, > scalable > > and fixed-vlmax > >   > > -mrvv-vector-bits=scalable is work like > > --param=riscv-autovec-preference=scalable and > > -mrvv-vector-bits=zvl is work like > > --param=riscv-autovec-preference=fixed-vlmax. > >   > > So I think...we need to do some conflict check, like: > >   > > -mrvv-vector-bits=zvl can't work with > --param=riscv-autovec-preference=scalable > > -mrvv-vector-bits=scalable can't work with > > --param=riscv-autovec-preference=fixed-vlmax > >   > > but it may not just alias since there is some useful > combinations like: > >   > > -mrvv-vector-bits=zvl with --param=riscv-autovec-preference=none: > > NO auto vectorization but intrinsic code still could benefit > from the > > -mrvv-vector-bits=zvl option. > >   > > -mrvv-vector-bits=scalable with > --param=riscv-autovec-preference=none > > Should still work for VLS code gen, but just disable auto > > vectorization per the option semantic. > >   > > However here is something we need some fix, since > > --param=riscv-autovec-preference=none still disable VLS code > gen for > > now, you can see some example here: > > https://godbolt.org/z/fMTr3eW7K > >   > > But I think it's really the right behavior here, this part > might need > > to be fixed in vls_mode_valid_p and some other places. > >   > >   > > Anyway I think we need to check all use sites with > RVV_FIXED_VLMAX and > > RVV_SCALABLE, and need to make sure all use site of > RVV_FIXED_VLMAX > > also checked with RVV_VECTOR_BITS_ZVL. > >   > >   > >   > > > -/* Return the VLEN value associated with -march. > > > +static int > > > +riscv_convert_vector_bits (int min_vlen) > >   > > Not sure if we really need this function, it seems it always > returns min_vlen? > >   > > > +{ > > > +  int rvv_bits = 0; > > > + > > > +  switch (rvv_vector_bits) > > > +    { > > > +      case RVV_VECTOR_BITS_ZVL: > > > +      case RVV_VECTOR_BITS_SCALABLE: > > > +       rvv_bits = min_vlen; > > > +       break; > > > +      default: > > > +       gcc_unreachable (); > > > +    } > > > + > > > +  return rvv_bits; > > > +} > > > + > > > +/* Return the VLEN value associated with -march and > -mwrvv-vector-bits. > >   >