Commit 568df90edc6ae07744de45de8665fb86ce6c84ee

Authored by Janne Grunau
1 parent 2a2f1e30
Exists in master and in 3 other branches v2, v3, wip-18092

simd: rename the region flags from SSE to SIMD

SSE is not the only supported SIMD instruction set. Keep the old names
for backward compatibility.
include/gf_complete.h
... ... @@ -61,7 +61,9 @@ typedef enum {GF_MULT_DEFAULT,
61 61 #define GF_REGION_DOUBLE_TABLE (0x1)
62 62 #define GF_REGION_QUAD_TABLE (0x2)
63 63 #define GF_REGION_LAZY (0x4)
  64 +#define GF_REGION_SIMD (0x8)
64 65 #define GF_REGION_SSE (0x8)
  66 +#define GF_REGION_NOSIMD (0x10)
65 67 #define GF_REGION_NOSSE (0x10)
66 68 #define GF_REGION_ALTMAP (0x20)
67 69 #define GF_REGION_CAUCHY (0x40)
... ...
include/gf_int.h
... ... @@ -113,7 +113,7 @@ typedef enum {GF_E_MDEFDIV, /* Dev != Default && Mult == Default */
113 113 GF_E_DIVCOMP, /* Mult == Composite && Div != Default */
114 114 GF_E_CAUCOMP, /* Mult == Composite && Reg == CAUCHY */
115 115 GF_E_DOUQUAD, /* Reg == DOUBLE && Reg == QUAD */
116   - GF_E_SSE__NO, /* Reg == SSE && Reg == NOSSE */
  116 + GF_E_SIMD_NO, /* Reg == SIMD && Reg == NOSIMD */
117 117 GF_E_CAUCHYB, /* Reg == CAUCHY && Other Reg */
118 118 GF_E_CAUGT32, /* Reg == CAUCHY && w > 32*/
119 119 GF_E_ARG1SET, /* Arg1 != 0 && Mult \notin COMPOSITE/SPLIT/GROUP */
... ... @@ -129,9 +129,9 @@ typedef enum {GF_E_MDEFDIV, /* Dev != Default && Mult == Default */
129 129 GF_E_QUAD__J, /* Reg == QUAD && other Reg */
130 130 GF_E_LAZY__X, /* Reg == LAZY && not DOUBLE or QUAD*/
131 131 GF_E_ALTSHIF, /* Mult == Shift && Reg == ALTMAP */
132   - GF_E_SSESHIF, /* Mult == Shift && Reg == SSE|NOSSE */
  132 + GF_E_SSESHIF, /* Mult == Shift && Reg == SIMD|NOSIMD */
133 133 GF_E_ALT_CFM, /* Mult == CARRY_FREE && Reg == ALTMAP */
134   - GF_E_SSE_CFM, /* Mult == CARRY_FREE && Reg == SSE|NOSSE */
  134 + GF_E_SSE_CFM, /* Mult == CARRY_FREE && Reg == SIMD|NOSIMD */
135 135 GF_E_PCLMULX, /* Mult == Carry_Free && No PCLMUL */
136 136 GF_E_ALT_BY2, /* Mult == Bytwo_x && Reg == ALTMAP */
137 137 GF_E_BY2_SSE, /* Mult == Bytwo_x && Reg == SSE && No SSE2 */
... ... @@ -148,7 +148,7 @@ typedef enum {GF_E_MDEFDIV, /* Dev != Default && Mult == Default */
148 148 GF_E_GR_AR_W, /* Mult == GROUP, either arg > w */
149 149 GF_E_GR____J, /* Mult == GROUP, Reg == SSE|ALTMAP|NOSSE */
150 150 GF_E_TABLE_W, /* Mult == TABLE, w too big */
151   - GF_E_TAB_SSE, /* Mult == TABLE, SSE|NOSSE only apply to w == 4 */
  151 + GF_E_TAB_SSE, /* Mult == TABLE, SIMD|NOSIMD only apply to w == 4 */
152 152 GF_E_TABSSE3, /* Mult == TABLE, Need SSSE3 for SSE */
153 153 GF_E_TAB_ALT, /* Mult == TABLE, Reg == ALTMAP */
154 154 GF_E_SP128AR, /* Mult == SPLIT, w=128, Bad arg1/arg2 */
... ... @@ -172,7 +172,7 @@ typedef enum {GF_E_MDEFDIV, /* Dev != Default && Mult == Default */
172 172 GF_E_SP_8__A, /* Mult == SPLIT, w=8, no ALTMAP */
173 173 GF_E_SP_SSE3, /* Mult == SPLIT, Need SSSE3 for SSE */
174 174 GF_E_COMP_A2, /* Mult == COMP, arg1 must be = 2 */
175   - GF_E_COMP_SS, /* Mult == COMP, SSE|NOSSE */
  175 + GF_E_COMP_SS, /* Mult == COMP, SIMD|NOSIMD */
176 176 GF_E_COMP__W, /* Mult == COMP, Bad w. */
177 177 GF_E_UNKFLAG, /* Unknown flag in create_from.... */
178 178 GF_E_UNKNOWN, /* Unknown mult_type. */
... ...
src/gf.c
... ... @@ -41,7 +41,7 @@ void gf_error()
41 41 case GF_E_MDEFARG: s = "If multiplication method == default, can't use arg1/arg2."; break;
42 42 case GF_E_DIVCOMP: s = "Cannot change the division technique with -m COMPOSITE."; break;
43 43 case GF_E_DOUQUAD: s = "Cannot specify -r DOUBLE and -r QUAD."; break;
44   - case GF_E_SSE__NO: s = "Cannot specify -r SSE and -r NOSSE."; break;
  44 + case GF_E_SIMD_NO: s = "Cannot specify -r SIMD and -r NOSIMD."; break;
45 45 case GF_E_CAUCHYB: s = "Cannot specify -r CAUCHY and any other -r."; break;
46 46 case GF_E_CAUCOMP: s = "Cannot specify -m COMPOSITE and -r CAUCHY."; break;
47 47 case GF_E_CAUGT32: s = "Cannot specify -r CAUCHY with w > 32."; break;
... ... @@ -51,23 +51,23 @@ void gf_error()
51 51 case GF_E_BAD___W: s = "W must be 1-32, 64 or 128."; break;
52 52 case GF_E_DOUBLET: s = "Can only specify -r DOUBLE with -m TABLE."; break;
53 53 case GF_E_DOUBLEW: s = "Can only specify -r DOUBLE w = 4 or w = 8."; break;
54   - case GF_E_DOUBLEJ: s = "Cannot specify -r DOUBLE with -r ALTMAP|SSE|NOSSE."; break;
  54 + case GF_E_DOUBLEJ: s = "Cannot specify -r DOUBLE with -r ALTMAP|SIMD|NOSIMD."; break;
55 55 case GF_E_DOUBLEL: s = "Can only specify -r DOUBLE -r LAZY with w = 8"; break;
56 56 case GF_E_QUAD__T: s = "Can only specify -r QUAD with -m TABLE."; break;
57 57 case GF_E_QUAD__W: s = "Can only specify -r QUAD w = 4."; break;
58   - case GF_E_QUAD__J: s = "Cannot specify -r QUAD with -r ALTMAP|SSE|NOSSE."; break;
  58 + case GF_E_QUAD__J: s = "Cannot specify -r QUAD with -r ALTMAP|SIMD|NOSIMD."; break;
59 59 case GF_E_BADPOLY: s = "Bad primitive polynomial (high bits set)."; break;
60 60 case GF_E_COMP_PP: s = "Bad primitive polynomial -- bigger than sub-field."; break;
61 61 case GF_E_LAZY__X: s = "If -r LAZY, then -r must be DOUBLE or QUAD."; break;
62 62 case GF_E_ALTSHIF: s = "Cannot specify -m SHIFT and -r ALTMAP."; break;
63   - case GF_E_SSESHIF: s = "Cannot specify -m SHIFT and -r SSE|NOSSE."; break;
  63 + case GF_E_SSESHIF: s = "Cannot specify -m SHIFT and -r SIMD|NOSIMD."; break;
64 64 case GF_E_ALT_CFM: s = "Cannot specify -m CARRY_FREE and -r ALTMAP."; break;
65   - case GF_E_SSE_CFM: s = "Cannot specify -m CARRY_FREE and -r SSE|NOSSE."; break;
  65 + case GF_E_SSE_CFM: s = "Cannot specify -m CARRY_FREE and -r SIMD|NOSIMD."; break;
66 66 case GF_E_PCLMULX: s = "Specified -m CARRY_FREE, but PCLMUL is not supported."; break;
67 67 case GF_E_ALT_BY2: s = "Cannot specify -m BYTWO_x and -r ALTMAP."; break;
68   - case GF_E_BY2_SSE: s = "Specified -m BYTWO_x -r SSE, but SSE2 is not supported."; break;
  68 + case GF_E_BY2_SSE: s = "Specified -m BYTWO_x -r SIMD, but SSE2 is not supported."; break;
69 69 case GF_E_LOGBADW: s = "With Log Tables, w must be <= 27."; break;
70   - case GF_E_LOG___J: s = "Cannot use Log tables with -r ALTMAP|SSE|NOSSE."; break;
  70 + case GF_E_LOG___J: s = "Cannot use Log tables with -r ALTMAP|SIMD|NOSIMD."; break;
71 71 case GF_E_LOGPOLY: s = "Cannot use Log tables because the polynomial is not primitive."; break;
72 72 case GF_E_ZERBADW: s = "With -m LOG_ZERO, w must be 8 or 16."; break;
73 73 case GF_E_ZEXBADW: s = "With -m LOG_ZERO_EXT, w must be 8."; break;
... ... @@ -77,33 +77,33 @@ void gf_error()
77 77 case GF_E_GR_128A: s = "With -m GROUP, w == 128, arg1 must be 4, and arg2 in { 4,8,16 }."; break;
78 78 case GF_E_GR_A_27: s = "With -m GROUP, arg1 and arg2 must be <= 27."; break;
79 79 case GF_E_GR_AR_W: s = "With -m GROUP, arg1 and arg2 must be <= w."; break;
80   - case GF_E_GR____J: s = "Cannot use GROUP with -r ALTMAP|SSE|NOSSE."; break;
  80 + case GF_E_GR____J: s = "Cannot use GROUP with -r ALTMAP|SIMD|NOSIMD."; break;
81 81 case GF_E_TABLE_W: s = "With -m TABLE, w must be < 15, or == 16."; break;
82   - case GF_E_TAB_SSE: s = "With -m TABLE, SSE|NOSSE only applies to w=4."; break;
83   - case GF_E_TABSSE3: s = "With -m TABLE, -r SSE, you need SSSE3 supported."; break;
  82 + case GF_E_TAB_SSE: s = "With -m TABLE, SIMD|NOSIMD only applies to w=4."; break;
  83 + case GF_E_TABSSE3: s = "With -m TABLE, -r SIMD, you need SSSE3 supported."; break;
84 84 case GF_E_TAB_ALT: s = "With -m TABLE, you cannot use ALTMAP."; break;
85 85 case GF_E_SP128AR: s = "With -m SPLIT, w=128, bad arg1/arg2."; break;
86   - case GF_E_SP128AL: s = "With -m SPLIT, w=128, -r SSE requires -r ALTMAP."; break;
  86 + case GF_E_SP128AL: s = "With -m SPLIT, w=128, -r SIMD requires -r ALTMAP."; break;
87 87 case GF_E_SP128AS: s = "With -m SPLIT, w=128, ALTMAP needs SSSE3 supported."; break;
88 88 case GF_E_SP128_A: s = "With -m SPLIT, w=128, -r ALTMAP only with arg1/arg2 = 4/128."; break;
89   - case GF_E_SP128_S: s = "With -m SPLIT, w=128, -r SSE|NOSSE only with arg1/arg2 = 4/128."; break;
  89 + case GF_E_SP128_S: s = "With -m SPLIT, w=128, -r SIMD|NOSIMD only with arg1/arg2 = 4/128."; break;
90 90 case GF_E_SPLIT_W: s = "With -m SPLIT, w must be in {8, 16, 32, 64, 128}."; break;
91 91 case GF_E_SP_16AR: s = "With -m SPLIT, w=16, Bad arg1/arg2."; break;
92 92 case GF_E_SP_16_A: s = "With -m SPLIT, w=16, -r ALTMAP only with arg1/arg2 = 4/16."; break;
93   - case GF_E_SP_16_S: s = "With -m SPLIT, w=16, -r SSE|NOSSE only with arg1/arg2 = 4/16."; break;
  93 + case GF_E_SP_16_S: s = "With -m SPLIT, w=16, -r SIMD|NOSIMD only with arg1/arg2 = 4/16."; break;
94 94 case GF_E_SP_32AR: s = "With -m SPLIT, w=32, Bad arg1/arg2."; break;
95 95 case GF_E_SP_32AS: s = "With -m SPLIT, w=32, -r ALTMAP needs SSSE3 supported."; break;
96 96 case GF_E_SP_32_A: s = "With -m SPLIT, w=32, -r ALTMAP only with arg1/arg2 = 4/32."; break;
97   - case GF_E_SP_32_S: s = "With -m SPLIT, w=32, -r SSE|NOSSE only with arg1/arg2 = 4/32."; break;
  97 + case GF_E_SP_32_S: s = "With -m SPLIT, w=32, -r SIMD|NOSIMD only with arg1/arg2 = 4/32."; break;
98 98 case GF_E_SP_64AR: s = "With -m SPLIT, w=64, Bad arg1/arg2."; break;
99 99 case GF_E_SP_64AS: s = "With -m SPLIT, w=64, -r ALTMAP needs SSSE3 supported."; break;
100 100 case GF_E_SP_64_A: s = "With -m SPLIT, w=64, -r ALTMAP only with arg1/arg2 = 4/64."; break;
101   - case GF_E_SP_64_S: s = "With -m SPLIT, w=64, -r SSE|NOSSE only with arg1/arg2 = 4/64."; break;
  101 + case GF_E_SP_64_S: s = "With -m SPLIT, w=64, -r SIMD|NOSIMD only with arg1/arg2 = 4/64."; break;
102 102 case GF_E_SP_8_AR: s = "With -m SPLIT, w=8, Bad arg1/arg2."; break;
103 103 case GF_E_SP_8__A: s = "With -m SPLIT, w=8, Can't have -r ALTMAP."; break;
104   - case GF_E_SP_SSE3: s = "With -m SPLIT, Need SSSE3 support for SSE."; break;
  104 + case GF_E_SP_SSE3: s = "With -m SPLIT, Need SSSE3 support for SIMD."; break;
105 105 case GF_E_COMP_A2: s = "With -m COMPOSITE, arg1 must equal 2."; break;
106   - case GF_E_COMP_SS: s = "With -m COMPOSITE, -r SSE and -r NOSSE do not apply."; break;
  106 + case GF_E_COMP_SS: s = "With -m COMPOSITE, -r SIMD and -r NOSIMD do not apply."; break;
107 107 case GF_E_COMP__W: s = "With -m COMPOSITE, w must be 8, 16, 32, 64 or 128."; break;
108 108 case GF_E_UNKFLAG: s = "Unknown method flag - should be -m, -d, -r or -p."; break;
109 109 case GF_E_UNKNOWN: s = "Unknown multiplication type."; break;
... ... @@ -182,14 +182,14 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
182 182 int sse3 = 0;
183 183 int sse2 = 0;
184 184 int pclmul = 0;
185   - int rdouble, rquad, rlazy, rsse, rnosse, raltmap, rcauchy, tmp;
  185 + int rdouble, rquad, rlazy, rsimd, rnosimd, raltmap, rcauchy, tmp;
186 186 gf_internal_t *sub;
187 187  
188 188 rdouble = (region_type & GF_REGION_DOUBLE_TABLE);
189 189 rquad = (region_type & GF_REGION_QUAD_TABLE);
190 190 rlazy = (region_type & GF_REGION_LAZY);
191   - rsse = (region_type & GF_REGION_SSE);
192   - rnosse = (region_type & GF_REGION_NOSSE);
  191 + rsimd = (region_type & GF_REGION_SIMD);
  192 + rnosimd = (region_type & GF_REGION_NOSIMD);
193 193 raltmap = (region_type & GF_REGION_ALTMAP);
194 194 rcauchy = (region_type & GF_REGION_CAUCHY);
195 195  
... ... @@ -201,7 +201,8 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
201 201 }
202 202  
203 203 tmp = ( GF_REGION_DOUBLE_TABLE | GF_REGION_QUAD_TABLE | GF_REGION_LAZY |
204   - GF_REGION_SSE | GF_REGION_NOSSE | GF_REGION_ALTMAP | GF_REGION_CAUCHY );
  204 + GF_REGION_SIMD | GF_REGION_NOSIMD | GF_REGION_ALTMAP |
  205 + GF_REGION_CAUCHY );
205 206 if (region_type & (~tmp)) { _gf_errno = GF_E_UNK_REG; return 0; }
206 207  
207 208 #ifdef INTEL_SSE2
... ... @@ -230,7 +231,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
230 231 return 1;
231 232 }
232 233  
233   - if (rsse && rnosse) { _gf_errno = GF_E_SSE__NO; return 0; }
  234 + if (rsimd && rnosimd) { _gf_errno = GF_E_SIMD_NO; return 0; }
234 235 if (rcauchy && w > 32) { _gf_errno = GF_E_CAUGT32; return 0; }
235 236 if (rcauchy && region_type != GF_REGION_CAUCHY) { _gf_errno = GF_E_CAUCHYB; return 0; }
236 237 if (rcauchy && mult_type == GF_MULT_COMPOSITE) { _gf_errno = GF_E_CAUCOMP; return 0; }
... ... @@ -252,7 +253,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
252 253 if (rquad) { _gf_errno = GF_E_DOUQUAD; return 0; }
253 254 if (mult_type != GF_MULT_TABLE) { _gf_errno = GF_E_DOUBLET; return 0; }
254 255 if (w != 4 && w != 8) { _gf_errno = GF_E_DOUBLEW; return 0; }
255   - if (rsse || rnosse || raltmap) { _gf_errno = GF_E_DOUBLEJ; return 0; }
  256 + if (rsimd || rnosimd || raltmap) { _gf_errno = GF_E_DOUBLEJ; return 0; }
256 257 if (rlazy && w == 4) { _gf_errno = GF_E_DOUBLEL; return 0; }
257 258 return 1;
258 259 }
... ... @@ -260,7 +261,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
260 261 if (rquad) {
261 262 if (mult_type != GF_MULT_TABLE) { _gf_errno = GF_E_QUAD__T; return 0; }
262 263 if (w != 4) { _gf_errno = GF_E_QUAD__W; return 0; }
263   - if (rsse || rnosse || raltmap) { _gf_errno = GF_E_QUAD__J; return 0; }
  264 + if (rsimd || rnosimd || raltmap) { _gf_errno = GF_E_QUAD__J; return 0; }
264 265 return 1;
265 266 }
266 267  
... ... @@ -268,7 +269,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
268 269  
269 270 if (mult_type == GF_MULT_SHIFT) {
270 271 if (raltmap) { _gf_errno = GF_E_ALTSHIF; return 0; }
271   - if (rsse || rnosse) { _gf_errno = GF_E_SSESHIF; return 0; }
  272 + if (rsimd || rnosimd) { _gf_errno = GF_E_SSESHIF; return 0; }
272 273 return 1;
273 274 }
274 275  
... ... @@ -281,7 +282,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
281 282 if (w == 32 && (poly & 0xfe000000)) { _gf_errno = GF_E_CF32POL; return 0; }
282 283 if (w == 64 && (poly & 0xfffe000000000000ULL)) { _gf_errno = GF_E_CF64POL; return 0; }
283 284 if (raltmap) { _gf_errno = GF_E_ALT_CFM; return 0; }
284   - if (rsse || rnosse) { _gf_errno = GF_E_SSE_CFM; return 0; }
  285 + if (rsimd || rnosimd) { _gf_errno = GF_E_SSE_CFM; return 0; }
285 286 if (!pclmul) { _gf_errno = GF_E_PCLMULX; return 0; }
286 287 return 1;
287 288 }
... ... @@ -290,21 +291,21 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
290 291 if (w != 4 && w != 8 && w != 16 &&
291 292 w != 32 && w != 64 && w != 128) { _gf_errno = GF_E_CFM___W; return 0; }
292 293 if (raltmap) { _gf_errno = GF_E_ALT_CFM; return 0; }
293   - if (rsse || rnosse) { _gf_errno = GF_E_SSE_CFM; return 0; }
  294 + if (rsimd || rnosimd) { _gf_errno = GF_E_SSE_CFM; return 0; }
