Lines Matching refs:poly
107 struct gf_poly poly; member
275 static inline int deg(unsigned int poly) in deg() argument
278 return fls(poly)-1; in deg()
342 uint32_t poly; in compute_syndromes() local
355 poly = *ecc++; in compute_syndromes()
357 while (poly) { in compute_syndromes()
358 i = deg(poly); in compute_syndromes()
362 poly ^= (1 << i); in compute_syndromes()
545 static int find_poly_deg1_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg1_roots() argument
550 if (poly->c[0]) in find_poly_deg1_roots()
552 roots[n++] = mod_s(bch, GF_N(bch)-bch->a_log_tab[poly->c[0]]+ in find_poly_deg1_roots()
553 bch->a_log_tab[poly->c[1]]); in find_poly_deg1_roots()
560 static int find_poly_deg2_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg2_roots() argument
566 if (poly->c[0] && poly->c[1]) { in find_poly_deg2_roots()
568 l0 = bch->a_log_tab[poly->c[0]]; in find_poly_deg2_roots()
569 l1 = bch->a_log_tab[poly->c[1]]; in find_poly_deg2_roots()
570 l2 = bch->a_log_tab[poly->c[2]]; in find_poly_deg2_roots()
602 static int find_poly_deg3_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg3_roots() argument
608 if (poly->c[0]) { in find_poly_deg3_roots()
610 e3 = poly->c[3]; in find_poly_deg3_roots()
611 c2 = gf_div(bch, poly->c[0], e3); in find_poly_deg3_roots()
612 b2 = gf_div(bch, poly->c[1], e3); in find_poly_deg3_roots()
613 a2 = gf_div(bch, poly->c[2], e3); in find_poly_deg3_roots()
635 static int find_poly_deg4_roots(struct bch_control *bch, struct gf_poly *poly, in find_poly_deg4_roots() argument
641 if (poly->c[0] == 0) in find_poly_deg4_roots()
645 e4 = poly->c[4]; in find_poly_deg4_roots()
646 d = gf_div(bch, poly->c[0], e4); in find_poly_deg4_roots()
647 c = gf_div(bch, poly->c[1], e4); in find_poly_deg4_roots()
648 b = gf_div(bch, poly->c[2], e4); in find_poly_deg4_roots()
649 a = gf_div(bch, poly->c[3], e4); in find_poly_deg4_roots()
863 *h = &((struct gf_poly_deg1 *)f)[gcd->deg].poly; in factor_polynomial()
875 struct gf_poly *poly, unsigned int *roots) in find_poly_roots() argument
880 switch (poly->deg) { in find_poly_roots()
883 cnt = find_poly_deg1_roots(bch, poly, roots); in find_poly_roots()
886 cnt = find_poly_deg2_roots(bch, poly, roots); in find_poly_roots()
889 cnt = find_poly_deg3_roots(bch, poly, roots); in find_poly_roots()
892 cnt = find_poly_deg4_roots(bch, poly, roots); in find_poly_roots()
897 if (poly->deg && (k <= GF_M(bch))) { in find_poly_roots()
898 factor_polynomial(bch, k, poly, &f1, &f2); in find_poly_roots()
1051 static int build_gf_tables(struct bch_control *bch, unsigned int poly) in build_gf_tables() argument
1054 const unsigned int k = 1 << deg(poly); in build_gf_tables()
1068 x ^= poly; in build_gf_tables()