Commit 29fd6746 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

armv4cpuid.S, armv4-gf2m.pl: make newest code compilable by older assembler.

parent e879dd43
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -44,7 +44,7 @@ OPENSSL_atomic_add:
	bne	.Lspin
	bne	.Lspin


	ldr	r2,[r4]
	ldr	r2,[r4]
	add	r2,r5
	add	r2,r2,r5
	str	r2,[r4]
	str	r2,[r4]
	str	r0,[r6]		@ release spinlock
	str	r0,[r6]		@ release spinlock
	ldmia	sp!,{r4-r6,lr}
	ldmia	sp!,{r4-r6,lr}
@@ -59,26 +59,26 @@ OPENSSL_atomic_add:
OPENSSL_cleanse:
OPENSSL_cleanse:
	eor	ip,ip,ip
	eor	ip,ip,ip
	cmp	r1,#7
	cmp	r1,#7
	subhs	r1,#4
	subhs	r1,r1,#4
	bhs	.Lot
	bhs	.Lot
	cmp	r1,#0
	cmp	r1,#0
	beq	.Lcleanse_done
	beq	.Lcleanse_done
.Little:
.Little:
	strb	ip,[r0],#1
	strb	ip,[r0],#1
	subs	r1,#1
	subs	r1,r1,#1
	bhi	.Little
	bhi	.Little
	b	.Lcleanse_done
	b	.Lcleanse_done


.Lot:	tst	r0,#3
.Lot:	tst	r0,#3
	beq	.Laligned
	beq	.Laligned
	strb	ip,[r0],#1
	strb	ip,[r0],#1
	sub	r1,#1
	sub	r1,r1,#1
	b	.Lot
	b	.Lot
.Laligned:
.Laligned:
	str	ip,[r0],#4
	str	ip,[r0],#4
	subs	r1,#4
	subs	r1,r1,#4
	bhs	.Laligned
	bhs	.Laligned
	adds	r1,#4
	adds	r1,r1,#4
	bne	.Little
	bne	.Little
.Lcleanse_done:
.Lcleanse_done:
	tst	lr,#1
	tst	lr,#1
+17 −17
Original line number Original line Diff line number Diff line
@@ -218,38 +218,38 @@ $code.=<<___;
	mov	$b,r3			@ $b=b1
	mov	$b,r3			@ $b=b1
	ldr	r3,[sp,#32]		@ load b0
	ldr	r3,[sp,#32]		@ load b0
	mov	$mask,#7<<2
	mov	$mask,#7<<2
	sub	sp,#32			@ allocate tab[8]
	sub	sp,sp,#32		@ allocate tab[8]


	bl	mul_1x1_ialu		@ a1b1
	bl	mul_1x1_ialu		@ a1b1
	str	$lo,[$ret,#8]
	str	$lo,[$ret,#8]
	str	$hi,[$ret,#12]
	str	$hi,[$ret,#12]


	eor	$b,r3			@ flip b0 and b1
	eor	$b,$b,r3		@ flip b0 and b1
	 eor	$a,r2			@ flip a0 and a1
	 eor	$a,$a,r2		@ flip a0 and a1
	eor	r3,$b
	eor	r3,r3,$b
	 eor	r2,$a
	 eor	r2,r2,$a
	eor	$b,r3
	eor	$b,$b,r3
	 eor	$a,r2
	 eor	$a,$a,r2
	bl	mul_1x1_ialu		@ a0b0
	bl	mul_1x1_ialu		@ a0b0
	str	$lo,[$ret]
	str	$lo,[$ret]
	str	$hi,[$ret,#4]
	str	$hi,[$ret,#4]


	eor	$a,r2
	eor	$a,$a,r2
	eor	$b,r3
	eor	$b,$b,r3
	bl	mul_1x1_ialu		@ (a1+a0)(b1+b0)
	bl	mul_1x1_ialu		@ (a1+a0)(b1+b0)
___
___
@r=map("r$_",(6..9));
@r=map("r$_",(6..9));
$code.=<<___;
$code.=<<___;
	ldmia	$ret,{@r[0]-@r[3]}
	ldmia	$ret,{@r[0]-@r[3]}
	eor	$lo,$hi
	eor	$lo,$lo,$hi
	eor	$hi,@r[1]
	eor	$hi,$hi,@r[1]
	eor	$lo,@r[0]
	eor	$lo,$lo,@r[0]
	eor	$hi,@r[2]
	eor	$hi,$hi,@r[2]
	eor	$lo,@r[3]
	eor	$lo,$lo,@r[3]
	eor	$hi,@r[3]
	eor	$hi,$hi,@r[3]
	str	$hi,[$ret,#8]
	str	$hi,[$ret,#8]
	eor	$lo,$hi
	eor	$lo,$lo,$hi
	add	sp,#32			@ destroy tab[8]
	add	sp,sp,#32		@ destroy tab[8]
	str	$lo,[$ret,#4]
	str	$lo,[$ret,#4]


#if __ARM_ARCH__>=5
#if __ARM_ARCH__>=5