3 ms·
Note that this board, the Lichee Pi 4A, has pretty good vector units, though they implement the current draft version of RVV (0.7.1) as at the time the core was
by brucehoult 3y ago
Note that this board, the Lichee Pi 4A, has pretty good vector units, though they implement the current draft version of RVV (0.7.1) as at the time the core was designed in 2019. Significant incompatible changes were made before RVV 1.0 was ratified in November 2021 -- the general design is the same, most instructions and binary opcodes are the same, but both source code and binary incompatibilities exist.
But at the same time, much useful library code such as memcpy(), strlen(), strcpy(), strcmp() etc can be binary compatible (and optimal) for both.
Most toolchain and library effort is going into 1.0, of course, but if you buy one of these and want to write vectorised code you can do so using assembly language, which is much easier than using typical SIMD ISAs.
For example, here is an optimised memcpy (dst, src, len in a0, a1, a2):
0000000000000000 <memcpy>:
0: 86aa mv a3,a0
0000000000000002 <.L1^B1>:
2: 00267757 vsetvli a4,a2,e8,m4,d1
6: 12058007 vlb.v v0,(a1)
a: 95ba add a1,a1,a4
c: 8e19 sub a2,a2,a4
e: 02068027 vsb.v v0,(a3)
12: 96ba add a3,a3,a4
14: f67d bnez a2,2 <.L1^B1>
16: 8082 ret