alpha-mont.pl: gcc portability fix and make-rule.
[openssl.git] / crypto / bn / asm / sparcv8plus.S
index 0074dfdb750e3ae9846a79dd114861577b952657..63de1860f2850ed50d7507d1f2df00f0e36bc038 100644 (file)
  *         }
  */
 
+#if defined(__SUNPRO_C) && defined(__sparcv9)
+  /* They've said -xarch=v9 at command line */
+  .register    %g2,#scratch
+  .register    %g3,#scratch
+# define       FRAME_SIZE      -192
+#elif defined(__GNUC__) && defined(__arch64__)
+  /* They've said -m64 at command line */
+  .register    %g2,#scratch
+  .register    %g3,#scratch
+# define       FRAME_SIZE      -192
+#else 
+# define       FRAME_SIZE      -96
+#endif 
 /*
  * GNU assembler can't stand stuw:-(
  */
  * BN_ULONG w;
  */
 bn_mul_add_words:
+       sra     %o2,%g0,%o2     ! signx %o2
        brgz,a  %o2,.L_bn_mul_add_words_proceed
        lduw    [%o1],%g2
        retl
        clr     %o0
+       nop
+       nop
+       nop
 
 .L_bn_mul_add_words_proceed:
        srl     %o3,%g0,%o3     ! clruw %o3
@@ -260,10 +277,14 @@ bn_mul_add_words:
  * BN_ULONG w;
  */
 bn_mul_words:
+       sra     %o2,%g0,%o2     ! signx %o2
        brgz,a  %o2,.L_bn_mul_words_proceeed
        lduw    [%o1],%g2
        retl
        clr     %o0
+       nop
+       nop
+       nop
 
 .L_bn_mul_words_proceeed:
        srl     %o3,%g0,%o3     ! clruw %o3
@@ -344,10 +365,14 @@ bn_mul_words:
  * int n;
  */
 bn_sqr_words:
+       sra     %o2,%g0,%o2     ! signx %o2
        brgz,a  %o2,.L_bn_sqr_words_proceeed
        lduw    [%o1],%g2
        retl
        clr     %o0
+       nop
+       nop
+       nop
 
 .L_bn_sqr_words_proceeed:
        andcc   %o2,-4,%g0
@@ -445,6 +470,7 @@ bn_div_words:
  * int n;
  */
 bn_add_words:
+       sra     %o3,%g0,%o3     ! signx %o3
        brgz,a  %o3,.L_bn_add_words_proceed
        lduw    [%o1],%o4
        retl
@@ -454,7 +480,6 @@ bn_add_words:
        andcc   %o3,-4,%g0
        bz,pn   %icc,.L_bn_add_words_tail
        addcc   %g0,0,%g0       ! clear carry flag
-       nop
 
 .L_bn_add_words_loop:          ! wow! 32 aligned!
        dec     4,%o3
@@ -523,6 +548,7 @@ bn_add_words:
  * int n;
  */
 bn_sub_words:
+       sra     %o3,%g0,%o3     ! signx %o3
        brgz,a  %o3,.L_bn_sub_words_proceed
        lduw    [%o1],%o4
        retl
@@ -532,7 +558,6 @@ bn_sub_words:
        andcc   %o3,-4,%g0
        bz,pn   %icc,.L_bn_sub_words_tail
        addcc   %g0,0,%g0       ! clear carry flag
-       nop
 
 .L_bn_sub_words_loop:          ! wow! 32 aligned!
        dec     4,%o3
@@ -607,8 +632,6 @@ bn_sub_words:
  *                                                     Andy.
  */
 
-#define FRAME_SIZE     -96
-
 /*
  * Here is register usage map for *all* routines below.
  */