Commit 191b86b5d25a42e747e1bd7733de6c532c9df45c

Authored by Loic Dachary
1 parent 59cb5104
Exists in master and in 2 other branches v2, v3

remove unused variables from #if SSE blocs

Signed-off-by: Loic Dachary <loic@dachary.org>
src/gf_w128.c
... ... @@ -90,7 +90,6 @@ int xor)
90 90 int i;
91 91 gf_val_128_t s128;
92 92 gf_val_128_t d128;
93   - uint64_t c128[2];
94 93 gf_region_data rd;
95 94 __m128i a,b;
96 95 __m128i result0,result1;
... ... @@ -106,8 +105,6 @@ int xor)
106 105 if (val[1] == 1) { gf_multby_one(src, dest, bytes, xor); return; }
107 106 }
108 107  
109   - set_zero(c128, 0);
110   -
111 108 s128 = (gf_val_128_t) src;
112 109 d128 = (gf_val_128_t) dest;
113 110  
... ... @@ -384,7 +381,7 @@ gf_w128_sse_bytwo_p_multiply(gf_t *gf, gf_val_128_t a128, gf_val_128_t b128, gf_
384 381 {
385 382 #if defined(INTEL_SSE4)
386 383 int i;
387   - __m128i a, b, pp, one, prod, amask, l_middle_one, u_middle_one;
  384 + __m128i a, b, pp, prod, amask, u_middle_one;
388 385 /*John: pmask is always the highest bit set, and the rest zeros. amask changes, it's a countdown.*/
389 386 uint32_t topbit, middlebit, pmask; /* this is used as a boolean value */
390 387 gf_internal_t *h;
... ... @@ -400,7 +397,6 @@ gf_w128_sse_bytwo_p_multiply(gf_t *gf, gf_val_128_t a128, gf_val_128_t b128, gf_
400 397 pmask = 0x80000000;
401 398 amask = _mm_insert_epi32(prod, 0x80000000, 0x3);
402 399 u_middle_one = _mm_insert_epi32(prod, 1, 0x2);
403   - l_middle_one = _mm_insert_epi32(prod, 1 << 31, 0x1);
404 400  
405 401 for (i = 0; i < 64; i++) {
406 402 topbit = (_mm_extract_epi32(prod, 0x3) & pmask);
... ... @@ -605,7 +601,7 @@ void
605 601 gf_w128_split_4_128_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_128_t val, int bytes, int xor)
606 602 {
607 603 gf_internal_t *h;
608   - int i, m, j, k, tindex;
  604 + int i, j, k;
609 605 uint64_t pp, v[2], s, *s64, *d64, *top;
610 606 __m128i p, tables[32][16];
611 607 struct gf_w128_split_4_128_data *ld;
... ... @@ -704,8 +700,8 @@ void
704 700 gf_w128_split_4_128_sse_altmap_multiply_region(gf_t *gf, void *src, void *dest, gf_val_128_t val, int bytes, int xor)
705 701 {
706 702 gf_internal_t *h;
707   - int i, m, j, k, tindex;
708   - uint64_t pp, v[2], s, *s64, *d64, *top;
  703 + int i, j, k;
  704 + uint64_t pp, v[2], *s64, *d64, *top;
709 705 __m128i si, tables[32][16], p[16], v0, mask1;
710 706 struct gf_w128_split_4_128_data *ld;
711 707 uint8_t btable[16];
... ...
src/gf_w16.c
... ... @@ -450,7 +450,7 @@ gf_w16_clm_multiply_2 (gf_t *gf, gf_val_32_t a16, gf_val_32_t b16)
450 450 __m128i a, b;
451 451 __m128i result;
452 452 __m128i prim_poly;
453   - __m128i v, w;
  453 + __m128i w;
454 454 gf_internal_t * h = gf->scratch;
455 455  
456 456 a = _mm_insert_epi32 (_mm_setzero_si128(), a16, 0);
... ... @@ -497,7 +497,7 @@ gf_w16_clm_multiply_3 (gf_t *gf, gf_val_32_t a16, gf_val_32_t b16)
497 497 __m128i a, b;
498 498 __m128i result;
499 499 __m128i prim_poly;
500   - __m128i v, w;
  500 + __m128i w;
501 501 gf_internal_t * h = gf->scratch;
502 502  
503 503 a = _mm_insert_epi32 (_mm_setzero_si128(), a16, 0);
... ... @@ -537,7 +537,7 @@ gf_w16_clm_multiply_4 (gf_t *gf, gf_val_32_t a16, gf_val_32_t b16)
537 537 __m128i a, b;
538 538 __m128i result;
539 539 __m128i prim_poly;
540   - __m128i v, w;
  540 + __m128i w;
541 541 gf_internal_t * h = gf->scratch;
542 542  
543 543 a = _mm_insert_epi32 (_mm_setzero_si128(), a16, 0);
... ... @@ -1001,12 +1001,12 @@ gf_w16_split_4_16_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_v
1001 1001 {
1002 1002 #ifdef INTEL_SSSE3
1003 1003 uint64_t i, j, *s64, *d64, *top64;;
1004   - uint64_t a, c, prod;
  1004 + uint64_t c, prod;
1005 1005 uint8_t low[4][16];
1006 1006 uint8_t high[4][16];
1007 1007 gf_region_data rd;
1008 1008  
1009   - __m128i mask, ta, tb, ti, tpl, tph, tlow[4], thigh[4], tta, ttb, shuffler, unshuffler, lmask;
  1009 + __m128i mask, ta, tb, ti, tpl, tph, tlow[4], thigh[4], tta, ttb, lmask;
1010 1010  
1011 1011 if (val == 0) { gf_multby_zero(dest, bytes, xor); return; }
1012 1012 if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; }
... ... @@ -1138,7 +1138,6 @@ gf_w16_split_4_16_lazy_sse_altmap_multiply_region(gf_t *gf, void *src, void *des
1138 1138 uint8_t low[4][16];
1139 1139 uint8_t high[4][16];
1140 1140 gf_region_data rd;
1141   - struct gf_single_table_data *std;
1142 1141 __m128i mask, ta, tb, ti, tpl, tph, tlow[4], thigh[4];
1143 1142  
1144 1143 if (val == 0) { gf_multby_zero(dest, bytes, xor); return; }
... ... @@ -1553,7 +1552,6 @@ gf_w16_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t
1553 1552 int i;
1554 1553 uint8_t *s8, *d8;
1555 1554 uint32_t vrev;
1556   - uint64_t amask;
1557 1555 __m128i pp, m1, m2, ta, prod, t1, t2, tp, one, v;
1558 1556 struct gf_w16_bytwo_data *btd;
1559 1557 gf_region_data rd;
... ... @@ -1614,9 +1612,8 @@ static
1614 1612 void
1615 1613 gf_w16_bytwo_b_sse_region_2_noxor(gf_region_data *rd, struct gf_w16_bytwo_data *btd)
1616 1614 {
1617   - int i;
1618   - uint8_t *d8, *s8, tb;
1619   - __m128i pp, m1, m2, t1, t2, va, vb;
  1615 + uint8_t *d8, *s8;
  1616 + __m128i pp, m1, m2, t1, t2, va;
1620 1617  
1621 1618 s8 = (uint8_t *) rd->s_start;
1622 1619 d8 = (uint8_t *) rd->d_start;
... ... @@ -1640,8 +1637,7 @@ static
1640 1637 void
1641 1638 gf_w16_bytwo_b_sse_region_2_xor(gf_region_data *rd, struct gf_w16_bytwo_data *btd)
1642 1639 {
1643   - int i;
1644   - uint8_t *d8, *s8, tb;
  1640 + uint8_t *d8, *s8;
1645 1641 __m128i pp, m1, m2, t1, t2, va, vb;
1646 1642  
1647 1643 s8 = (uint8_t *) rd->s_start;
... ...
src/gf_w32.c
... ... @@ -414,7 +414,7 @@ gf_w32_clm_multiply_2 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32)
414 414 __m128i a, b;
415 415 __m128i result;
416 416 __m128i prim_poly;
417   - __m128i v, w;
  417 + __m128i w;
418 418 gf_internal_t * h = gf->scratch;
419 419  
420 420  
... ... @@ -458,7 +458,7 @@ gf_w32_clm_multiply_3 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32)
458 458 __m128i a, b;
459 459 __m128i result;
460 460 __m128i prim_poly;
461   - __m128i v, w;
  461 + __m128i w;
462 462 gf_internal_t * h = gf->scratch;
463 463  
464 464  
... ... @@ -497,7 +497,7 @@ gf_w32_clm_multiply_4 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32)
497 497 __m128i a, b;
498 498 __m128i result;
499 499 __m128i prim_poly;
500   - __m128i v, w;
  500 + __m128i w;
501 501 gf_internal_t * h = gf->scratch;
502 502  
503 503  
... ... @@ -991,7 +991,6 @@ gf_w32_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t
991 991 int i;
992 992 uint8_t *s8, *d8;
993 993 uint32_t vrev;
994   - uint64_t amask;
995 994 __m128i pp, m1, m2, ta, prod, t1, t2, tp, one, v;
996 995 struct gf_w32_bytwo_data *btd;
997 996 gf_region_data rd;
... ... @@ -1182,9 +1181,8 @@ static
1182 1181 void
1183 1182 gf_w32_bytwo_b_sse_region_2_noxor(gf_region_data *rd, struct gf_w32_bytwo_data *btd)
1184 1183 {
1185   - int i;
1186   - uint8_t *d8, *s8, tb;
1187   - __m128i pp, m1, m2, t1, t2, va, vb;
  1184 + uint8_t *d8, *s8;
  1185 + __m128i pp, m1, m2, t1, t2, va;
1188 1186  
1189 1187 s8 = (uint8_t *) rd->s_start;
1190 1188 d8 = (uint8_t *) rd->d_start;
... ... @@ -1208,8 +1206,7 @@ static
1208 1206 void
1209 1207 gf_w32_bytwo_b_sse_region_2_xor(gf_region_data *rd, struct gf_w32_bytwo_data *btd)
1210 1208 {
1211   - int i;
1212   - uint8_t *d8, *s8, tb;
  1209 + uint8_t *d8, *s8;
1213 1210 __m128i pp, m1, m2, t1, t2, va, vb;
1214 1211  
1215 1212 s8 = (uint8_t *) rd->s_start;
... ... @@ -1558,8 +1555,8 @@ void
1558 1555 gf_w32_split_2_32_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor)
1559 1556 {
1560 1557 gf_internal_t *h;
1561   - int i, m, j, tindex;
1562   - uint32_t pp, v, v2, s, *s32, *d32, *top;
  1558 + int i, tindex;
  1559 + uint32_t pp, v, v2, *s32, *d32, *top;
1563 1560 __m128i vi, si, pi, shuffler, tables[16], adder, xi, mask1, mask2;
1564 1561 gf_region_data rd;
1565 1562  
... ... @@ -1695,8 +1692,8 @@ gf_w32_split_4_32_lazy_sse_altmap_multiply_region(gf_t *gf, void *src, void *des
1695 1692 {
1696 1693 #ifdef INTEL_SSSE3
1697 1694 gf_internal_t *h;
1698   - int i, m, j, k, tindex;
1699   - uint32_t pp, v, s, *s32, *d32, *top, *realtop;
  1695 + int i, j, k;
  1696 + uint32_t pp, v, *s32, *d32, *top;
1700 1697 __m128i si, tables[8][4], p0, p1, p2, p3, mask1, v0, v1, v2, v3;
1701 1698 struct gf_split_4_32_lazy_data *ld;
1702 1699 uint8_t btable[16];
... ... @@ -1887,9 +1884,9 @@ gf_w32_split_4_32_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, uint
1887 1884 {
1888 1885 #ifdef INTEL_SSSE3
1889 1886 gf_internal_t *h;
1890   - int i, m, j, k, tindex;
1891   - uint32_t pp, v, s, *s32, *d32, *top, tmp_table[16];
1892   - __m128i vi, si, tables[8][4], p0, p1, p2, p3, mask1, v0, v1, v2, v3, mask8;
  1887 + int i, j, k;
  1888 + uint32_t pp, v, *s32, *d32, *top, tmp_table[16];
  1889 + __m128i si, tables[8][4], p0, p1, p2, p3, mask1, v0, v1, v2, v3, mask8;
1893 1890 __m128i tv1, tv2, tv3, tv0;
1894 1891 uint8_t btable[16];
1895 1892 gf_region_data rd;
... ...
src/gf_w4.c
... ... @@ -421,7 +421,7 @@ gf_w4_single_table_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_3
421 421 {
422 422 gf_region_data rd;
423 423 uint8_t *base, *sptr, *dptr, *top;
424   - __m128i tl, loset, h4, r, va, th;
  424 + __m128i tl, loset, r, va, th;
425 425  
426 426 struct gf_single_table_data *std;
427 427  
... ... @@ -924,8 +924,7 @@ gf_w4_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t v
924 924 int i;
925 925 uint8_t *s8, *d8;
926 926 uint8_t vrev;
927   - uint64_t amask;
928   - __m128i pp, m1, m2, ta, prod, t1, t2, tp, one, v;
  927 + __m128i pp, m1, ta, prod, t1, t2, tp, one, v;
929 928 struct gf_bytwo_data *btd;
930 929 gf_region_data rd;
931 930  
... ... @@ -948,7 +947,6 @@ gf_w4_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t v
948 947  
949 948 pp = _mm_set1_epi8(btd->prim_poly&0xff);
950 949 m1 = _mm_set1_epi8((btd->mask1)&0xff);
951   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
952 950 one = _mm_set1_epi8(1);
953 951  
954 952 while (d8 < (uint8_t *) rd.d_top) {
... ... @@ -1039,16 +1037,14 @@ static
1039 1037 void
1040 1038 gf_w4_bytwo_b_sse_region_2_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1041 1039 {
1042   - int i;
1043   - uint8_t *d8, *s8, tb;
1044   - __m128i pp, m1, m2, t1, t2, va, vb;
  1040 + uint8_t *d8, *s8;
  1041 + __m128i pp, m1, t1, t2, va;
1045 1042  
1046 1043 s8 = (uint8_t *) rd->s_start;
1047 1044 d8 = (uint8_t *) rd->d_start;
1048 1045  
1049 1046 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1050 1047 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1051   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1052 1048  
1053 1049 while (d8 < (uint8_t *) rd->d_top) {
1054 1050 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1065,16 +1061,14 @@ static
1065 1061 void
1066 1062 gf_w4_bytwo_b_sse_region_2_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1067 1063 {
1068   - int i;
1069   - uint8_t *d8, *s8, tb;
1070   - __m128i pp, m1, m2, t1, t2, va, vb;
  1064 + uint8_t *d8, *s8;
  1065 + __m128i pp, m1, t1, t2, va, vb;
1071 1066  
1072 1067 s8 = (uint8_t *) rd->s_start;
1073 1068 d8 = (uint8_t *) rd->d_start;
1074 1069  
1075 1070 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1076 1071 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1077   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1078 1072  
1079 1073 while (d8 < (uint8_t *) rd->d_top) {
1080 1074 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1093,16 +1087,14 @@ static
1093 1087 void
1094 1088 gf_w4_bytwo_b_sse_region_4_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1095 1089 {
1096   - int i;
1097   - uint8_t *d8, *s8, tb;
1098   - __m128i pp, m1, m2, t1, t2, va, vb;
  1090 + uint8_t *d8, *s8;
  1091 + __m128i pp, m1, t1, t2, va;
1099 1092  
1100 1093 s8 = (uint8_t *) rd->s_start;
1101 1094 d8 = (uint8_t *) rd->d_start;
1102 1095  
1103 1096 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1104 1097 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1105   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1106 1098  
1107 1099 while (d8 < (uint8_t *) rd->d_top) {
1108 1100 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1120,16 +1112,14 @@ static
1120 1112 void
1121 1113 gf_w4_bytwo_b_sse_region_4_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1122 1114 {
1123   - int i;
1124   - uint8_t *d8, *s8, tb;
1125   - __m128i pp, m1, m2, t1, t2, va, vb;
  1115 + uint8_t *d8, *s8;
  1116 + __m128i pp, m1, t1, t2, va, vb;
1126 1117  
1127 1118 s8 = (uint8_t *) rd->s_start;
1128 1119 d8 = (uint8_t *) rd->d_start;
1129 1120  
1130 1121 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1131 1122 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1132   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1133 1123  
1134 1124 while (d8 < (uint8_t *) rd->d_top) {
1135 1125 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1150,16 +1140,14 @@ static
1150 1140 void
1151 1141 gf_w4_bytwo_b_sse_region_3_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1152 1142 {
1153   - int i;
1154   - uint8_t *d8, *s8, tb;
1155   - __m128i pp, m1, m2, t1, t2, va, vb;
  1143 + uint8_t *d8, *s8;
  1144 + __m128i pp, m1, t1, t2, va, vb;
1156 1145  
1157 1146 s8 = (uint8_t *) rd->s_start;
1158 1147 d8 = (uint8_t *) rd->d_start;
1159 1148  
1160 1149 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1161 1150 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1162   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1163 1151  
1164 1152 while (d8 < (uint8_t *) rd->d_top) {
1165 1153 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1178,16 +1166,14 @@ static
1178 1166 void
1179 1167 gf_w4_bytwo_b_sse_region_3_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1180 1168 {
1181   - int i;
1182   - uint8_t *d8, *s8, tb;
1183   - __m128i pp, m1, m2, t1, t2, va, vb;
  1169 + uint8_t *d8, *s8;
  1170 + __m128i pp, m1, t1, t2, va, vb;
1184 1171  
1185 1172 s8 = (uint8_t *) rd->s_start;
1186 1173 d8 = (uint8_t *) rd->d_start;
1187 1174  
1188 1175 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1189 1176 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1190   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1191 1177  
1192 1178 while (d8 < (uint8_t *) rd->d_top) {
1193 1179 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1206,16 +1192,14 @@ static
1206 1192 void
1207 1193 gf_w4_bytwo_b_sse_region_5_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1208 1194 {
1209   - int i;
1210   - uint8_t *d8, *s8, tb;
1211   - __m128i pp, m1, m2, t1, t2, va, vb;
  1195 + uint8_t *d8, *s8;
  1196 + __m128i pp, m1, t1, t2, va, vb;
1212 1197  
1213 1198 s8 = (uint8_t *) rd->s_start;
1214 1199 d8 = (uint8_t *) rd->d_start;
1215 1200  
1216 1201 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1217 1202 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1218   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1219 1203  
1220 1204 while (d8 < (uint8_t *) rd->d_top) {
1221 1205 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1235,16 +1219,14 @@ static
1235 1219 void
1236 1220 gf_w4_bytwo_b_sse_region_5_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1237 1221 {
1238   - int i;
1239   - uint8_t *d8, *s8, tb;
1240   - __m128i pp, m1, m2, t1, t2, va, vb;
  1222 + uint8_t *d8, *s8;
  1223 + __m128i pp, m1, t1, t2, va, vb;
1241 1224  
1242 1225 s8 = (uint8_t *) rd->s_start;
1243 1226 d8 = (uint8_t *) rd->d_start;
1244 1227  
1245 1228 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1246 1229 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1247   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1248 1230  
1249 1231 while (d8 < (uint8_t *) rd->d_top) {
1250 1232 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1264,16 +1246,14 @@ static
1264 1246 void
1265 1247 gf_w4_bytwo_b_sse_region_7_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1266 1248 {
1267   - int i;
1268   - uint8_t *d8, *s8, tb;
1269   - __m128i pp, m1, m2, t1, t2, va, vb;
  1249 + uint8_t *d8, *s8;
  1250 + __m128i pp, m1, t1, t2, va, vb;
1270 1251  
1271 1252 s8 = (uint8_t *) rd->s_start;
1272 1253 d8 = (uint8_t *) rd->d_start;
1273 1254  
1274 1255 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1275 1256 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1276   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1277 1257  
1278 1258 while (d8 < (uint8_t *) rd->d_top) {
1279 1259 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1294,16 +1274,14 @@ static
1294 1274 void
1295 1275 gf_w4_bytwo_b_sse_region_7_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1296 1276 {
1297   - int i;
1298   - uint8_t *d8, *s8, tb;
1299   - __m128i pp, m1, m2, t1, t2, va, vb;
  1277 + uint8_t *d8, *s8;
  1278 + __m128i pp, m1, t1, t2, va, vb;
1300 1279  
1301 1280 s8 = (uint8_t *) rd->s_start;
1302 1281 d8 = (uint8_t *) rd->d_start;
1303 1282  
1304 1283 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1305 1284 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1306   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1307 1285  
1308 1286 while (d8 < (uint8_t *) rd->d_top) {
1309 1287 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1324,16 +1302,14 @@ static
1324 1302 void
1325 1303 gf_w4_bytwo_b_sse_region_6_noxor(gf_region_data *rd, struct gf_bytwo_data *btd)
1326 1304 {
1327   - int i;
1328   - uint8_t *d8, *s8, tb;
1329   - __m128i pp, m1, m2, t1, t2, va, vb;
  1305 + uint8_t *d8, *s8;
  1306 + __m128i pp, m1, t1, t2, va, vb;
1330 1307  
1331 1308 s8 = (uint8_t *) rd->s_start;
1332 1309 d8 = (uint8_t *) rd->d_start;
1333 1310  
1334 1311 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1335 1312 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1336   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1337 1313  
1338 1314 while (d8 < (uint8_t *) rd->d_top) {
1339 1315 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1353,16 +1329,14 @@ static
1353 1329 void
1354 1330 gf_w4_bytwo_b_sse_region_6_xor(gf_region_data *rd, struct gf_bytwo_data *btd)
1355 1331 {
1356   - int i;
1357   - uint8_t *d8, *s8, tb;
1358   - __m128i pp, m1, m2, t1, t2, va, vb;
  1332 + uint8_t *d8, *s8;
  1333 + __m128i pp, m1, t1, t2, va, vb;
1359 1334  
1360 1335 s8 = (uint8_t *) rd->s_start;
1361 1336 d8 = (uint8_t *) rd->d_start;
1362 1337  
1363 1338 pp = _mm_set1_epi8(btd->prim_poly&0xff);
1364 1339 m1 = _mm_set1_epi8((btd->mask1)&0xff);
1365   - m2 = _mm_set1_epi8((btd->mask2)&0xff);
1366 1340  
1367 1341 while (d8 < (uint8_t *) rd->d_top) {
1368 1342 va = _mm_load_si128 ((__m128i *)(s8));
... ... @@ -1977,7 +1951,6 @@ int gf_w4_shift_init(gf_t *gf)
1977 1951  
1978 1952 int gf_w4_scratch_size(int mult_type, int region_type, int divide_type, int arg1, int arg2)
1979 1953 {
1980   - int region_tbl_size;
1981 1954 int issse3 = 0;
1982 1955  
1983 1956 #ifdef INTEL_SSSE3
... ...
src/gf_w64.c
... ... @@ -93,14 +93,13 @@ void
93 93 gf_w64_clm_multiply_region_from_single_2(gf_t *gf, void *src, void *dest, gf_val_64_t val, int bytes, int
94 94 xor)
95 95 {
96   - int i, size;
97 96 gf_val_64_t *s64, *d64, *top;
98 97 gf_region_data rd;
99 98  
100 99 __m128i a, b;
101 100 __m128i result, r1;
102 101 __m128i prim_poly;
103   - __m128i v, w;
  102 + __m128i w;
104 103 __m128i m1, m2, m3, m4;
105 104 gf_internal_t * h = gf->scratch;
106 105  
... ... @@ -121,7 +120,6 @@ xor)
121 120 s64 = (gf_val_64_t *) rd.s_start;
122 121 d64 = (gf_val_64_t *) rd.d_start;
123 122 top = (gf_val_64_t *) rd.d_top;
124   - size = bytes/sizeof(gf_val_64_t);
125 123  
126 124 if (xor) {
127 125 while (d64 != top) {
... ... @@ -184,7 +182,6 @@ void
184 182 gf_w64_clm_multiply_region_from_single_4(gf_t *gf, void *src, void *dest, gf_val_64_t val, int bytes, int
185 183 xor)
186 184 {
187   - int i, size;
188 185 gf_val_64_t *s64, *d64, *top;
189 186 gf_region_data rd;
190 187  
... ... @@ -210,7 +207,6 @@ xor)
210 207 s64 = (gf_val_64_t *) rd.s_start;
211 208 d64 = (gf_val_64_t *) rd.d_start;
212 209 top = (gf_val_64_t *) rd.d_top;
213   - size = bytes/sizeof(gf_val_64_t);
214 210  
215 211 if (xor) {
216 212 while (d64 != top) {
... ... @@ -468,9 +464,7 @@ gf_w64_clm_multiply_region(gf_t *gf, void *src, void *dest, uint64_t val, int by
468 464 {
469 465 #if defined(INTEL_SSE4_PCLMUL)
470 466 gf_internal_t *h;
471   - int i, j, k;
472 467 uint8_t *s8, *d8, *dtop;
473   - uint64_t *s64, *d64;
474 468 gf_region_data rd;
475 469 __m128i v, b, m, prim_poly, c, fr, w, result;
476 470  
... ... @@ -492,7 +486,6 @@ gf_w64_clm_multiply_region(gf_t *gf, void *src, void *dest, uint64_t val, int by
492 486  
493 487 if (xor) {
494 488 while (d8 != dtop) {
495   - s64 = (uint64_t *) s8;
496 489 b = _mm_load_si128((__m128i *) s8);
497 490 result = _mm_clmulepi64_si128 (b, v, 0);
498 491 c = _mm_insert_epi32 (_mm_srli_si128 (result, 8), 0, 0);
... ... @@ -521,7 +514,6 @@ gf_w64_clm_multiply_region(gf_t *gf, void *src, void *dest, uint64_t val, int by
521 514 }
522 515 } else {
523 516 while (d8 < dtop) {
524   - s64 = (uint64_t *) s8;
525 517 b = _mm_load_si128((__m128i *) s8);
526 518 result = _mm_clmulepi64_si128 (b, v, 0);
527 519 c = _mm_insert_epi32 (_mm_srli_si128 (result, 8), 0, 0);
... ... @@ -1374,9 +1366,8 @@ static
1374 1366 void
1375 1367 gf_w64_bytwo_b_sse_region_2_xor(gf_region_data *rd)
1376 1368 {
1377   - int i;
1378 1369 uint64_t one64, amask;
1379   - uint8_t *d8, *s8, tb;
  1370 + uint8_t *d8, *s8;
1380 1371 __m128i pp, m1, m2, t1, t2, va, vb;
1381 1372 gf_internal_t *h;
1382 1373  
... ... @@ -1408,9 +1399,8 @@ static
1408 1399 void
1409 1400 gf_w64_bytwo_b_sse_region_2_noxor(gf_region_data *rd)
1410 1401 {
1411   - int i;
1412 1402 uint64_t one64, amask;
1413   - uint8_t *d8, *s8, tb;
  1403 + uint8_t *d8, *s8;
1414 1404 __m128i pp, m1, m2, t1, t2, va;
1415 1405 gf_internal_t *h;
1416 1406  
... ... @@ -1443,7 +1433,6 @@ gf_w64_bytwo_b_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_64_t
1443 1433 uint64_t itb, amask, one64;
1444 1434 uint8_t *d8, *s8;
1445 1435 __m128i pp, m1, m2, t1, t2, va, vb;
1446   - struct gf_w32_bytwo_data *btd;
1447 1436 gf_region_data rd;
1448 1437 gf_internal_t *h;
1449 1438  
... ... @@ -1718,8 +1707,8 @@ static
1718 1707 gf_w64_split_4_64_lazy_sse_altmap_multiply_region(gf_t *gf, void *src, void *dest, uint64_t val, int bytes, int xor)
1719 1708 {
1720 1709 gf_internal_t *h;
1721   - int i, m, j, k, tindex;
1722   - uint64_t pp, v, s, *s64, *d64, *top;
  1710 + int i, j, k;
  1711 + uint64_t pp, v, *s64, *d64, *top;
1723 1712 __m128i si, tables[16][8], p[8], v0, mask1;
1724 1713 struct gf_split_4_64_lazy_data *ld;
1725 1714 uint8_t btable[16];
... ... @@ -1802,9 +1791,9 @@ static
1802 1791 gf_w64_split_4_64_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, uint64_t val, int bytes, int xor)
1803 1792 {
1804 1793 gf_internal_t *h;
1805   - int i, m, j, k, tindex;
1806   - uint64_t pp, v, s, *s64, *d64, *top;
1807   - __m128i si, tables[16][8], p[8], st[8], mask1, mask8, mask16, t1, t2;
  1794 + int i, j, k;
  1795 + uint64_t pp, v, *s64, *d64, *top;
  1796 + __m128i si, tables[16][8], p[8], st[8], mask1, mask8, mask16, t1;
1808 1797 struct gf_split_4_64_lazy_data *ld;
1809 1798 uint8_t btable[16];
1810 1799 gf_region_data rd;
... ...
src/gf_w8.c
... ... @@ -216,7 +216,7 @@ gf_w8_clm_multiply_2 (gf_t *gf, gf_val_32_t a8, gf_val_32_t b8)
216 216 __m128i a, b;
217 217 __m128i result;
218 218 __m128i prim_poly;
219   - __m128i v, w;
  219 + __m128i w;
220 220 gf_internal_t * h = gf->scratch;
221 221  
222 222 a = _mm_insert_epi32 (_mm_setzero_si128(), a8, 0);
... ... @@ -262,7 +262,7 @@ gf_w8_clm_multiply_3 (gf_t *gf, gf_val_32_t a8, gf_val_32_t b8)
262 262 __m128i a, b;
263 263 __m128i result;
264 264 __m128i prim_poly;
265   - __m128i v, w;
  265 + __m128i w;
266 266 gf_internal_t * h = gf->scratch;
267 267  
268 268 a = _mm_insert_epi32 (_mm_setzero_si128(), a8, 0);
... ... @@ -301,7 +301,7 @@ gf_w8_clm_multiply_4 (gf_t *gf, gf_val_32_t a8, gf_val_32_t b8)
301 301 __m128i a, b;
302 302 __m128i result;
303 303 __m128i prim_poly;
304   - __m128i v, w;
  304 + __m128i w;
305 305 gf_internal_t * h = gf->scratch;
306 306  
307 307 a = _mm_insert_epi32 (_mm_setzero_si128(), a8, 0);
... ... @@ -377,7 +377,7 @@ gf_w8_clm_multiply_region_from_single_2(gf_t *gf, void *src, void *dest, gf_val_
377 377 __m128i a, b;
378 378 __m128i result;
379 379 __m128i prim_poly;
380   - __m128i v, w;
  380 + __m128i w;
381 381 gf_internal_t * h = gf->scratch;
382 382  
383 383 prim_poly = _mm_set_epi32(0, 0, 0, (uint32_t)(h->prim_poly & 0x1ffULL));
... ... @@ -435,7 +435,7 @@ gf_w8_clm_multiply_region_from_single_3(gf_t *gf, void *src, void *dest, gf_val_
435 435 __m128i a, b;
436 436 __m128i result;
437 437 __m128i prim_poly;
438   - __m128i v, w;
  438 + __m128i w;
439 439 gf_internal_t * h = gf->scratch;
440 440  
441 441 prim_poly = _mm_set_epi32(0, 0, 0, (uint32_t)(h->prim_poly & 0x1ffULL));
... ... @@ -497,7 +497,7 @@ gf_w8_clm_multiply_region_from_single_4(gf_t *gf, void *src, void *dest, gf_val_
497 497 __m128i a, b;
498 498 __m128i result;
499 499 __m128i prim_poly;
500   - __m128i v, w;
  500 + __m128i w;
501 501 gf_internal_t * h = gf->scratch;
502 502  
503 503 prim_poly = _mm_set_epi32(0, 0, 0, (uint32_t)(h->prim_poly & 0x1ffULL));
... ... @@ -1058,9 +1058,8 @@ static
1058 1058 void
1059 1059 gf_w8_split_multiply_region_sse(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor)
1060 1060 {
1061   - uint8_t *s8, *d8, *bh, *bl, *sptr, *dptr, *top;
1062   - __m128i tbl, loset, t1, r, va, mth, mtl;
1063   - uint64_t altable[4];
  1061 + uint8_t *bh, *bl, *sptr, *dptr;
  1062 + __m128i loset, t1, r, va, mth, mtl;
1064 1063 struct gf_w8_half_table_data *htd;
1065 1064 gf_region_data rd;
1066 1065  
... ... @@ -1676,7 +1675,6 @@ gf_w8_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t v
1676 1675 int i;
1677 1676 uint8_t *s8, *d8;
1678 1677 uint8_t vrev;
1679   - uint64_t amask;
1680 1678 __m128i pp, m1, m2, ta, prod, t1, t2, tp, one, v;
1681 1679 struct gf_w8_bytwo_data *btd;
1682 1680 gf_region_data rd;
... ... @@ -1729,9 +1727,8 @@ static
1729 1727 void
1730 1728 gf_w8_bytwo_b_sse_region_2_noxor(gf_region_data *rd, struct gf_w8_bytwo_data *btd)
1731 1729 {
1732   - int i;
1733   - uint8_t *d8, *s8, tb;
1734   - __m128i pp, m1, m2, t1, t2, va, vb;
  1730 + uint8_t *d8, *s8;
  1731 + __m128i pp, m1, m2, t1, t2, va;
1735 1732  
1736 1733 s8 = (uint8_t *) rd->s_start;
1737 1734 d8 = (uint8_t *) rd->d_start;
... ... @@ -1755,8 +1752,7 @@ static
1755 1752 void
1756 1753 gf_w8_bytwo_b_sse_region_2_xor(gf_region_data *rd, struct gf_w8_bytwo_data *btd)
1757 1754 {
1758   - int i;
1759   - uint8_t *d8, *s8, tb;
  1755 + uint8_t *d8, *s8;
1760 1756 __m128i pp, m1, m2, t1, t2, va, vb;
1761 1757  
1762 1758 s8 = (uint8_t *) rd->s_start;
... ...
test/gf_unit.c
... ... @@ -70,18 +70,15 @@ int main(int argc, char **argv)
70 70 {
71 71 signal(SIGSEGV, SigHandler);
72 72  
73   - int w, i, verbose, single, region, tested, top;
  73 + int w, i, verbose, single, region, top;
74 74 int s_start, d_start, bytes, xor, alignment_test;
75 75 gf_t gf, gf_def;
76 76 time_t t0;
77 77 gf_internal_t *h;
78   - gf_general_t *a, *b, *c, *d, *ai, *bi;
79   - uint8_t a8, b8, c8, *mult4, *div4, *mult8, *div8;
80   - uint16_t a16, b16, c16, d16, *log16, *alog16;
81   - char as[50], bs[50], cs[50], ds[50], ais[50], bis[50];
82   - uint32_t mask;
  78 + gf_general_t *a, *b, *c, *d;
83 79 uint8_t a8, b8, c8, *mult4 = NULL, *mult8 = NULL;
84 80 uint16_t a16, b16, c16, *log16 = NULL, *alog16 = NULL;
  81 + char as[50], bs[50], cs[50], ds[50];
85 82 uint32_t mask = 0;
86 83 char *ra, *rb, *rc, *rd, *target;
87 84 int align;
... ... @@ -118,8 +115,6 @@ int main(int argc, char **argv)
118 115 b = (gf_general_t *) malloc(sizeof(gf_general_t));
119 116 c = (gf_general_t *) malloc(sizeof(gf_general_t));
120 117 d = (gf_general_t *) malloc(sizeof(gf_general_t));
121   - ai = (gf_general_t *) malloc(sizeof(gf_general_t));
122   - bi = (gf_general_t *) malloc(sizeof(gf_general_t));
123 118  
124 119 //15 bytes extra to make sure it's 16byte aligned
125 120 ra = (char *) malloc(sizeof(char)*REGION_SIZE+15);
... ... @@ -148,12 +143,10 @@ int main(int argc, char **argv)
148 143 problem("No default for this value of w");
149 144 if (w == 4) {
150 145 mult4 = gf_w4_get_mult_table(&gf);
151   - div4 = gf_w4_get_div_table(&gf);
152 146 }
153 147  
154 148 if (w == 8) {
155 149 mult8 = gf_w8_get_mult_table(&gf);
156   - div8 = gf_w8_get_div_table(&gf);
157 150 }
158 151  
159 152 if (w == 16) {
... ... @@ -243,7 +236,6 @@ int main(int argc, char **argv)
243 236 }
244 237 }
245 238  
246   - tested = 0;
247 239 gf_general_multiply(&gf, a, b, c);
248 240  
249 241 /* If w is 4, 8 or 16, then there are inline multiplication/division methods.
... ... @@ -288,7 +280,6 @@ int main(int argc, char **argv)
288 280 /* If this is not composite, then first test against the default: */
289 281  
290 282 if (h->mult_type != GF_MULT_COMPOSITE) {
291   - tested = 1;
292 283 gf_general_multiply(&gf_def, a, b, d);
293 284  
294 285 if (!gf_general_are_equal(c, d, w)) {
... ... @@ -309,7 +300,6 @@ int main(int argc, char **argv)
309 300  
310 301 if (gf_general_is_zero(a, w) || gf_general_is_zero(b, w) ||
311 302 gf_general_is_one(a, w) || gf_general_is_one(b, w)) {
312   - tested = 1;
313 303 if (((gf_general_is_zero(a, w) || gf_general_is_zero(b, w)) && !gf_general_is_zero(c, w)) ||
314 304 (gf_general_is_one(a, w) && !gf_general_are_equal(b, c, w)) ||
315 305 (gf_general_is_one(b, w) && !gf_general_are_equal(a, c, w))) {
... ...
tools/gf_add.c
... ... @@ -62,7 +62,7 @@ void print_128(uint64_t *v)
62 62  
63 63 int main(int argc, char **argv)
64 64 {
65   - int hex, al, bl, w;
  65 + int hex, w;
66 66 uint32_t a, b, c, top;
67 67 uint64_t a64, b64, c64;
68 68 uint64_t a128[2], b128[2], c128[2];
... ...
tools/gf_methods.c
... ... @@ -76,7 +76,7 @@ int main(int argc, char *argv[])
76 76 int listing;
77 77 char *gf_argv[50], *x;
78 78 gf_t gf;
79   - char divs[200], ks[10], ls[10];
  79 + char ls[10];
80 80 char * w_str;
81 81  
82 82 if (argc != 4) usage(NULL);
... ...
tools/gf_poly.c
... ... @@ -84,7 +84,6 @@ int gcd_one(gf_t *gf, int w, int n, gf_general_t *poly, gf_general_t *prod)
84 84 {
85 85 gf_general_t *a, *b, zero, factor, p;
86 86 int i, j, da, db;
87   - char buf[30];
88 87  
89 88 gf_general_set_zero(&zero, w);
90 89  
... ... @@ -123,7 +122,6 @@ void x_to_q_to_i_minus_x(gf_t *gf, int w, int n, gf_general_t *poly, int logq, i
123 122 gf_general_t *product;
124 123 gf_general_t p, zero, factor;
125 124 int j, k, lq;
126   - char buf[20];
127 125  
128 126 gf_general_set_zero(&zero, w);
129 127 product = (gf_general_t *) malloc(sizeof(gf_general_t) * n*2);
... ... @@ -183,7 +181,7 @@ void x_to_q_to_i_minus_x(gf_t *gf, int w, int n, gf_general_t *poly, int logq, i
183 181  
184 182 main(int argc, char **argv)
185 183 {
186   - int w, i, power, n, ap, success, j;
  184 + int w, i, power, n, ap, success;
187 185 gf_t gf;
188 186 gf_general_t *poly, *prod;
189 187 char *string, *ptr;
... ...