diff options
| author | miod <> | 2016-11-04 17:30:30 +0000 |
|---|---|---|
| committer | miod <> | 2016-11-04 17:30:30 +0000 |
| commit | 1a12fc8399638223feca8f853e2ac2cc22eeb471 (patch) | |
| tree | 77b413175d422148cfb0ef7b2062340230aa5413 /src/lib/libcrypto/rc4/asm/rc4-586.pl | |
| parent | 78e68d71838891e44ddbb5238203ccfce3b62d80 (diff) | |
| download | openbsd-1a12fc8399638223feca8f853e2ac2cc22eeb471.tar.gz openbsd-1a12fc8399638223feca8f853e2ac2cc22eeb471.tar.bz2 openbsd-1a12fc8399638223feca8f853e2ac2cc22eeb471.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/rc4/asm/rc4-586.pl')
| -rw-r--r-- | src/lib/libcrypto/rc4/asm/rc4-586.pl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rc4/asm/rc4-586.pl b/src/lib/libcrypto/rc4/asm/rc4-586.pl index 84f1a798cb..03f0cff467 100644 --- a/src/lib/libcrypto/rc4/asm/rc4-586.pl +++ b/src/lib/libcrypto/rc4/asm/rc4-586.pl | |||
| @@ -189,7 +189,8 @@ if ($alt=0) { | |||
| 189 | &jz (&label("go4loop4")); | 189 | &jz (&label("go4loop4")); |
| 190 | 190 | ||
| 191 | &picmeup($out,"OPENSSL_ia32cap_P"); | 191 | &picmeup($out,"OPENSSL_ia32cap_P"); |
| 192 | &bt (&DWP(0,$out),26); # check SSE2 bit [could have been MMX] | 192 | # check SSE2 bit [could have been MMX] |
| 193 | &bt (&DWP(0,$out),"\$IA32CAP_BIT0_SSE2"); | ||
| 193 | &jnc (&label("go4loop4")); | 194 | &jnc (&label("go4loop4")); |
| 194 | 195 | ||
| 195 | &mov ($out,&wparam(3)) if (!$alt); | 196 | &mov ($out,&wparam(3)) if (!$alt); |
| @@ -312,7 +313,7 @@ $idx="edx"; | |||
| 312 | &xor ("eax","eax"); | 313 | &xor ("eax","eax"); |
| 313 | &mov (&DWP(-4,$out),$idi); # borrow key->y | 314 | &mov (&DWP(-4,$out),$idi); # borrow key->y |
| 314 | 315 | ||
| 315 | &bt (&DWP(0,$idx),20); # check for bit#20 | 316 | &bt (&DWP(0,$idx),"\$IA32CAP_BIT0_INTELP4"); |
| 316 | &jc (&label("c1stloop")); | 317 | &jc (&label("c1stloop")); |
| 317 | 318 | ||
| 318 | &set_label("w1stloop",16); | 319 | &set_label("w1stloop",16); |
| @@ -388,9 +389,9 @@ $idx="edx"; | |||
| 388 | &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); | 389 | &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); |
| 389 | &picmeup("edx","OPENSSL_ia32cap_P"); | 390 | &picmeup("edx","OPENSSL_ia32cap_P"); |
| 390 | &mov ("edx",&DWP(0,"edx")); | 391 | &mov ("edx",&DWP(0,"edx")); |
| 391 | &bt ("edx",20); | 392 | &bt ("edx","\$IA32CAP_BIT0_INTELP4"); |
| 392 | &jc (&label("1xchar")); | 393 | &jc (&label("1xchar")); |
| 393 | &bt ("edx",26); | 394 | &bt ("edx","\$IA32CAP_BIT0_SSE2"); |
| 394 | &jnc (&label("ret")); | 395 | &jnc (&label("ret")); |
| 395 | &add ("eax",25); | 396 | &add ("eax",25); |
| 396 | &ret (); | 397 | &ret (); |
