<div class="zcontentRow"><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"> > > # detect extensions<br style="white-space: normal;"> > > # Requires intrinsics available in GCC 14.1.0+ and Clang 18.1.0+<br style="white-space: normal;"> > > if (riscv_extension_macros and<br style="white-space: normal;"> > >     (cc.get_define('__riscv_zicbop', args: machine_args) != ''))<br style="white-space: normal;"> > >   if ((cc.get_id() == 'gcc' and <br style="white-space: normal;">cc.version().version_compare('>=14.1.0'))<br style="white-space: normal;"> > >       or (cc.get_id() == 'clang' and <br style="white-space: normal;">cc.version().version_compare('>=18.1.0')))<br style="white-space: normal;"> > >       message('Compiling with the zicbop extension')<br style="white-space: normal;"> > >       machine_args += ['-DRTE_RISCV_FEATURE_PREFETCH']<br style="white-space: normal;"> > >   else<br style="white-space: normal;"> > >     warning('Detected zicbop extension but cannot use because <br style="white-space: normal;">intrinsics are not available (present in GCC 14.1.0+ and Clang 18.1.0+)')<br style="white-space: normal;"> > >   endif<br style="white-space: normal;"> > > endif<br style="white-space: normal;"> ><br style="white-space: normal;"> > The implementation does not involve intrinsics<br style="white-space: normal;"><br style="white-space: normal;">It looks like nothing has been changed here yet.--------------sorry, i did not notice this.  i'll revise it later. </p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;">With the current compilation conditions, if zicbop isn’t supported, the <br style="white-space: normal;">v-optimization also won’t be compiled.<br style="white-space: normal;">Have you tested the performance difference if you remove these <br style="white-space: normal;">prefetches and only use v?                                 ----------------yes.  when we use  vector  but without <span style="font-family: 微软雅黑, "Microsoft YaHei";">zicbop</span>, the performance is worse than memcpy.<br style="white-space: normal;">Can we use a condition like this to support only v?---------<span style="color: rgba(0, 0, 0, 0.4); font-size: 16px; letter-spacing: -0.16px; background-color: rgb(255, 255, 255); font-family: 微软雅黑, "Microsoft YaHei";">Since the code affects several areas and for the reason mentioned above, I prefer to keep the current logic, as it looks simpler.</span></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;">Thanks again for your review.</p><div class="zhistoryRow" style="display:block"><div class="zhistoryDes" style="width: 100%; height: 28px; line-height: 28px; background-color: #E0E5E9; color: #1388FF; text-align: center;">Original</div><div id="zwriteHistoryContainer"><div class="control-group zhistoryPanel"><div class="zhistoryHeader" style="padding: 8px; background-color: #F5F6F8;"><div><strong>From: </strong><span class="zreadUserName">sunyuechi <sunyuechi@iscas.ac.cn></span></div><div><strong>To: </strong><span class="zreadUserName" style="display: inline;">陈其国10108961;</span><span class="zreadUserName" style="display: inline;">stanislaw.kardach@gmail.com <stanislaw.kardach@gmail.com>;</span><span class="zreadUserName" style="display: inline;">stephen@networkplumber.org <stephen@networkplumber.org>;</span></div><div><strong>Cc: </strong><span class="zreadUserName" style="display: inline;">dev@dpdk.org <dev@dpdk.org>;</span><span class="zreadUserName" style="display: inline;">bruce.richardson@intel.com <bruce.richardson@intel.com>;</span></div><div><strong>Date: </strong><span class="">2025年11月17日 12:19</span></div><div><strong>Subject: </strong><span class="zreadTitle"><strong>Re: [PATCH v6 1/1] eal/riscv: optimize rte_memcpy with vector and zicbop extensions</strong></span></div></div><div class="zhistoryContent"> > > # detect extensions<br> > > # Requires intrinsics available in GCC 14.1.0+ and Clang 18.1.0+<br> > > if (riscv_extension_macros and<br> > >     (cc.get_define('__riscv_zicbop', args: machine_args) != ''))<br> > >   if ((cc.get_id() == 'gcc' and  <br>cc.version().version_compare('>=14.1.0'))<br> > >       or (cc.get_id() == 'clang' and  <br>cc.version().version_compare('>=18.1.0')))<br> > >       message('Compiling with the zicbop extension')<br> > >       machine_args += ['-DRTE_RISCV_FEATURE_PREFETCH']<br> > >   else<br> > >     warning('Detected zicbop extension but cannot use because  <br>intrinsics are not available (present in GCC 14.1.0+ and Clang 18.1.0+)')<br> > >   endif<br> > > endif<br> > <br> > The implementation does not involve intrinsics<br> <br>It looks like nothing has been changed here yet.<br> <br> > #if defined(RTE_RISCV_FEATURE_V) &&  <br>!(defined(RTE_RISCV_FEATURE_PREFETCH))<br> > #undef RTE_RISCV_FEATURE_V<br> > #endif<br> > <br> > static __rte_always_inline void<br> > _rte_mov128blocks(uint8_t *dst, const uint8_t *src, size_t n)<br> > {<br> >     asm volatile (<br> >         "prefetch.r 64(%1)\n" <br> >         "prefetch.w 64(%0)\n" <br> >         "prefetch.r 128(%1)\n" <br> >         "prefetch.w 128(%0)\n" <br> >         "prefetch.r 192(%1)\n" <br> >         "prefetch.w 192(%0)\n" <br> >         "prefetch.r 256(%1)\n" <br> >         "prefetch.w 256(%0)\n" <br> >         "prefetch.r 320(%1)\n" <br> >         "prefetch.w 320(%0)\n" <br> >         "prefetch.r 384(%1)\n" <br> >         "prefetch.w 384(%0)\n" <br> >         "prefetch.r 448(%1)\n" <br> >         "prefetch.w 448(%0)\n" <br> >         "prefetch.r 512(%1)\n" <br> >         "li t6, 512\n" <br> >         "3:\n" <br> >         "li t5, 128;" <br> >         "vsetvli zero, t5, e8, m8, ta, ma\n" <br> <br>With the current compilation conditions, if zicbop isn’t supported, the  <br>v-optimization also won’t be compiled.<br>Have you tested the performance difference if you remove these  <br>prefetches and only use v?<br>Can we use a condition like this to support only v?<br> <br>#if defined(RTE_RISCV_FEATURE_V)<br>    #if (defined(RTE_RISCV_FEATURE_PREFETCH))<br>         ...<br>    #endif<br>     ...<br>#endif<br></div></div></div></div><p><br></p></div>