294 295 if (!pclmul) { _gf_errno = GF_E_PCLMULX; return 0; }
295 296 return 1;
296 297 }
297 298  
298 299 if (mult_type == GF_MULT_BYTWO_p || mult_type == GF_MULT_BYTWO_b) {
299 300 if (raltmap) { _gf_errno = GF_E_ALT_BY2; return 0; }
300   - if (rsse && !sse2) { _gf_errno = GF_E_BY2_SSE; return 0; }
  301 + if (rsimd && !sse2) { _gf_errno = GF_E_BY2_SSE; return 0; }
301 302 return 1;
302 303 }
303 304  
304 305 if (mult_type == GF_MULT_LOG_TABLE || mult_type == GF_MULT_LOG_ZERO
305 306 || mult_type == GF_MULT_LOG_ZERO_EXT ) {
306 307 if (w > 27) { _gf_errno = GF_E_LOGBADW; return 0; }
307   - if (raltmap || rsse || rnosse) { _gf_errno = GF_E_LOG___J; return 0; }
  308 + if (raltmap || rsimd || rnosimd) { _gf_errno = GF_E_LOG___J; return 0; }
308 309  
309 310 if (mult_type == GF_MULT_LOG_TABLE) return 1;
310 311  
... ... @@ -324,14 +325,14 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
324 325 (arg2 != 4 && arg2 != 8 && arg2 != 16))) { _gf_errno = GF_E_GR_128A; return 0; }
325 326 if (arg1 > 27 || arg2 > 27) { _gf_errno = GF_E_GR_A_27; return 0; }
326 327 if (arg1 > w || arg2 > w) { _gf_errno = GF_E_GR_AR_W; return 0; }
327   - if (raltmap || rsse || rnosse) { _gf_errno = GF_E_GR____J; return 0; }
  328 + if (raltmap || rsimd || rnosimd) { _gf_errno = GF_E_GR____J; return 0; }
