Skip to content

Commit e0fd782

Browse files
pablodelaratkanteck
authored andcommitted
erasure_code: use internal gf_vect_mul_base for ppc64le encoding
gf_vect_mul_base is expected to work for all buffer sizes. However, this function is checking for size alignment to 32 bytes, to follow the other gf_vect_mul implementations. Therefore, another implementation for this function is included inside ppc64le folder to be used by the encoding functions. Signed-off-by: Pablo de Lara <[email protected]>
1 parent b8d5633 commit e0fd782

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

erasure_code/ppc64le/gf_vect_mul_vsx.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#include "ec_base_vsx.h"
22

3+
/*
4+
* Same as gf_vect_mul_base in "ec_base.h" but without the size restriction.
5+
*/
6+
static void _gf_vect_mul_base(int len, unsigned char *a, unsigned char *src,
7+
unsigned char *dest)
8+
{
9+
//2nd element of table array is ref value used to fill it in
10+
unsigned char c = a[1];
11+
12+
while (len-- > 0)
13+
*dest++ = gf_mul(c, *src++);
14+
return 0;
15+
}
16+
317
void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned char *dest)
418
{
519
unsigned char *s, *t0;
@@ -19,8 +33,7 @@ void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned
1933

2034
head = len % 128;
2135
if (head != 0) {
22-
// errors are ignored.
23-
gf_vect_mul_base(head, gftbl, src, dest);
36+
_gf_vect_mul_base(head, gftbl, src, dest);
2437
}
2538

2639
vlo0 = EC_vec_xl(0, gftbl);

0 commit comments

Comments
 (0)