Fix the error handling in ERR_get_state:
[oweals/openssl.git] / crypto / bn / asm / ia64-mont.pl
index 1f7c0a1b713b531c9fdbd6e135a6de24785b29ff..5cc5c599f9dead3436450d23c735cbcdd4901247 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 #
 # ====================================================================
 # Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
@@ -60,6 +67,8 @@
 # hereafter less for longer keys, while verify - by 74-13%.
 # DSA performance improves by 115-30%.
 
+$output=pop;
+
 if ($^O eq "hpux") {
     $ADDP="addp4";
     for (@ARGV) { $ADDP="add" if (/[\+DD|\-mlp]64/); }
@@ -72,9 +81,9 @@ $code=<<___;
 // int bn_mul_mont (BN_ULONG *rp,const BN_ULONG *ap,
 //                 const BN_ULONG *bp,const BN_ULONG *np,
 //                 const BN_ULONG *n0p,int num);                       
+.align 64
 .global        bn_mul_mont#
 .proc  bn_mul_mont#
-.align 64;;
 bn_mul_mont:
        .prologue
        .body
@@ -99,9 +108,9 @@ n0=f6;
 m0=f7;
 bi=f8;
 
+.align 64
 .local bn_mul_mont_general#
 .proc  bn_mul_mont_general#
-.align 64;;
 bn_mul_mont_general:
        .prologue
 { .mmi;        .save   ar.pfs,prevfs
@@ -353,7 +362,7 @@ bn_mul_mont_general:
        mov             ar.lc=prevlc    }
 { .mib;        .restore        sp
        mov             sp=prevsp
-       mov             pr=prevpr,-2
+       mov             pr=prevpr,0x1ffff
        br.ret.sptk.many        b0      };;
 .endp  bn_mul_mont_general#
 \f
@@ -364,10 +373,10 @@ t0=r15;
 ai0=f8;  ai1=f9;  ai2=f10; ai3=f11; ai4=f12; ai5=f13; ai6=f14; ai7=f15;
 ni0=f16; ni1=f17; ni2=f18; ni3=f19; ni4=f20; ni5=f21; ni6=f22; ni7=f23;
 
+.align 64
+.skip  48              // aligns loop body
 .local bn_mul_mont_8#
 .proc  bn_mul_mont_8#
-.align 64
-.skip  48;;            // aligns loop body
 bn_mul_mont_8:
        .prologue
 { .mmi;        .save           ar.pfs,prevfs
@@ -828,7 +837,7 @@ bn_mul_mont_8:
        nop.i           0               }
 { .mmi;        ldf.fill        f18=[r18],64
        ldf.fill        f19=[r19],64
-       mov             pr=prevpr,-2    };;
+       mov             pr=prevpr,0x1ffff       };;
 { .mmi;        ldf.fill        f20=[r16]
        ldf.fill        f21=[r17]
        mov             ar.lc=prevlc    }
@@ -846,6 +855,6 @@ copyright:
 stringz        "Montgomery multiplication for IA-64, CRYPTOGAMS by <appro\@openssl.org>"
 ___
 
-$output=shift and open STDOUT,">$output";
+open STDOUT,">$output" if $output;
 print $code;
 close STDOUT;