diff options
author | Brent Cook <bcook@cvs.openbsd.org> | 2015-09-11 12:17:58 +0000 |
---|---|---|
committer | Brent Cook <bcook@cvs.openbsd.org> | 2015-09-11 12:17:58 +0000 |
commit | ac4eb5a6432fdbf3d08615234bed786cfd6bebc7 (patch) | |
tree | bbe1967a0eee12624b345c2dd2fb072aa0519ab7 /lib/libcrypto/bn | |
parent | 2f161f91c335bfc09e37dc52cc83020751df5a32 (diff) |
Fixup inter-bank movq/movd operations, emit bytes for pclmulqdq again.
Fixes builds gcc + Apple's assembler, working on reenabling builds with older
OpenBSD releases.
based on OpenSSL commit:
https://git.openssl.org/?p=openssl.git;a=commitdiff;h=902b30df193afc3417a96ba72a81ed390bd50de3
ok miod@
Diffstat (limited to 'lib/libcrypto/bn')
-rw-r--r-- | lib/libcrypto/bn/asm/x86_64-gf2m.pl | 15 | ||||
-rwxr-xr-x | lib/libcrypto/bn/asm/x86_64-mont5.pl | 12 |
2 files changed, 14 insertions, 13 deletions
diff --git a/lib/libcrypto/bn/asm/x86_64-gf2m.pl b/lib/libcrypto/bn/asm/x86_64-gf2m.pl index 1658acbbddd..8e45c7479b3 100644 --- a/lib/libcrypto/bn/asm/x86_64-gf2m.pl +++ b/lib/libcrypto/bn/asm/x86_64-gf2m.pl @@ -31,7 +31,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or die "can't locate x86_64-xlate.pl"; -open STDOUT,"| $^X $xlate $flavour $output"; +open OUT,"| \"$^X\" $xlate $flavour $output"; +*STDOUT=*OUT; ($lo,$hi)=("%rax","%rdx"); $a=$lo; ($i0,$i1)=("%rsi","%rdi"); @@ -142,12 +143,12 @@ $code.=<<___; mov (%rsp,$i1,8),$t1 mov $t1,$t0 shl \$`8*$n-4`,$t1 - movq $R,$i0 + movd $R,$i0 shr \$`64-(8*$n-4)`,$t0 xor $t1,$lo psrldq \$8,$R xor $t0,$hi - movq $R,$i1 + movd $R,$i1 xor $i0,$lo xor $i1,$hi @@ -170,15 +171,15 @@ bn_GF2m_mul_2x2: bt \$33,%rax jnc .Lvanilla_mul_2x2 - movq $a1,%xmm0 - movq $b1,%xmm1 - movq $a0,%xmm2 + movd $a1,%xmm0 + movd $b1,%xmm1 + movd $a0,%xmm2 ___ $code.=<<___ if ($win64); movq 40(%rsp),%xmm3 ___ $code.=<<___ if (!$win64); - movq $b0,%xmm3 + movd $b0,%xmm3 ___ $code.=<<___; movdqa %xmm0,%xmm4 diff --git a/lib/libcrypto/bn/asm/x86_64-mont5.pl b/lib/libcrypto/bn/asm/x86_64-mont5.pl index 9c88884d424..81e5c53728d 100755 --- a/lib/libcrypto/bn/asm/x86_64-mont5.pl +++ b/lib/libcrypto/bn/asm/x86_64-mont5.pl @@ -120,7 +120,7 @@ $code.=<<___; lea $STRIDE($bp),$bp por %xmm3,%xmm0 - movq %xmm0,$m0 # m0=bp[0] + movd %xmm0,$m0 # m0=bp[0] mov ($n0),$n0 # pull n0[0] value mov ($ap),%rax @@ -183,7 +183,7 @@ $code.=<<___; cmp $num,$j jl .L1st - movq %xmm0,$m0 # bp[1] + movd %xmm0,$m0 # bp[1] add %rax,$hi1 mov ($ap),%rax # ap[0] @@ -266,7 +266,7 @@ $code.=<<___; cmp $num,$j jl .Linner - movq %xmm0,$m0 # bp[i+1] + movd %xmm0,$m0 # bp[i+1] add %rax,$hi1 mov ($ap),%rax # ap[0] @@ -403,7 +403,7 @@ $code.=<<___; lea $STRIDE($bp),$bp por %xmm3,%xmm0 - movq %xmm0,$m0 # m0=bp[0] + movd %xmm0,$m0 # m0=bp[0] mov ($n0),$n0 # pull n0[0] value mov ($ap),%rax @@ -550,7 +550,7 @@ $code.=<<___; mov $N[1],-16(%rsp,$j,8) # tp[j-1] mov %rdx,$N[0] - movq %xmm0,$m0 # bp[1] + movd %xmm0,$m0 # bp[1] xor $N[1],$N[1] add $A[0],$N[0] @@ -718,7 +718,7 @@ $code.=<<___; mov $N[0],-24(%rsp,$j,8) # tp[j-1] mov %rdx,$N[0] - movq %xmm0,$m0 # bp[i+1] + movd %xmm0,$m0 # bp[i+1] mov $N[1],-16(%rsp,$j,8) # tp[j-1] xor $N[1],$N[1] |