328 329 return 1;
329 330 }
330 331  
331 332 if (mult_type == GF_MULT_TABLE) {
332 333 if (w != 16 && w >= 15) { _gf_errno = GF_E_TABLE_W; return 0; }
333   - if (w != 4 && (rsse || rnosse)) { _gf_errno = GF_E_TAB_SSE; return 0; }
334   - if (rsse && !sse3) { _gf_errno = GF_E_TABSSE3; return 0; }
  334 + if (w != 4 && (rsimd || rnosimd)) { _gf_errno = GF_E_TAB_SSE; return 0; }
  335 + if (rsimd && !sse3) { _gf_errno = GF_E_TABSSE3; return 0; }
335 336 if (raltmap) { _gf_errno = GF_E_TAB_ALT; return 0; }
336 337 return 1;
337 338 }
... ... @@ -344,46 +345,46 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
344 345 }
345 346 if (w == 8) {
346 347 if (arg1 != 4 || arg2 != 8) { _gf_errno = GF_E_SP_8_AR; return 0; }
347   - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
  348 + if (rsimd && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
348 349 if (raltmap) { _gf_errno = GF_E_SP_8__A; return 0; }
349 350 } else if (w == 16) {
350 351 if ((arg1 == 8 && arg2 == 8) ||
351 352 (arg1 == 8 && arg2 == 16)) {
352   - if (rsse || rnosse) { _gf_errno = GF_E_SP_16_S; return 0; }
  353 + if (rsimd || rnosimd) { _gf_errno = GF_E_SP_16_S; return 0; }
353 354 if (raltmap) { _gf_errno = GF_E_SP_16_A; return 0; }
354 355 } else if (arg1 == 4 && arg2 == 16) {
355   - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
  356 + if (rsimd && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
356 357 } else { _gf_errno = GF_E_SP_16AR; return 0; }
357 358 } else if (w == 32) {
358 359 if ((arg1 == 8 && arg2 == 8) ||
359 360 (arg1 == 8 && arg2 == 32) ||
360 361 (arg1 == 16 && arg2 == 32)) {
361   - if (rsse || rnosse) { _gf_errno = GF_E_SP_32_S; return 0; }
  362 + if (rsimd || rnosimd) { _gf_errno = GF_E_SP_32_S; return 0; }
362 363 if (raltmap) { _gf_errno = GF_E_SP_32_A; return 0; }
363 364 } else if (arg1 == 4 && arg2 == 32) {
364   - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
  365 + if (rsimd && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
365 366 if (raltmap && !sse3) { _gf_errno = GF_E_SP_32AS; return 0; }
366   - if (raltmap && rnosse) { _gf_errno = GF_E_SP_32AS; return 0; }
  367 + if (raltmap && rnosimd) { _gf_errno = GF_E_SP_32AS; return 0; }
367 368 } else { _gf_errno = GF_E_SP_32AR; return 0; }
368 369 } else if (w == 64) {
369 370 if ((arg1 == 8 && arg2 == 8) ||
370 371 (arg1 == 8 && arg2 == 64) ||
371 372 (arg1 == 16 && arg2 == 64)) {
372   - if (rsse || rnosse) { _gf_errno = GF_E_SP_64_S; return 0; }
  373 + if (rsimd || rnosimd) { _gf_errno = GF_E_SP_64_S; return 0; }
373 374 if (raltmap) { _gf_errno = GF_E_SP_64_A; return 0; }
374 375 } else if (arg1 == 4 && arg2 == 64) {
375   - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
  376 + if (rsimd && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
376 377 if (raltmap && !sse3) { _gf_errno = GF_E_SP_64AS; return 0; }
377   - if (raltmap && rnosse) { _gf_errno = GF_E_SP_64AS; return 0; }
  378 + if (raltmap && rnosimd) { _gf_errno = GF_E_SP_64AS; return 0; }
378 379 } else { _gf_errno = GF_E_SP_64AR; return 0; }
379 380 } else if (w == 128) {
380 381 if (arg1 == 8 && arg2 == 128) {
381   - if (rsse || rnosse) { _gf_errno = GF_E_SP128_S; return 0; }
  382 + if (rsimd || rnosimd) { _gf_errno = GF_E_SP128_S; return 0; }
382 383 if (raltmap) { _gf_errno = GF_E_SP128_A; return 0; }
383 384 } else if (arg1 == 4 && arg2 == 128) {
384   - if (rsse && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
  385 + if (rsimd && !sse3) { _gf_errno = GF_E_SP_SSE3; return 0; }
385 386 if (raltmap && !sse3) { _gf_errno = GF_E_SP128AS; return 0; }
386   - if (raltmap && rnosse) { _gf_errno = GF_E_SP128AS; return 0; }
  387 + if (raltmap && rnosimd) { _gf_errno = GF_E_SP128AS; return 0; }
387 388 } else { _gf_errno = GF_E_SP128AR; return 0; }
388 389 } else { _gf_errno = GF_E_SPLIT_W; return 0; }
389 390 return 1;
... ... @@ -395,7 +396,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
395 396 if (w < 128 && (poly >> (w/2)) != 0) { _gf_errno = GF_E_COMP_PP; return 0; }
396 397 if (divide_type != GF_DIVIDE_DEFAULT) { _gf_errno = GF_E_DIVCOMP; return 0; }
397 398 if (arg1 != 2) { _gf_errno = GF_E_COMP_A2; return 0; }
398   - if (rsse || rnosse) { _gf_errno = GF_E_COMP_SS; return 0; }
  399 + if (rsimd || rnosimd) { _gf_errno = GF_E_COMP_SS; return 0; }
399 400 if (base != NULL) {
400 401 sub = (gf_internal_t *) base->scratch;
401 402 if (sub->w != w/2) { _gf_errno = GF_E_BASE__W; return 0; }
... ...
src/gf_method.c
... ... @@ -121,11 +121,17 @@ int create_gf_from_argv(gf_t *gf, int w, int argc, char **argv, int starting)
121 121 } else if (strcmp(argv[starting], "LAZY") == 0) {
122 122 region_type |= GF_REGION_LAZY;
123 123 starting++;
  124 + } else if (strcmp(argv[starting], "SIMD") == 0) {
  125 + region_type |= GF_REGION_SIMD;
  126 + starting++;
  127 + } else if (strcmp(argv[starting], "NOSIMD") == 0) {
  128 + region_type |= GF_REGION_NOSIMD;
  129 + starting++;
124 130 } else if (strcmp(argv[starting], "SSE") == 0) {
125   - region_type |= GF_REGION_SSE;
  131 + region_type |= GF_REGION_SIMD;
126 132 starting++;
127 133 } else if (strcmp(argv[starting], "NOSSE") == 0) {
128   - region_type |= GF_REGION_NOSSE;
  134 + region_type |= GF_REGION_NOSIMD;
129 135 starting++;
130 136 } else if (strcmp(argv[starting], "CAUCHY") == 0) {
131 137 region_type |= GF_REGION_CAUCHY;
... ...
src/gf_w128.c
... ... @@ -1527,7 +1527,7 @@ int gf_w128_split_init(gf_t *gf)
1527 1527  
1528 1528 gf->multiply.w128 = gf_w128_bytwo_p_multiply;
1529 1529 #if defined(INTEL_SSE4_PCLMUL)
1530   - if (!(h->region_type & GF_REGION_NOSSE)){
  1530 + if (!(h->region_type & GF_REGION_NOSIMD)){
1531 1531 gf->multiply.w128 = gf_w128_clm_multiply;
1532 1532 }
1533 1533 #endif
... ... @@ -1546,7 +1546,7 @@ int gf_w128_split_init(gf_t *gf)
1546 1546 if((h->region_type & GF_REGION_ALTMAP))
1547 1547 {
1548 1548 #ifdef INTEL_SSE4
1549   - if(!(h->region_type & GF_REGION_NOSSE))
  1549 + if(!(h->region_type & GF_REGION_NOSIMD))
1550 1550 gf->multiply_region.w128 = gf_w128_split_4_128_sse_altmap_multiply_region;
1551 1551 else
1552 1552 return 0;
... ... @@ -1556,7 +1556,7 @@ int gf_w128_split_init(gf_t *gf)
1556 1556 }
1557 1557 else {
1558 1558 #ifdef INTEL_SSE4
1559   - if(!(h->region_type & GF_REGION_NOSSE))
  1559 + if(!(h->region_type & GF_REGION_NOSIMD))
1560 1560 gf->multiply_region.w128 = gf_w128_split_4_128_sse_multiply_region;
1561 1561 else
1562 1562 gf->multiply_region.w128 = gf_w128_split_4_128_multiply_region;
... ...
src/gf_w16.c
... ... @@ -1327,14 +1327,14 @@ int gf_w16_split_init(gf_t *gf)
1327 1327  
1328 1328 } else if ((h->arg1 == 4 && h->arg2 == 16) || (h->arg2 == 4 && h->arg1 == 16)) {
1329 1329 if (issse3) {
1330   - if(h->region_type & GF_REGION_ALTMAP && h->region_type & GF_REGION_NOSSE)
  1330 + if(h->region_type & GF_REGION_ALTMAP && h->region_type & GF_REGION_NOSIMD)
1331 1331 gf->multiply_region.w32 = gf_w16_split_4_16_lazy_nosse_altmap_multiply_region;
1332   - else if(h->region_type & GF_REGION_NOSSE)
  1332 + else if(h->region_type & GF_REGION_NOSIMD)
1333 1333 gf->multiply_region.w32 = gf_w16_split_4_16_lazy_multiply_region;
1334 1334 else if(h->region_type & GF_REGION_ALTMAP)
1335 1335 gf->multiply_region.w32 = gf_w16_split_4_16_lazy_sse_altmap_multiply_region;
1336 1336 } else {
1337   - if(h->region_type & GF_REGION_SSE)
  1337 + if(h->region_type & GF_REGION_SIMD)
1338 1338 return 0;
1339 1339 else if(h->region_type & GF_REGION_ALTMAP)
1340 1340 gf->multiply_region.w32 = gf_w16_split_4_16_lazy_nosse_altmap_multiply_region;
... ... @@ -1884,25 +1884,25 @@ int gf_w16_bytwo_init(gf_t *gf)
1884 1884 if (h->mult_type == GF_MULT_BYTWO_p) {
1885 1885 gf->multiply.w32 = gf_w16_bytwo_p_multiply;
1886 1886 #ifdef INTEL_SSE2
1887   - if (h->region_type & GF_REGION_NOSSE)
  1887 + if (h->region_type & GF_REGION_NOSIMD)
1888 1888 gf->multiply_region.w32 = gf_w16_bytwo_p_nosse_multiply_region;
1889 1889 else
1890 1890 gf->multiply_region.w32 = gf_w16_bytwo_p_sse_multiply_region;
1891 1891 #else
1892 1892 gf->multiply_region.w32 = gf_w16_bytwo_p_nosse_multiply_region;
1893   - if(h->region_type & GF_REGION_SSE)
  1893 + if(h->region_type & GF_REGION_SIMD)
1894 1894 return 0;
1895 1895 #endif
1896 1896 } else {
1897 1897 gf->multiply.w32 = gf_w16_bytwo_b_multiply;
1898 1898 #ifdef INTEL_SSE2
1899   - if (h->region_type & GF_REGION_NOSSE)
  1899 + if (h->region_type & GF_REGION_NOSIMD)
1900 1900 gf->multiply_region.w32 = gf_w16_bytwo_b_nosse_multiply_region;
1901 1901 else
1902 1902 gf->multiply_region.w32 = gf_w16_bytwo_b_sse_multiply_region;
1903 1903 #else
1904 1904 gf->multiply_region.w32 = gf_w16_bytwo_b_nosse_multiply_region;
1905   - if(h->region_type & GF_REGION_SSE)
  1905 + if(h->region_type & GF_REGION_SIMD)
1906 1906 return 0;
1907 1907 #endif
1908 1908 }
... ...
src/gf_w32.c
... ... @@ -1434,25 +1434,25 @@ int gf_w32_bytwo_init(gf_t *gf)
1434 1434 if (h->mult_type == GF_MULT_BYTWO_p) {
1435 1435 gf->multiply.w32 = gf_w32_bytwo_p_multiply;
1436 1436 #ifdef INTEL_SSE2
1437   - if (h->region_type & GF_REGION_NOSSE)
  1437 + if (h->region_type & GF_REGION_NOSIMD)
1438 1438 gf->multiply_region.w32 = gf_w32_bytwo_p_nosse_multiply_region;
1439 1439 else
1440 1440 gf->multiply_region.w32 = gf_w32_bytwo_p_sse_multiply_region;
1441 1441 #else
1442 1442 gf->multiply_region.w32 = gf_w32_bytwo_p_nosse_multiply_region;
1443   - if(h->region_type & GF_REGION_SSE)
  1443 + if(h->region_type & GF_REGION_SIMD)
1444 1444 return 0;
1445 1445 #endif
1446 1446 } else {
1447 1447 gf->multiply.w32 = gf_w32_bytwo_b_multiply;
1448 1448 #ifdef INTEL_SSE2
1449   - if (h->region_type & GF_REGION_NOSSE)
  1449 + if (h->region_type & GF_REGION_NOSIMD)
1450 1450 gf->multiply_region.w32 = gf_w32_bytwo_b_nosse_multiply_region;
1451 1451 else
1452 1452 gf->multiply_region.w32 = gf_w32_bytwo_b_sse_multiply_region;
1453 1453 #else
1454 1454 gf->multiply_region.w32 = gf_w32_bytwo_b_nosse_multiply_region;
1455   - if(h->region_type & GF_REGION_SSE)
  1455 + if(h->region_type & GF_REGION_SIMD)
1456 1456 return 0;
1457 1457 #endif
1458 1458 }
... ... @@ -2335,13 +2335,13 @@ int gf_w32_split_init(gf_t *gf)
2335 2335 ld2 = (struct gf_split_2_32_lazy_data *) h->private;
2336 2336 ld2->last_value = 0;
2337 2337 #ifdef INTEL_SSSE3
2338   - if (!(h->region_type & GF_REGION_NOSSE))
  2338 + if (!(h->region_type & GF_REGION_NOSIMD))
2339 2339 gf->multiply_region.w32 = gf_w32_split_2_32_lazy_sse_multiply_region;
2340 2340 else
2341 2341 gf->multiply_region.w32 = gf_w32_split_2_32_lazy_multiply_region;
2342 2342 #else
2343 2343 gf->multiply_region.w32 = gf_w32_split_2_32_lazy_multiply_region;
2344   - if(h->region_type & GF_REGION_SSE) return 0;
  2344 + if(h->region_type & GF_REGION_SIMD) return 0;
2345 2345 #endif
2346 2346 return 1;
2347 2347 }
... ... @@ -2352,7 +2352,7 @@ int gf_w32_split_init(gf_t *gf)
2352 2352 (issse3 && h->mult_type == GF_REGION_DEFAULT)) {
2353 2353 ld4 = (struct gf_split_4_32_lazy_data *) h->private;
2354 2354 ld4->last_value = 0;
2355   - if ((h->region_type & GF_REGION_NOSSE) || !issse3) {
  2355 + if ((h->region_type & GF_REGION_NOSIMD) || !issse3) {
2356 2356 gf->multiply_region.w32 = gf_w32_split_4_32_lazy_multiply_region;
2357 2357 } else if (h->region_type & GF_REGION_ALTMAP) {
2358 2358 gf->multiply_region.w32 = gf_w32_split_4_32_lazy_sse_altmap_multiply_region;
... ...
src/gf_w4.c
... ... @@ -490,13 +490,13 @@ int gf_w4_single_table_init(gf_t *gf)
490 490 gf->divide.w32 = gf_w4_single_table_divide;
491 491 gf->multiply.w32 = gf_w4_single_table_multiply;
492 492 #ifdef INTEL_SSSE3
493   - if(h->region_type & (GF_REGION_NOSSE | GF_REGION_CAUCHY))
  493 + if(h->region_type & (GF_REGION_NOSIMD | GF_REGION_CAUCHY))
494 494 gf->multiply_region.w32 = gf_w4_single_table_multiply_region;
495 495 else
496 496 gf->multiply_region.w32 = gf_w4_single_table_sse_multiply_region;
497 497 #else
498 498 gf->multiply_region.w32 = gf_w4_single_table_multiply_region;
499   - if (h->region_type & GF_REGION_SSE) return 0;
  499 + if (h->region_type & GF_REGION_SIMD) return 0;
500 500 #endif
501 501  
502 502 return 1;
... ... @@ -1905,25 +1905,25 @@ int gf_w4_bytwo_init(gf_t *gf)
1905 1905 if (h->mult_type == GF_MULT_BYTWO_p) {
1906 1906 gf->multiply.w32 = gf_w4_bytwo_p_multiply;
1907 1907 #ifdef INTEL_SSE2
1908   - if (h->region_type & GF_REGION_NOSSE)
  1908 + if (h->region_type & GF_REGION_NOSIMD)
1909 1909 gf->multiply_region.w32 = gf_w4_bytwo_p_nosse_multiply_region;
1910 1910 else
1911 1911 gf->multiply_region.w32 = gf_w4_bytwo_p_sse_multiply_region;
1912 1912 #else
1913 1913 gf->multiply_region.w32 = gf_w4_bytwo_p_nosse_multiply_region;
1914   - if (h->region_type & GF_REGION_SSE)
  1914 + if (h->region_type & GF_REGION_SIMD)
1915 1915 return 0;
1916 1916 #endif
1917 1917 } else {
1918 1918 gf->multiply.w32 = gf_w4_bytwo_b_multiply;
1919 1919 #ifdef INTEL_SSE2
1920   - if (h->region_type & GF_REGION_NOSSE)
  1920 + if (h->region_type & GF_REGION_NOSIMD)
1921 1921 gf->multiply_region.w32 = gf_w4_bytwo_b_nosse_multiply_region;
1922 1922 else
1923 1923 gf->multiply_region.w32 = gf_w4_bytwo_b_sse_multiply_region;
1924 1924 #else
1925 1925 gf->multiply_region.w32 = gf_w4_bytwo_b_nosse_multiply_region;
1926   - if (h->region_type & GF_REGION_SSE)
  1926 + if (h->region_type & GF_REGION_SIMD)
1927 1927 return 0;
1928 1928 #endif
1929 1929 }
... ...
src/gf_w64.c
... ... @@ -1488,25 +1488,25 @@ int gf_w64_bytwo_init(gf_t *gf)
1488 1488 if (h->mult_type == GF_MULT_BYTWO_p) {
1489 1489 gf->multiply.w64 = gf_w64_bytwo_p_multiply;
1490 1490 #ifdef INTEL_SSE2
1491   - if (h->region_type & GF_REGION_NOSSE)
  1491 + if (h->region_type & GF_REGION_NOSIMD)
1492 1492 gf->multiply_region.w64 = gf_w64_bytwo_p_nosse_multiply_region;
1493 1493 else
1494 1494 gf->multiply_region.w64 = gf_w64_bytwo_p_sse_multiply_region;
1495 1495 #else
1496 1496 gf->multiply_region.w64 = gf_w64_bytwo_p_nosse_multiply_region;
1497   - if(h->region_type & GF_REGION_SSE)
  1497 + if(h->region_type & GF_REGION_SIMD)
1498 1498 return 0;
1499 1499 #endif
1500 1500 } else {
1501 1501 gf->multiply.w64 = gf_w64_bytwo_b_multiply;
1502 1502 #ifdef INTEL_SSE2
1503   - if (h->region_type & GF_REGION_NOSSE)
  1503 + if (h->region_type & GF_REGION_NOSIMD)
1504 1504 gf->multiply_region.w64 = gf_w64_bytwo_b_nosse_multiply_region;
1505 1505 else
1506 1506 gf->multiply_region.w64 = gf_w64_bytwo_b_sse_multiply_region;
1507 1507 #else
1508 1508 gf->multiply_region.w64 = gf_w64_bytwo_b_nosse_multiply_region;
1509   - if(h->region_type & GF_REGION_SSE)
  1509 + if(h->region_type & GF_REGION_SIMD)
1510 1510 return 0;
1511 1511 #endif
1512 1512 }
... ... @@ -2006,7 +2006,7 @@ int gf_w64_split_init(gf_t *gf)
2006 2006 gf->multiply.w64 = gf_w64_bytwo_p_multiply;
2007 2007  
2008 2008 #if defined(INTEL_SSE4_PCLMUL)
2009   - if ((!(h->region_type & GF_REGION_NOSSE) &&
  2009 + if ((!(h->region_type & GF_REGION_NOSIMD) &&
2010 2010 (h->arg1 == 64 || h->arg2 == 64)) ||
2011 2011 h->mult_type == GF_MULT_DEFAULT){
2012 2012  
... ... @@ -2045,7 +2045,7 @@ int gf_w64_split_init(gf_t *gf)
2045 2045 d4 = (struct gf_split_4_64_lazy_data *) h->private;
2046 2046 d4->last_value = 0;
2047 2047  
2048   - if((h->region_type & GF_REGION_ALTMAP) && (h->region_type & GF_REGION_NOSSE)) return 0;
  2048 + if((h->region_type & GF_REGION_ALTMAP) && (h->region_type & GF_REGION_NOSIMD)) return 0;
2049 2049 if(h->region_type & GF_REGION_ALTMAP)
2050 2050 {
2051 2051 #ifdef INTEL_SSSE3
... ... @@ -2057,13 +2057,13 @@ int gf_w64_split_init(gf_t *gf)
2057 2057 else //no altmap
2058 2058 {
2059 2059 #ifdef INTEL_SSE4
2060   - if(h->region_type & GF_REGION_NOSSE)
  2060 + if(h->region_type & GF_REGION_NOSIMD)
2061 2061 gf->multiply_region.w64 = gf_w64_split_4_64_lazy_multiply_region;
2062 2062 else
2063 2063 gf->multiply_region.w64 = gf_w64_split_4_64_lazy_sse_multiply_region;
2064 2064 #else
2065 2065 gf->multiply_region.w64 = gf_w64_split_4_64_lazy_multiply_region;
2066   - if(h->region_type & GF_REGION_SSE)
  2066 + if(h->region_type & GF_REGION_SIMD)
2067 2067 return 0;
2068 2068 #endif
2069 2069 }
... ...
src/gf_w8.c
... ... @@ -1180,13 +1180,13 @@ int gf_w8_split_init(gf_t *gf)
1180 1180 gf->multiply.w32 = gf_w8_split_multiply;
1181 1181  
1182 1182 #ifdef INTEL_SSSE3
1183   - if (h->region_type & GF_REGION_NOSSE)
  1183 + if (h->region_type & GF_REGION_NOSIMD)
1184 1184 gf->multiply_region.w32 = gf_w8_split_multiply_region;
1185 1185 else
1186 1186 gf->multiply_region.w32 = gf_w8_split_multiply_region_sse;
1187 1187 #else
1188 1188 gf->multiply_region.w32 = gf_w8_split_multiply_region;
1189   - if(h->region_type & GF_REGION_SSE)
  1189 + if(h->region_type & GF_REGION_SIMD)
1190 1190 return 0;
1191 1191 #endif
1192 1192  
... ... @@ -2259,25 +2259,25 @@ int gf_w8_bytwo_init(gf_t *gf)
2259 2259 if (h->mult_type == GF_MULT_BYTWO_p) {
2260 2260 gf->multiply.w32 = gf_w8_bytwo_p_multiply;
2261 2261 #ifdef INTEL_SSE2
2262   - if (h->region_type & GF_REGION_NOSSE)
  2262 + if (h->region_type & GF_REGION_NOSIMD)
2263 2263 gf->multiply_region.w32 = gf_w8_bytwo_p_nosse_multiply_region;
2264 2264 else
2265 2265 gf->multiply_region.w32 = gf_w8_bytwo_p_sse_multiply_region;
2266 2266 #else
2267 2267 gf->multiply_region.w32 = gf_w8_bytwo_p_nosse_multiply_region;
2268   - if(h->region_type & GF_REGION_SSE)
  2268 + if(h->region_type & GF_REGION_SIMD)
2269 2269 return 0;
2270 2270 #endif
2271 2271 } else {
2272 2272 gf->multiply.w32 = gf_w8_bytwo_b_multiply;
2273 2273 #ifdef INTEL_SSE2
2274   - if (h->region_type & GF_REGION_NOSSE)
  2274 + if (h->region_type & GF_REGION_NOSIMD)
2275 2275 gf->multiply_region.w32 = gf_w8_bytwo_b_nosse_multiply_region;
2276 2276 else
2277 2277 gf->multiply_region.w32 = gf_w8_bytwo_b_sse_multiply_region;
2278 2278 #else
2279 2279 gf->multiply_region.w32 = gf_w8_bytwo_b_nosse_multiply_region;
2280   - if(h->region_type & GF_REGION_SSE)
  2280 + if(h->region_type & GF_REGION_SIMD)
2281 2281 return 0;
2282 2282 #endif
2283 2283 }
... ...
tools/gf_methods.c
... ... @@ -28,7 +28,7 @@ static char *MULTS[NMULTS] = { &quot;SHIFT&quot;, &quot;CARRY_FREE&quot;, &quot;CARRY_FREE_GK&quot;, &quot;GROUP44&quot;
28 28 /* Make sure CAUCHY is last */
29 29  
30 30 #define NREGIONS (7)
31   -static char *REGIONS[NREGIONS] = { "DOUBLE", "QUAD", "LAZY", "SSE", "NOSSE",
  31 +static char *REGIONS[NREGIONS] = { "DOUBLE", "QUAD", "LAZY", "SIMD", "NOSIMD",
32 32 "ALTMAP", "CAUCHY" };
33 33  
34 34 #define BNREGIONS (4)
... ...