patch-2.4.2 linux/arch/arm/lib/io-writesw-armv4.S

Next file: linux/arch/arm/mach-sa1100/Makefile
Previous file: linux/arch/arm/lib/io-writesw-armv3.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.1/linux/arch/arm/lib/io-writesw-armv4.S linux/arch/arm/lib/io-writesw-armv4.S
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/arm/lib/io-readsb.S
+ *  linux/arch/arm/lib/io-writesw-armv4.S
  *
  *  Copyright (C) 1995-2000 Russell King
  *
@@ -32,11 +32,11 @@
 		tst	r1, #3
 		bne	.outsw_align
 
+		stmfd	sp!, {r4, r5, lr}
+
 		subs	r2, r2, #8
 		bmi	.no_outsw_8
 
-		stmfd	sp!, {r4, r5, lr}
-
 .outsw_8_lp:	ldmia	r1!, {r3, r4, r5, ip}
 
 		strh	r3, [r0]
@@ -54,26 +54,31 @@
 
 		subs	r2, r2, #8
 		bpl	.outsw_8_lp
-		ldmfd	sp!, {r4, r5, lr}
+
 		tst	r2, #7
-		RETINSTR(moveq, pc, lr)
+		LOADREGS(eqfd, sp!, {r4, r5, pc})
 
 .no_outsw_8:	tst	r2, #4
-		ldmneia	r1!, {r3, ip}
-		strneh	r3, [r0]
-		movne	r3, r3, lsr #16
-		strneh	r3, [r0]
-		strneh	ip, [r0]
-		movne	ip, ip, lsr #16
-		strneh	ip, [r0]
-		tst	r2, #2
-		ldrne	r3, [r1], #4
-		strneh	r3, [r0]
-		movne	r3, r3, lsr #16
-		strneh	r3, [r0]
-		tst	r2, #1
+		beq	.no_outsw_4
+
+		ldmia	r1!, {r3, ip}
+		strh	r3, [r0]
+		mov	r3, r3, lsr #16
+		strh	r3, [r0]
+		strh	ip, [r0]
+		mov	ip, ip, lsr #16
+		strh	ip, [r0]
+
+.no_outsw_4:	tst	r2, #2
+		beq	.no_outsw_2
+
+		ldr	r3, [r1], #4
+		strh	r3, [r0]
+		mov	r3, r3, lsr #16
+		strh	r3, [r0]
+
+.no_outsw_2:	tst	r2, #1
 		ldrneh	r3, [r1]
 		strneh	r3, [r0]
-		RETINSTR(mov, pc, lr)
-
 
+		LOADREGS(fd, sp!, {r4, r5, pc})

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)