Minor sparcv9 clean-ups.
authorAndy Polyakov <appro@openssl.org>
Tue, 27 Dec 2005 21:27:39 +0000 (21:27 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 27 Dec 2005 21:27:39 +0000 (21:27 +0000)
crypto/bn/asm/sparcv9-mont.pl
crypto/sparcv9cap.c

index 2e12eeb578e8232fa477cb891404ad21508890b4..acdf6928ca52c1c65b93861364aa90faafcb4e70 100644 (file)
@@ -94,17 +94,17 @@ $fname:
        cmp     $ap,$bp
        and     $num,$mask,$num
        ld      [$bp],$mul0             ! bp[0]
        cmp     $ap,$bp
        and     $num,$mask,$num
        ld      [$bp],$mul0             ! bp[0]
-       be,pt   `$bits==32?"%icc":"%xcc"`,.Lbn_sqr_mont
        nop
 
        add     %sp,$bias,%o7           ! real top of stack
        nop
 
        add     %sp,$bias,%o7           ! real top of stack
-       ld      [$ap],$car0             ! ap[0]
+       ld      [$ap],$car0             ! ap[0] ! redundant in squaring context
        sub     %o7,$num,%o7
        ld      [$ap+4],$apj            ! ap[1]
        and     %o7,-1024,%o7
        ld      [$np],$car1             ! np[0]
        sub     %o7,$bias,%sp           ! alloca
        ld      [$np+4],$npj            ! np[1]
        sub     %o7,$num,%o7
        ld      [$ap+4],$apj            ! ap[1]
        and     %o7,-1024,%o7
        ld      [$np],$car1             ! np[0]
        sub     %o7,$bias,%sp           ! alloca
        ld      [$np+4],$npj            ! np[1]
+       be,pt   `$bits==32?"%icc":"%xcc"`,.Lbn_sqr_mont
        mov     12,$j
 
        mulx    $car0,$mul0,$car0       ! ap[0]*bp[0]
        mov     12,$j
 
        mulx    $car0,$mul0,$car0       ! ap[0]*bp[0]
@@ -306,15 +306,6 @@ $sbit="%i2";               # re-use $bp!
 $code.=<<___;
 .align 32
 .Lbn_sqr_mont:
 $code.=<<___;
 .align 32
 .Lbn_sqr_mont:
-       add     %sp,$bias,%o7                   ! real top of stack
-       ld      [$ap+4],$apj                    ! ap[1]
-       sub     %o7,$num,%o7
-       ld      [$np],$car1                     ! np[0]
-       and     %o7,-1024,%o7
-       ld      [$np+4],$npj                    ! np[1]
-       sub     %o7,$bias,%sp                   ! alloca
-       mov     12,$j
-
        mulx    $mul0,$mul0,$car0               ! ap[0]*ap[0]
        mulx    $apj,$mul0,$tmp0                !prologue!
        and     $car0,$mask,$acc0
        mulx    $mul0,$mul0,$car0               ! ap[0]*ap[0]
        mulx    $apj,$mul0,$tmp0                !prologue!
        and     $car0,$mask,$acc0
index 3330b217462680faf87e9614d81eb2b288ae7938..3ec2340241af11a1d668d70f5ea7ea304438587b 100644 (file)
@@ -55,21 +55,22 @@ static int walk_nodename(di_node_t node, di_node_name_t di_node_name)
 
        /* This is expected to catch all UltraSPARC flavors prior T1 */
        if (!strcmp (name,"SUNW,UltraSPARC") ||
 
        /* This is expected to catch all UltraSPARC flavors prior T1 */
        if (!strcmp (name,"SUNW,UltraSPARC") ||
-           !strncmp(name,"SUNW,UltraSPARC-I",17))
+           !strncmp(name,"SUNW,UltraSPARC-I",17))  /* covers II,III,IV */
                {
                OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU|SPARCV9_VIS1;
 
                {
                OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU|SPARCV9_VIS1;
 
-               /* %tick is privileged only on UltraSPARC-I/II */
+               /* %tick is privileged only on UltraSPARC-I/II, but not IIe */
                if (name[14]!='\0' && name[17]!='\0' && name[18]!='\0')
                        OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
 
                return DI_WALK_TERMINATE;
                }
                if (name[14]!='\0' && name[17]!='\0' && name[18]!='\0')
                        OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
 
                return DI_WALK_TERMINATE;
                }
-       /* This is expected to catch remaining UltraSPARC T1 */
+       /* This is expected to catch remaining UltraSPARCs, such as T1 */
        else if (!strncmp(name,"SUNW,UltraSPARC",15))
                {
        else if (!strncmp(name,"SUNW,UltraSPARC",15))
                {
-               OPENSSL_sparcv9cap_P |= SPARCV9_VIS1;
                OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
                OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
+
+               return DI_WALK_TERMINATE;
                }
 
        return DI_WALK_CONTINUE;
                }
 
        return DI_WALK_CONTINUE;