Skip to content

Commit

Permalink
erasure_code: use internal gf_vect_mul_base for ppc64le encoding
Browse files Browse the repository at this point in the history
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 <pablo.de.lara.guarch@intel.com>
  • Loading branch information
pablodelara committed Jan 15, 2024
1 parent fff6a24 commit f732ce1
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions erasure_code/ppc64le/gf_vect_mul_vsx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#include "ec_base_vsx.h"

/*
* Same as gf_vect_mul_base in "ec_base.h" but without the size restriction.
*/
static void _gf_vect_mul_base(int len, unsigned char *a, unsigned char *src,
unsigned char *dest)
{
//2nd element of table array is ref value used to fill it in
unsigned char c = a[1];

while (len-- > 0)
*dest++ = gf_mul(c, *src++);
return 0;
}

void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned char *dest)
{
unsigned char *s, *t0;
Expand All @@ -19,8 +33,7 @@ void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned

head = len % 128;
if (head != 0) {
// errors are ignored.
gf_vect_mul_base(head, gftbl, src, dest);
_gf_vect_mul_base(head, gftbl, src, dest);
}

vlo0 = EC_vec_xl(0, gftbl);
Expand Down

0 comments on commit f732ce1

Please sign in to comment.