[FFmpeg-devel] [PATCH 3/3] lavc/svq1enc: R-V V ssd_int8_vs_int16

flow gg hlefthleft at gmail.com
Sun Jan 7 03:33:39 EET 2024


I tested it, and indeed using vwsub is faster. Updated it in the reply.

---

I have a question: if I tweak the load order a bit, using one less vset, it
leads to being slower (the patch I submitted is 13.2, if I make the
following change, the time would be 15.2).
But I thought it would be faster.

- vsetvli      t0, a2, e8, m2, tu, ma
- vle8.v       v0, (a0)
- sub          a2, a2, t0
- vsetvli      zero, t0, e16, m4, tu, ma
- vle16.v      v8, (a1)
- vsetvli      zero, t0, e8, m2, tu, ma
- vwsub.wv     v16, v8, v0

+ vsetvli      t0, a2, e16, m4, tu, ma
+ vle16.v      v8, (a1)
+ sub          a2, a2, t0
+ vsetvli      zero, t0, e8, m2, tu, ma
+ vle8.v       v0, (a0)
+ vwsub.wv     v16, v8, v0


Rémi Denis-Courmont <remi at remlab.net> 于2024年1月6日周六 23:05写道:

> Le perjantaina 5. tammikuuta 2024, 2.56.18 EET flow gg a écrit :
> > One vset can be reduced, but vwsub should not be used in this case. I
> > modified it in this reply.
>
> Fair enough, but are you sure that that's faster than keeping the vsetvli
> and
> removing the sign extension?
>
> > Rémi Denis-Courmont <remi at remlab.net> 于2024年1月5日周五 00:00写道:
> >
> > > Le lauantaina 30. joulukuuta 2023, 18.20.15 EET flow gg a écrit :
> > > > I mistook it, seeing the vector length as the length of the vector
> > >
> > > register
> > >
> > > > ..
> > > > I have modified it in this reply.
> > >
> > > Setting element size to 8-bit is unnecessary, and a widening
> subtraction
> > > can
> > > presumably avoid the sign extension.
> > >
> > > --
> > > レミ・デニ-クールモン
> > > http://www.remlab.net/
> > >
> > >
> > >
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel at ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavc-svq1enc-R-V-V-ssd_int8_vs_int16.patch
Type: text/x-patch
Size: 5598 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240107/08ef72f3/attachment.bin>


More information about the ffmpeg-devel mailing list