diff options
| author | miod <> | 2014-04-13 15:16:40 +0000 |
|---|---|---|
| committer | miod <> | 2014-04-13 15:16:40 +0000 |
| commit | dbf195d7fd4efbe4ee578f1dc5c72e7f3deadf18 (patch) | |
| tree | 0de23bccc2c4fc24d466d6a4291987efc8e44770 /src/lib/libcrypto/bn | |
| parent | 210506dd94a697493eb809fb31df7283912ded73 (diff) | |
| parent | 52628ee3f51f011b463aaedb1a28aa0524b43cb3 (diff) | |
| download | openbsd-dbf195d7fd4efbe4ee578f1dc5c72e7f3deadf18.tar.gz openbsd-dbf195d7fd4efbe4ee578f1dc5c72e7f3deadf18.tar.bz2 openbsd-dbf195d7fd4efbe4ee578f1dc5c72e7f3deadf18.zip | |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/bn')
| -rw-r--r-- | src/lib/libcrypto/bn/asm/mips-mont.pl | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/mips.pl | 46 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/modexp512-x86_64.pl | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/parisc-mont.pl | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/asm/x86_64-gf2m.pl | 3 | ||||
| -rwxr-xr-x | src/lib/libcrypto/bn/asm/x86_64-mont.pl | 3 | ||||
| -rwxr-xr-x | src/lib/libcrypto/bn/asm/x86_64-mont5.pl | 7 |
7 files changed, 36 insertions, 32 deletions
diff --git a/src/lib/libcrypto/bn/asm/mips-mont.pl b/src/lib/libcrypto/bn/asm/mips-mont.pl index b944a12b8e..caae04ed3a 100644 --- a/src/lib/libcrypto/bn/asm/mips-mont.pl +++ b/src/lib/libcrypto/bn/asm/mips-mont.pl | |||
| @@ -133,7 +133,7 @@ $code.=<<___; | |||
| 133 | bnez $at,1f | 133 | bnez $at,1f |
| 134 | li $t0,0 | 134 | li $t0,0 |
| 135 | slt $at,$num,17 # on in-order CPU | 135 | slt $at,$num,17 # on in-order CPU |
| 136 | bnezl $at,bn_mul_mont_internal | 136 | bnez $at,bn_mul_mont_internal |
| 137 | nop | 137 | nop |
| 138 | 1: jr $ra | 138 | 1: jr $ra |
| 139 | li $a0,0 | 139 | li $a0,0 |
diff --git a/src/lib/libcrypto/bn/asm/mips.pl b/src/lib/libcrypto/bn/asm/mips.pl index c162a3ec23..d2f3ef7bbf 100644 --- a/src/lib/libcrypto/bn/asm/mips.pl +++ b/src/lib/libcrypto/bn/asm/mips.pl | |||
| @@ -140,10 +140,10 @@ $code.=<<___; | |||
| 140 | .set reorder | 140 | .set reorder |
| 141 | li $minus4,-4 | 141 | li $minus4,-4 |
| 142 | and $ta0,$a2,$minus4 | 142 | and $ta0,$a2,$minus4 |
| 143 | $LD $t0,0($a1) | ||
| 144 | beqz $ta0,.L_bn_mul_add_words_tail | 143 | beqz $ta0,.L_bn_mul_add_words_tail |
| 145 | 144 | ||
| 146 | .L_bn_mul_add_words_loop: | 145 | .L_bn_mul_add_words_loop: |
| 146 | $LD $t0,0($a1) | ||
| 147 | $MULTU $t0,$a3 | 147 | $MULTU $t0,$a3 |
| 148 | $LD $t1,0($a0) | 148 | $LD $t1,0($a0) |
| 149 | $LD $t2,$BNSZ($a1) | 149 | $LD $t2,$BNSZ($a1) |
| @@ -200,10 +200,9 @@ $code.=<<___; | |||
| 200 | $ADDU $v0,$ta2 | 200 | $ADDU $v0,$ta2 |
| 201 | sltu $at,$ta3,$at | 201 | sltu $at,$ta3,$at |
| 202 | $ST $ta3,-$BNSZ($a0) | 202 | $ST $ta3,-$BNSZ($a0) |
| 203 | $ADDU $v0,$at | ||
| 204 | .set noreorder | 203 | .set noreorder |
| 205 | bgtzl $ta0,.L_bn_mul_add_words_loop | 204 | bgtz $ta0,.L_bn_mul_add_words_loop |
| 206 | $LD $t0,0($a1) | 205 | $ADDU $v0,$at |
| 207 | 206 | ||
| 208 | beqz $a2,.L_bn_mul_add_words_return | 207 | beqz $a2,.L_bn_mul_add_words_return |
| 209 | nop | 208 | nop |
| @@ -300,10 +299,10 @@ $code.=<<___; | |||
| 300 | .set reorder | 299 | .set reorder |
| 301 | li $minus4,-4 | 300 | li $minus4,-4 |
| 302 | and $ta0,$a2,$minus4 | 301 | and $ta0,$a2,$minus4 |
| 303 | $LD $t0,0($a1) | ||
| 304 | beqz $ta0,.L_bn_mul_words_tail | 302 | beqz $ta0,.L_bn_mul_words_tail |
| 305 | 303 | ||
| 306 | .L_bn_mul_words_loop: | 304 | .L_bn_mul_words_loop: |
| 305 | $LD $t0,0($a1) | ||
| 307 | $MULTU $t0,$a3 | 306 | $MULTU $t0,$a3 |
| 308 | $LD $t2,$BNSZ($a1) | 307 | $LD $t2,$BNSZ($a1) |
| 309 | $LD $ta0,2*$BNSZ($a1) | 308 | $LD $ta0,2*$BNSZ($a1) |
| @@ -341,10 +340,9 @@ $code.=<<___; | |||
| 341 | $ADDU $v0,$at | 340 | $ADDU $v0,$at |
| 342 | sltu $ta3,$v0,$at | 341 | sltu $ta3,$v0,$at |
| 343 | $ST $v0,-$BNSZ($a0) | 342 | $ST $v0,-$BNSZ($a0) |
| 344 | $ADDU $v0,$ta3,$ta2 | ||
| 345 | .set noreorder | 343 | .set noreorder |
| 346 | bgtzl $ta0,.L_bn_mul_words_loop | 344 | bgtz $ta0,.L_bn_mul_words_loop |
| 347 | $LD $t0,0($a1) | 345 | $ADDU $v0,$ta3,$ta2 |
| 348 | 346 | ||
| 349 | beqz $a2,.L_bn_mul_words_return | 347 | beqz $a2,.L_bn_mul_words_return |
| 350 | nop | 348 | nop |
| @@ -429,10 +427,10 @@ $code.=<<___; | |||
| 429 | .set reorder | 427 | .set reorder |
| 430 | li $minus4,-4 | 428 | li $minus4,-4 |
| 431 | and $ta0,$a2,$minus4 | 429 | and $ta0,$a2,$minus4 |
| 432 | $LD $t0,0($a1) | ||
| 433 | beqz $ta0,.L_bn_sqr_words_tail | 430 | beqz $ta0,.L_bn_sqr_words_tail |
| 434 | 431 | ||
| 435 | .L_bn_sqr_words_loop: | 432 | .L_bn_sqr_words_loop: |
| 433 | $LD $t0,0($a1) | ||
| 436 | $MULTU $t0,$t0 | 434 | $MULTU $t0,$t0 |
| 437 | $LD $t2,$BNSZ($a1) | 435 | $LD $t2,$BNSZ($a1) |
| 438 | $LD $ta0,2*$BNSZ($a1) | 436 | $LD $ta0,2*$BNSZ($a1) |
| @@ -463,11 +461,10 @@ $code.=<<___; | |||
| 463 | mflo $ta3 | 461 | mflo $ta3 |
| 464 | mfhi $ta2 | 462 | mfhi $ta2 |
| 465 | $ST $ta3,-2*$BNSZ($a0) | 463 | $ST $ta3,-2*$BNSZ($a0) |
| 466 | $ST $ta2,-$BNSZ($a0) | ||
| 467 | 464 | ||
| 468 | .set noreorder | 465 | .set noreorder |
| 469 | bgtzl $ta0,.L_bn_sqr_words_loop | 466 | bgtz $ta0,.L_bn_sqr_words_loop |
| 470 | $LD $t0,0($a1) | 467 | $ST $ta2,-$BNSZ($a0) |
| 471 | 468 | ||
| 472 | beqz $a2,.L_bn_sqr_words_return | 469 | beqz $a2,.L_bn_sqr_words_return |
| 473 | nop | 470 | nop |
| @@ -547,10 +544,10 @@ $code.=<<___; | |||
| 547 | .set reorder | 544 | .set reorder |
| 548 | li $minus4,-4 | 545 | li $minus4,-4 |
| 549 | and $at,$a3,$minus4 | 546 | and $at,$a3,$minus4 |
| 550 | $LD $t0,0($a1) | ||
| 551 | beqz $at,.L_bn_add_words_tail | 547 | beqz $at,.L_bn_add_words_tail |
| 552 | 548 | ||
| 553 | .L_bn_add_words_loop: | 549 | .L_bn_add_words_loop: |
| 550 | $LD $t0,0($a1) | ||
| 554 | $LD $ta0,0($a2) | 551 | $LD $ta0,0($a2) |
| 555 | subu $a3,4 | 552 | subu $a3,4 |
| 556 | $LD $t1,$BNSZ($a1) | 553 | $LD $t1,$BNSZ($a1) |
| @@ -589,11 +586,10 @@ $code.=<<___; | |||
| 589 | $ADDU $t3,$ta3,$v0 | 586 | $ADDU $t3,$ta3,$v0 |
| 590 | sltu $v0,$t3,$ta3 | 587 | sltu $v0,$t3,$ta3 |
| 591 | $ST $t3,-$BNSZ($a0) | 588 | $ST $t3,-$BNSZ($a0) |
| 592 | $ADDU $v0,$t9 | ||
| 593 | 589 | ||
| 594 | .set noreorder | 590 | .set noreorder |
| 595 | bgtzl $at,.L_bn_add_words_loop | 591 | bgtz $at,.L_bn_add_words_loop |
| 596 | $LD $t0,0($a1) | 592 | $ADDU $v0,$t9 |
| 597 | 593 | ||
| 598 | beqz $a3,.L_bn_add_words_return | 594 | beqz $a3,.L_bn_add_words_return |
| 599 | nop | 595 | nop |
| @@ -679,10 +675,10 @@ $code.=<<___; | |||
| 679 | .set reorder | 675 | .set reorder |
| 680 | li $minus4,-4 | 676 | li $minus4,-4 |
| 681 | and $at,$a3,$minus4 | 677 | and $at,$a3,$minus4 |
| 682 | $LD $t0,0($a1) | ||
| 683 | beqz $at,.L_bn_sub_words_tail | 678 | beqz $at,.L_bn_sub_words_tail |
| 684 | 679 | ||
| 685 | .L_bn_sub_words_loop: | 680 | .L_bn_sub_words_loop: |
| 681 | $LD $t0,0($a1) | ||
| 686 | $LD $ta0,0($a2) | 682 | $LD $ta0,0($a2) |
| 687 | subu $a3,4 | 683 | subu $a3,4 |
| 688 | $LD $t1,$BNSZ($a1) | 684 | $LD $t1,$BNSZ($a1) |
| @@ -722,11 +718,10 @@ $code.=<<___; | |||
| 722 | $SUBU $t3,$ta3,$v0 | 718 | $SUBU $t3,$ta3,$v0 |
| 723 | sgtu $v0,$t3,$ta3 | 719 | sgtu $v0,$t3,$ta3 |
| 724 | $ST $t3,-$BNSZ($a0) | 720 | $ST $t3,-$BNSZ($a0) |
| 725 | $ADDU $v0,$t9 | ||
| 726 | 721 | ||
| 727 | .set noreorder | 722 | .set noreorder |
| 728 | bgtzl $at,.L_bn_sub_words_loop | 723 | bgtz $at,.L_bn_sub_words_loop |
| 729 | $LD $t0,0($a1) | 724 | $ADDU $v0,$t9 |
| 730 | 725 | ||
| 731 | beqz $a3,.L_bn_sub_words_return | 726 | beqz $a3,.L_bn_sub_words_return |
| 732 | nop | 727 | nop |
| @@ -819,7 +814,7 @@ ___ | |||
| 819 | $code.=<<___; | 814 | $code.=<<___; |
| 820 | .set reorder | 815 | .set reorder |
| 821 | move $ta3,$ra | 816 | move $ta3,$ra |
| 822 | bal bn_div_words | 817 | bal bn_div_words_internal |
| 823 | move $ra,$ta3 | 818 | move $ra,$ta3 |
| 824 | $MULTU $ta2,$v0 | 819 | $MULTU $ta2,$v0 |
| 825 | $LD $t2,-2*$BNSZ($a3) | 820 | $LD $t2,-2*$BNSZ($a3) |
| @@ -840,8 +835,9 @@ $code.=<<___; | |||
| 840 | sltu $ta0,$a1,$a2 | 835 | sltu $ta0,$a1,$a2 |
| 841 | or $t8,$ta0 | 836 | or $t8,$ta0 |
| 842 | .set noreorder | 837 | .set noreorder |
| 843 | beqzl $at,.L_bn_div_3_words_inner_loop | 838 | beqz $at,.L_bn_div_3_words_inner_loop |
| 844 | $SUBU $v0,1 | 839 | $SUBU $v0,1 |
| 840 | $ADDU $v0,1 | ||
| 845 | .set reorder | 841 | .set reorder |
| 846 | .L_bn_div_3_words_inner_loop_done: | 842 | .L_bn_div_3_words_inner_loop_done: |
| 847 | .set noreorder | 843 | .set noreorder |
| @@ -902,7 +898,8 @@ $code.=<<___; | |||
| 902 | and $t2,$a0 | 898 | and $t2,$a0 |
| 903 | $SRL $at,$a1,$t1 | 899 | $SRL $at,$a1,$t1 |
| 904 | .set noreorder | 900 | .set noreorder |
| 905 | bnezl $t2,.+8 | 901 | beqz $t2,.+12 |
| 902 | nop | ||
| 906 | break 6 # signal overflow | 903 | break 6 # signal overflow |
| 907 | .set reorder | 904 | .set reorder |
| 908 | $SLL $a0,$t9 | 905 | $SLL $a0,$t9 |
| @@ -917,7 +914,8 @@ $code.=<<___; | |||
| 917 | $SRL $DH,$a2,4*$BNSZ # bits | 914 | $SRL $DH,$a2,4*$BNSZ # bits |
| 918 | sgeu $at,$a0,$a2 | 915 | sgeu $at,$a0,$a2 |
| 919 | .set noreorder | 916 | .set noreorder |
| 920 | bnezl $at,.+8 | 917 | beqz $at,.+12 |
| 918 | nop | ||
| 921 | $SUBU $a0,$a2 | 919 | $SUBU $a0,$a2 |
| 922 | .set reorder | 920 | .set reorder |
| 923 | 921 | ||
diff --git a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl index 54aeb01921..bfd6e97541 100644 --- a/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl +++ b/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl | |||
| @@ -68,7 +68,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
| 68 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 68 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
| 69 | die "can't locate x86_64-xlate.pl"; | 69 | die "can't locate x86_64-xlate.pl"; |
| 70 | 70 | ||
| 71 | open STDOUT,"| $^X $xlate $flavour $output"; | 71 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
| 72 | *STDOUT=*OUT; | ||
| 72 | 73 | ||
| 73 | use strict; | 74 | use strict; |
| 74 | my $code=".text\n\n"; | 75 | my $code=".text\n\n"; |
diff --git a/src/lib/libcrypto/bn/asm/parisc-mont.pl b/src/lib/libcrypto/bn/asm/parisc-mont.pl index 4a766a87fb..c02ef6f014 100644 --- a/src/lib/libcrypto/bn/asm/parisc-mont.pl +++ b/src/lib/libcrypto/bn/asm/parisc-mont.pl | |||
| @@ -40,7 +40,7 @@ | |||
| 40 | # of arithmetic operations, most notably multiplications. It requires | 40 | # of arithmetic operations, most notably multiplications. It requires |
| 41 | # more memory references, most notably to tp[num], but this doesn't | 41 | # more memory references, most notably to tp[num], but this doesn't |
| 42 | # seem to exhaust memory port capacity. And indeed, dedicated PA-RISC | 42 | # seem to exhaust memory port capacity. And indeed, dedicated PA-RISC |
| 43 | # 2.0 code path, provides virtually same performance as pa-risc2[W].s: | 43 | # 2.0 code path provides virtually same performance as pa-risc2[W].s: |
| 44 | # it's ~10% better for shortest key length and ~10% worse for longest | 44 | # it's ~10% better for shortest key length and ~10% worse for longest |
| 45 | # one. | 45 | # one. |
| 46 | # | 46 | # |
| @@ -988,6 +988,8 @@ foreach (split("\n",$code)) { | |||
| 988 | # assemble 2.0 instructions in 32-bit mode... | 988 | # assemble 2.0 instructions in 32-bit mode... |
| 989 | s/^\s+([a-z]+)([\S]*)\s+([\S]*)/&assemble($1,$2,$3)/e if ($BN_SZ==4); | 989 | s/^\s+([a-z]+)([\S]*)\s+([\S]*)/&assemble($1,$2,$3)/e if ($BN_SZ==4); |
| 990 | 990 | ||
| 991 | s/\bbv\b/bve/gm if ($SIZE_T==8); | ||
| 992 | |||
| 991 | print $_,"\n"; | 993 | print $_,"\n"; |
| 992 | } | 994 | } |
| 993 | close STDOUT; | 995 | close STDOUT; |
diff --git a/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl b/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl index 1658acbbdd..226c66c35e 100644 --- a/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl +++ b/src/lib/libcrypto/bn/asm/x86_64-gf2m.pl | |||
| @@ -31,7 +31,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
| 31 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 31 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
| 32 | die "can't locate x86_64-xlate.pl"; | 32 | die "can't locate x86_64-xlate.pl"; |
| 33 | 33 | ||
| 34 | open STDOUT,"| $^X $xlate $flavour $output"; | 34 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
| 35 | *STDOUT=*OUT; | ||
| 35 | 36 | ||
| 36 | ($lo,$hi)=("%rax","%rdx"); $a=$lo; | 37 | ($lo,$hi)=("%rax","%rdx"); $a=$lo; |
| 37 | ($i0,$i1)=("%rsi","%rdi"); | 38 | ($i0,$i1)=("%rsi","%rdi"); |
diff --git a/src/lib/libcrypto/bn/asm/x86_64-mont.pl b/src/lib/libcrypto/bn/asm/x86_64-mont.pl index 5d79b35e1c..17fb94c84c 100755 --- a/src/lib/libcrypto/bn/asm/x86_64-mont.pl +++ b/src/lib/libcrypto/bn/asm/x86_64-mont.pl | |||
| @@ -40,7 +40,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
| 40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 40 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
| 41 | die "can't locate x86_64-xlate.pl"; | 41 | die "can't locate x86_64-xlate.pl"; |
| 42 | 42 | ||
| 43 | open STDOUT,"| $^X $xlate $flavour $output"; | 43 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
| 44 | *STDOUT=*OUT; | ||
| 44 | 45 | ||
| 45 | # int bn_mul_mont( | 46 | # int bn_mul_mont( |
| 46 | $rp="%rdi"; # BN_ULONG *rp, | 47 | $rp="%rdi"; # BN_ULONG *rp, |
diff --git a/src/lib/libcrypto/bn/asm/x86_64-mont5.pl b/src/lib/libcrypto/bn/asm/x86_64-mont5.pl index 057cda28aa..dae0fe2453 100755 --- a/src/lib/libcrypto/bn/asm/x86_64-mont5.pl +++ b/src/lib/libcrypto/bn/asm/x86_64-mont5.pl | |||
| @@ -28,7 +28,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
| 28 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 28 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
| 29 | die "can't locate x86_64-xlate.pl"; | 29 | die "can't locate x86_64-xlate.pl"; |
| 30 | 30 | ||
| 31 | open STDOUT,"| $^X $xlate $flavour $output"; | 31 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
| 32 | *STDOUT=*OUT; | ||
| 32 | 33 | ||
| 33 | # int bn_mul_mont_gather5( | 34 | # int bn_mul_mont_gather5( |
| 34 | $rp="%rdi"; # BN_ULONG *rp, | 35 | $rp="%rdi"; # BN_ULONG *rp, |
| @@ -900,8 +901,8 @@ $code.=<<___; | |||
| 900 | jnz .Lgather | 901 | jnz .Lgather |
| 901 | ___ | 902 | ___ |
| 902 | $code.=<<___ if ($win64); | 903 | $code.=<<___ if ($win64); |
| 903 | movaps %xmm6,(%rsp) | 904 | movaps (%rsp),%xmm6 |
| 904 | movaps %xmm7,0x10(%rsp) | 905 | movaps 0x10(%rsp),%xmm7 |
| 905 | lea 0x28(%rsp),%rsp | 906 | lea 0x28(%rsp),%rsp |
| 906 | ___ | 907 | ___ |
| 907 | $code.=<<___; | 908 | $code.=<<___; |
