Detlef Schmier wrote:
> 
> Hello,
> 
> I try to compile openssl-0.9.2b on "Digital UNIX V4.0E (Rev. 1091)" using
> the normal C-compiler.
> 
> Make stops to load openssl after all libraries are compiled:
> 

> ld:
> Unresolved:
> bn_div_words
> *** Exit 1
> Stop.

> 
> Please advice
> 

There are three options to solve this:
1. pass no-asm to ./Configure,
2. patch asm/alpha.s to include bn_div_words, or,
3. start with 2 above, then find an axp guru and optimize things.

In case you take the third way, please send us the results :)

I'll include the original article from Holger Reiff who submitted
the patch, and, the patch itself:
----------------
Date: Tue, 23 Mar 1999 10:37:28 +0000
From: Hannes Reinecke <[EMAIL PROTECTED]>
Organization: Heriot Watt University, Edinburgh
To: OpenSSL developer list <[EMAIL PROTECTED]>
Subject: Patch: BN_div_words in asm/alpha.s
Reply-To: [EMAIL PROTECTED]

Hi all,

here is a patch for adding bn_div_words to asm/alpha.s. It got lost
somehow, but without the assembler version won't compile.

I'm not entirely familiar with the internal working of openssl, but to
my untrained eye bn_asm.c:bn_div_words and bn_mulw.c:bn_div64 are
looking suspiciously similar. Is there a special reason for it or can we
just scrap one version ?
(I suspect that's also why bn_div_words does not appear in asm/alpha.s;
it just got renamed to bn_div64 hoping that all functions would call
this and not bn_div_words. Evolutionary programming :-).

HTH,

Hannes
-- 
Hannes Reinecke                                 <[EMAIL PROTECTED]>
Fluid Loading and Instrumentation Center        Tel: (+44) 131 451 3149
Dept. of Civil & Offshore Engineering           Fax: (+44) 131 451 3154
Heriot Watt University, Edinburgh EH14 4AS
----------------

-- 
Niels Poppe - org.net bv <[EMAIL PROTECTED]>
diff -u --recursive openssl-SNAP-19990316-1530/crypto/bn/asm/alpha.s 
openssl.works/crypto/bn/asm/alpha.s
--- openssl-SNAP-19990316-1530/crypto/bn/asm/alpha.s    Mon Dec 21 10:59:03 1998
+++ openssl.works/crypto/bn/asm/alpha.s Sun Mar 21 00:40:33 1999
@@ -530,6 +530,129 @@
 $103:
        ret     $31,($26),1
        .end bn_sub_words
+       .align 5
+       .globl bn_div_words
+       .ent bn_div_words
+bn_div_words:
+       .frame $30,48,$26,0
+       .mask 0x4003e00,-48
+       ldgp $29,0($27)
+bn_div_words..ng:
+       subq $30,48,$30
+       stq $9,8($30)
+       stq $10,16($30)
+       bis $16,$16,$9
+       stq $11,24($30)
+       bis $17,$17,$10
+       stq $12,32($30)
+       bis $18,$18,$11
+       stq $13,40($30)
+       bis $31,2,$12
+       stq $26,0($30)
+       .prologue 1
+       bis $31,$31,$13
+       bne $11,$236
+       lda $0,-1
+       br $31,$255
+$236:
+       bis $11,$11,$16
+       jsr $26,BN_num_bits_word
+       ldgp $29,0($26)
+       cmpeq $0,64,$1
+       bne $1,$237
+       bis $31,1,$1
+       sll $1,$0,$1
+       cmpule $9,$1,$1
+       bne $1,$237
+       jsr $26,abort
+       ldgp $29,0($26)
+$237:
+       bis $31,64,$4
+       cmpult $9,$11,$1
+       subq $4,$0,$3
+       subq $9,$11,$2
+       cmoveq $1,$2,$9
+       addl $3,$31,$0
+       beq $0,$239
+       subq $4,$0,$1
+       srl $10,$1,$1
+       sll $9,$0,$2
+       sll $10,$0,$10
+       bis $2,$1,$9
+       sll $11,$0,$11
+$239:
+       srl $11,32,$7
+       zapnot $11,15,$8
+       lda $22,-1
+       br $31,$240
+       .align 4
+$253:
+       srl $10,32,$1
+       sll $9,32,$2
+       sll $27,32,$13
+       bis $2,$1,$9
+       sll $10,32,$10
+$240:
+       srl $9,32,$1
+       cmpeq $1,$7,$1
+       beq $1,$243
+       zapnot $22,15,$27
+       br $31,$244
+$243:
+       bis $9,$9,$24
+       bis $7,$7,$25
+       divqu $24,$25,$27
+$244:
+       mulq $27,$7,$5
+       subq $9,$5,$3
+       zapnot $3,240,$2
+       bne $2,$246
+       mulq $8,$27,$4
+       zapnot $10,240,$1
+       sll $3,32,$2
+       bis $1,$1,$6
+       br $31,$256
+       .align 4
+$248:
+       subq $27,1,$27
+       mulq $27,$7,$5
+       subq $9,$5,$3
+       zapnot $3,240,$2
+       bne $2,$246
+       mulq $8,$27,$4
+       sll $3,32,$2
+$256:
+       srl $6,32,$1
+       addq $2,$1,$1
+       cmpule $4,$1,$1
+       beq $1,$248
+$246:
+       mulq $27,$8,$1
+       srl $1,32,$3
+       sll $1,32,$1
+       addq $5,$3,$4
+       cmpult $10,$1,$3
+       subq $10,$1,$10
+       addq $4,$3,$4
+       cmpult $9,$4,$2
+       beq $2,$252
+       addq $9,$11,$9
+       subq $27,1,$27
+$252:
+       subq $9,$4,$9
+       subl $12,1,$12
+       bne $12,$253
+       bis $13,$27,$0
+$255:
+       ldq $26,0($30)
+       ldq $9,8($30)
+       ldq $10,16($30)
+       ldq $11,24($30)
+       ldq $12,32($30)
+       ldq $13,40($30)
+       addq $30,48,$30
+       ret $31,($26),1
+       .end bn_div_words
        .text
        .align 3
        .globl bn_mul_comba4

Reply via email to