Commit c93dcc04 authored by francescomani's avatar francescomani Committed by Bartosz Podrygajlo

cleanup of encode_parity_check_part_optim including asserting for case not handled

parent 732555dd
...@@ -85,138 +85,119 @@ ...@@ -85,138 +85,119 @@
#include "ldpc_BG2_Zc80_byte.c" #include "ldpc_BG2_Zc80_byte.c"
#include "ldpc_BG2_Zc72_byte.c" #include "ldpc_BG2_Zc72_byte.c"
static void encode_parity_check_part_optim(uint8_t *cc, uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols)
static void encode_parity_check_part_optim(uint8_t *cc,uint8_t *d, short BG,short Zc,short Kb, int simd_size, int ncols)
{ {
unsigned char c[2*22*Zc*simd_size] __attribute__((aligned(32))); //double size matrix of c unsigned char c[2 * 22 * Zc * simd_size] __attribute__((aligned(32))); //double size matrix of c
for (int i1=0; i1 < ncols; i1++) { for (int i1 = 0; i1 < ncols; i1++) {
memcpy(&c[2*i1*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); memcpy(&c[2 * i1 * Zc], &cc[i1 * Zc], Zc * sizeof(unsigned char));
memcpy(&c[(2*i1+1)*Zc], &cc[i1*Zc], Zc*sizeof(unsigned char)); memcpy(&c[(2 * i1 + 1) * Zc], &cc[i1 * Zc], Zc * sizeof(unsigned char));
} }
for (int i1=1;i1<simd_size;i1++) { for (int i1 = 1; i1 < simd_size; i1++) {
memcpy(&c[(2*ncols*Zc*i1)], &c[i1], (2*ncols*Zc*sizeof(unsigned char))-i1); memcpy(&c[(2 * ncols * Zc * i1)], &c[i1], (2 * ncols * Zc * sizeof(unsigned char)) - i1);
} }
if (BG==1) if (BG == 1) {
{ switch (Zc) {
switch (Zc) case 176:
{ ldpc176_byte(c, d);
case 2: break; break;
case 3: break; case 192:
case 4: break; ldpc192_byte(c, d);
case 5: break; break;
case 6: break; case 208:
case 7: break; ldpc208_byte(c, d);
case 8: break; break;
case 9: break; case 224:
case 10: break; ldpc224_byte(c, d);
case 11: break; break;
case 12: break; case 240:
case 13: break; ldpc240_byte(c, d);
case 14: break; break;
case 15: break; case 256:
case 16: break; ldpc256_byte(c, d);
case 18: break; break;
case 20: break; case 288:
case 22: break; ldpc288_byte(c, d);
case 24: break; break;
case 26: break; case 320:
case 28: break; ldpc320_byte(c, d);
case 30: break; break;
case 32: break; case 352:
case 36: break; ldpc352_byte(c, d);
case 40: break; break;
case 44: break; case 384:
case 48: break; ldpc384_byte(c, d);
case 52: break; break;
case 56: break; default:
case 60: break; AssertFatal(false, "BG %d Zc %d is not supported yet\n", BG, Zc);
case 64: break;
case 72: break;
case 80: break;
case 88: break;
case 96: break;
case 104: break;
case 112: break;
case 120: break;
case 128: break;
case 144: break;
case 160: break;
case 176: ldpc176_byte(c,d); break;
case 192: ldpc192_byte(c,d); break;
case 208: ldpc208_byte(c,d); break;
case 224: ldpc224_byte(c,d); break;
case 240: ldpc240_byte(c,d); break;
case 256: ldpc256_byte(c,d); break;
case 288: ldpc288_byte(c,d); break;
case 320: ldpc320_byte(c,d); break;
case 352: ldpc352_byte(c,d); break;
case 384: ldpc384_byte(c,d); break;
default: AssertFatal(0,"BG %d Zc %d is not supported yet\n",BG,Zc); break;
} }
} } else if (BG == 2) {
else if (BG==2) { switch (Zc) {
switch (Zc) case 72:
{ ldpc_BG2_Zc72_byte(c, d);
case 2: break; break;
case 3: break; case 80:
case 4: break; ldpc_BG2_Zc80_byte(c, d);
case 5: break; break;
case 6: break; case 88:
case 7: break; ldpc_BG2_Zc88_byte(c, d);
case 8: break; break;
case 9: break; case 96:
case 10: break; ldpc_BG2_Zc96_byte(c, d);
case 11: break; break;
case 12: break; case 104:
case 13: break; ldpc_BG2_Zc104_byte(c, d);
case 14: break; break;
case 15: break; case 112:
case 16: break; ldpc_BG2_Zc112_byte(c, d);
case 18: break; break;
case 20: break; case 120:
case 22: break; ldpc_BG2_Zc120_byte(c, d);
case 24: break; break;
case 26: break; case 128:
case 28: break; ldpc_BG2_Zc128_byte(c, d);
case 30: break; break;
case 32: break; case 144:
case 36: break; ldpc_BG2_Zc144_byte(c, d);
case 40: break; break;
case 44: break; case 160:
case 48: break; ldpc_BG2_Zc160_byte(c, d);
case 52: break; break;
case 56: break; case 176:
case 60: break; ldpc_BG2_Zc176_byte(c, d);
case 64: break; break;
case 72: ldpc_BG2_Zc72_byte(c,d); break; case 192:
case 80: ldpc_BG2_Zc80_byte(c,d); break; ldpc_BG2_Zc192_byte(c, d);
case 88: ldpc_BG2_Zc88_byte(c,d); break; break;
case 96: ldpc_BG2_Zc96_byte(c,d); break; case 208:
case 104: ldpc_BG2_Zc104_byte(c,d); break; ldpc_BG2_Zc208_byte(c, d);
case 112: ldpc_BG2_Zc112_byte(c,d); break; break;
case 120: ldpc_BG2_Zc120_byte(c,d); break; case 224:
case 128: ldpc_BG2_Zc128_byte(c,d); break; ldpc_BG2_Zc224_byte(c, d);
case 144: ldpc_BG2_Zc144_byte(c,d); break; break;
case 160: ldpc_BG2_Zc160_byte(c,d); break; case 240:
case 176: ldpc_BG2_Zc176_byte(c,d); break; ldpc_BG2_Zc240_byte(c, d);
case 192: ldpc_BG2_Zc192_byte(c,d); break; break;
case 208: ldpc_BG2_Zc208_byte(c,d); break; case 256:
case 224: ldpc_BG2_Zc224_byte(c,d); break; ldpc_BG2_Zc256_byte(c, d);
case 240: ldpc_BG2_Zc240_byte(c,d); break; break;
case 256: ldpc_BG2_Zc256_byte(c,d); break; case 288:
case 288: ldpc_BG2_Zc288_byte(c,d); break; ldpc_BG2_Zc288_byte(c, d);
case 320: ldpc_BG2_Zc320_byte(c,d); break; break;
case 352: ldpc_BG2_Zc352_byte(c,d); break; case 320:
case 384: ldpc_BG2_Zc384_byte(c,d); break; ldpc_BG2_Zc320_byte(c, d);
default: AssertFatal(0,"BG %d Zc %d is not supported yet\n",BG,Zc); break; break;
case 352:
ldpc_BG2_Zc352_byte(c, d);
break;
case 384:
ldpc_BG2_Zc384_byte(c, d);
break;
default:
AssertFatal(false , "BG %d Zc %d is not supported yet\n", BG, Zc);
} }
} } else
else { AssertFatal(false, "BG %d is not supported\n", BG);
AssertFatal(0,"BG %d is not supported yet\n",BG);
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment