summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/asm/bn-586.pl
diff options
context:
space:
mode:
authormiod <>2016-11-04 17:30:30 +0000
committermiod <>2016-11-04 17:30:30 +0000
commit723502d9588ba0e1cc08af1b12654917da74d440 (patch)
tree77b413175d422148cfb0ef7b2062340230aa5413 /src/lib/libcrypto/bn/asm/bn-586.pl
parent391f8ce21bb7929810460a73e2fde2c80540848d (diff)
downloadopenbsd-723502d9588ba0e1cc08af1b12654917da74d440.tar.gz
openbsd-723502d9588ba0e1cc08af1b12654917da74d440.tar.bz2
openbsd-723502d9588ba0e1cc08af1b12654917da74d440.zip
Replace all uses of magic numbers when operating on OPENSSL_ia32_P[] by
meaningful constants in a private header file, so that reviewers can actually get a chance to figure out what the code is attempting to do without knowing all cpuid bits. While there, turn it from an array of two 32-bit ints into a properly aligned 64-bit int. Use of OPENSSL_ia32_P is now restricted to the assembler parts. C code will now always use OPENSSL_cpu_caps() and check for the proper bits in the whole 64-bit word it returns. i386 tests and ok jsing@
Diffstat (limited to 'src/lib/libcrypto/bn/asm/bn-586.pl')
-rw-r--r--src/lib/libcrypto/bn/asm/bn-586.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bn/asm/bn-586.pl b/src/lib/libcrypto/bn/asm/bn-586.pl
index 332ef3e91d..c4e2baa6c5 100644
--- a/src/lib/libcrypto/bn/asm/bn-586.pl
+++ b/src/lib/libcrypto/bn/asm/bn-586.pl
@@ -25,7 +25,7 @@ sub bn_mul_add_words
25 { 25 {
26 local($name)=@_; 26 local($name)=@_;
27 27
28 &function_begin_B($name,$sse2?"EXTRN\t_OPENSSL_ia32cap_P:DWORD":""); 28 &function_begin_B($name,"");
29 29
30 $r="eax"; 30 $r="eax";
31 $a="edx"; 31 $a="edx";
@@ -33,7 +33,7 @@ sub bn_mul_add_words
33 33
34 if ($sse2) { 34 if ($sse2) {
35 &picmeup("eax","OPENSSL_ia32cap_P"); 35 &picmeup("eax","OPENSSL_ia32cap_P");
36 &bt(&DWP(0,"eax"),26); 36 &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2");
37 &jnc(&label("maw_non_sse2")); 37 &jnc(&label("maw_non_sse2"));
38 38
39 &mov($r,&wparam(0)); 39 &mov($r,&wparam(0));
@@ -211,7 +211,7 @@ sub bn_mul_words
211 { 211 {
212 local($name)=@_; 212 local($name)=@_;
213 213
214 &function_begin_B($name,$sse2?"EXTRN\t_OPENSSL_ia32cap_P:DWORD":""); 214 &function_begin_B($name,"");
215 215
216 $r="eax"; 216 $r="eax";
217 $a="edx"; 217 $a="edx";
@@ -219,7 +219,7 @@ sub bn_mul_words
219 219
220 if ($sse2) { 220 if ($sse2) {
221 &picmeup("eax","OPENSSL_ia32cap_P"); 221 &picmeup("eax","OPENSSL_ia32cap_P");
222 &bt(&DWP(0,"eax"),26); 222 &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2");
223 &jnc(&label("mw_non_sse2")); 223 &jnc(&label("mw_non_sse2"));
224 224
225 &mov($r,&wparam(0)); 225 &mov($r,&wparam(0));
@@ -322,7 +322,7 @@ sub bn_sqr_words
322 { 322 {
323 local($name)=@_; 323 local($name)=@_;
324 324
325 &function_begin_B($name,$sse2?"EXTRN\t_OPENSSL_ia32cap_P:DWORD":""); 325 &function_begin_B($name,"");
326 326
327 $r="eax"; 327 $r="eax";
328 $a="edx"; 328 $a="edx";
@@ -330,7 +330,7 @@ sub bn_sqr_words
330 330
331 if ($sse2) { 331 if ($sse2) {
332 &picmeup("eax","OPENSSL_ia32cap_P"); 332 &picmeup("eax","OPENSSL_ia32cap_P");
333 &bt(&DWP(0,"eax"),26); 333 &bt(&DWP(0,"eax"),"\$IA32CAP_BIT0_SSE2");
334 &jnc(&label("sqr_non_sse2")); 334 &jnc(&label("sqr_non_sse2"));
335 335
336 &mov($r,&wparam(0)); 336 &mov($r,&wparam(0));