svn commit: r205779 - user/jmallett/octeon/sys/mips/mips

Juli Mallett jmallett at FreeBSD.org
Sat Mar 27 23:57:39 UTC 2010


Author: jmallett
Date: Sat Mar 27 23:57:38 2010
New Revision: 205779
URL: http://svn.freebsd.org/changeset/base/205779

Log:
  Don't truncate some pointers and sizes that are mixed with pointers.

Modified:
  user/jmallett/octeon/sys/mips/mips/support.S

Modified: user/jmallett/octeon/sys/mips/mips/support.S
==============================================================================
--- user/jmallett/octeon/sys/mips/mips/support.S	Sat Mar 27 23:53:47 2010	(r205778)
+++ user/jmallett/octeon/sys/mips/mips/support.S	Sat Mar 27 23:57:38 2010	(r205779)
@@ -887,26 +887,26 @@ LEAF(bzero)
 ALEAF(blkclr)
 	.set	noreorder
 	blt	a1, 12, smallclr	# small amount to clear?
-	subu	a3, zero, a0		# compute # bytes to word align address
+	PTR_SUBU	a3, zero, a0		# compute # bytes to word align address
 	and	a3, a3, 3
 	beq	a3, zero, 1f		# skip if word aligned
-	subu	a1, a1, a3		# subtract from remaining count
+	PTR_SUBU	a1, a1, a3		# subtract from remaining count
 	SWHI	zero, 0(a0)		# clear 1, 2, or 3 bytes to align
-	addu	a0, a0, a3
+	PTR_ADDU	a0, a0, a3
 1:
 	and	v0, a1, 3		# compute number of words left
-	subu	a3, a1, v0
+	PTR_SUBU	a3, a1, v0
 	move	a1, v0
-	addu	a3, a3, a0		# compute ending address
+	PTR_ADDU	a3, a3, a0		# compute ending address
 2:
-	addu	a0, a0, 4		# clear words
+	PTR_ADDU	a0, a0, 4		# clear words
 	bne	a0, a3, 2b		#  unrolling loop does not help
 	sw	zero, -4(a0)		#  since we are limited by memory speed
 smallclr:
 	ble	a1, zero, 2f
-	addu	a3, a1, a0		# compute ending address
+	PTR_ADDU	a3, a1, a0		# compute ending address
 1:
-	addu	a0, a0, 1		# clear bytes
+	PTR_ADDU	a0, a0, 1		# clear bytes
 	bne	a0, a3, 1b
 	sb	zero, -1(a0)
 2:
@@ -923,66 +923,66 @@ LEAF(bcmp)
 	blt	a2, 16, smallcmp	# is it worth any trouble?
 	xor	v0, a0, a1		# compare low two bits of addresses
 	and	v0, v0, 3
-	subu	a3, zero, a1		# compute # bytes to word align address
+	PTR_SUBU	a3, zero, a1		# compute # bytes to word align address
 	bne	v0, zero, unalignedcmp	# not possible to align addresses
 	and	a3, a3, 3
 
 	beq	a3, zero, 1f
-	subu	a2, a2, a3		# subtract from remaining count
+	PTR_SUBU	a2, a2, a3		# subtract from remaining count
 	move	v0, v1			# init v0,v1 so unmodified bytes match
 	LWHI	v0, 0(a0)		# read 1, 2, or 3 bytes
 	LWHI	v1, 0(a1)
-	addu	a1, a1, a3
+	PTR_ADDU	a1, a1, a3
 	bne	v0, v1, nomatch
-	addu	a0, a0, a3
+	PTR_ADDU	a0, a0, a3
 1:
 	and	a3, a2, ~3		# compute number of whole words left
-	subu	a2, a2, a3		#   which has to be >= (16-3) & ~3
-	addu	a3, a3, a0		# compute ending address
+	PTR_SUBU	a2, a2, a3		#   which has to be >= (16-3) & ~3
+	PTR_ADDU	a3, a3, a0		# compute ending address
 2:
 	lw	v0, 0(a0)		# compare words
 	lw	v1, 0(a1)
-	addu	a0, a0, 4
+	PTR_ADDU	a0, a0, 4
 	bne	v0, v1, nomatch
-	addu	a1, a1, 4
+	PTR_ADDU	a1, a1, 4
 	bne	a0, a3, 2b
 	nop
 	b	smallcmp		# finish remainder
 	nop
 unalignedcmp:
 	beq	a3, zero, 2f
-	subu	a2, a2, a3		# subtract from remaining count
-	addu	a3, a3, a0		# compute ending address
+	PTR_SUBU	a2, a2, a3		# subtract from remaining count
+	PTR_ADDU	a3, a3, a0		# compute ending address
 1:
 	lbu	v0, 0(a0)		# compare bytes until a1 word aligned
 	lbu	v1, 0(a1)
-	addu	a0, a0, 1
+	PTR_ADDU	a0, a0, 1
 	bne	v0, v1, nomatch
-	addu	a1, a1, 1
+	PTR_ADDU	a1, a1, 1
 	bne	a0, a3, 1b
 	nop
 2:
 	and	a3, a2, ~3		# compute number of whole words left
-	subu	a2, a2, a3		#   which has to be >= (16-3) & ~3
-	addu	a3, a3, a0		# compute ending address
+	PTR_SUBU	a2, a2, a3		#   which has to be >= (16-3) & ~3
+	PTR_ADDU	a3, a3, a0		# compute ending address
 3:
 	LWHI	v0, 0(a0)		# compare words a0 unaligned, a1 aligned
 	LWLO	v0, 3(a0)
 	lw	v1, 0(a1)
-	addu	a0, a0, 4
+	PTR_ADDU	a0, a0, 4
 	bne	v0, v1, nomatch
-	addu	a1, a1, 4
+	PTR_ADDU	a1, a1, 4
 	bne	a0, a3, 3b
 	nop
 smallcmp:
 	ble	a2, zero, match
-	addu	a3, a2, a0		# compute ending address
+	PTR_ADDU	a3, a2, a0		# compute ending address
 1:
 	lbu	v0, 0(a0)
 	lbu	v1, 0(a1)
-	addu	a0, a0, 1
+	PTR_ADDU	a0, a0, 1
 	bne	v0, v1, nomatch
-	addu	a1, a1, 1
+	PTR_ADDU	a1, a1, 1
 	bne	a0, a3, 1b
 	nop
 match:


More information about the svn-src-user mailing list