aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mips/mips64
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-03-21 21:39:39 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-03-21 21:39:39 +0000
commit8f9fb0000e345b16902311b2d265f83b329e69c5 (patch)
tree1c095c4ab887f251889e9fc001d38272d3bce5e0 /sysdeps/mips/mips64
parent88b3f3ede294499cef1cb36cc6a5f4662d205e9d (diff)
downloadglibc-8f9fb0000e345b16902311b2d265f83b329e69c5.tar
glibc-8f9fb0000e345b16902311b2d265f83b329e69c5.tar.gz
glibc-8f9fb0000e345b16902311b2d265f83b329e69c5.tar.bz2
glibc-8f9fb0000e345b16902311b2d265f83b329e69c5.zip
* sysdeps/mips/mips64/memcpy.S: Fix porting bug that broke unaligned copying of 8-15 bytes. From Chris Demetriou <cgd@broadcom.com>. Fix label names. * sysdeps/mips/mips64/memset.S: Fix label names. Make similar change as to memcpy.S. * sysdeps/mips/memcpy.S: Formatting changes. * sysdeps/mips/memset.S: Likewise.
2003-03-21 Alexandre Oliva <aoliva@redhat.com> * sysdeps/mips/mips64/memcpy.S: Fix porting bug that broke unaligned copying of 8-15 bytes. From Chris Demetriou <cgd@broadcom.com>. Fix label names. * sysdeps/mips/mips64/memset.S: Fix label names. Make similar change as to memcpy.S. * sysdeps/mips/memcpy.S: Formatting changes. * sysdeps/mips/memset.S: Likewise.
Diffstat (limited to 'sysdeps/mips/mips64')
-rw-r--r--sysdeps/mips/mips64/memcpy.S30
-rw-r--r--sysdeps/mips/mips64/memset.S16
2 files changed, 23 insertions, 23 deletions
diff --git a/sysdeps/mips/mips64/memcpy.S b/sysdeps/mips/mips64/memcpy.S
index 3dbb31f49a..c4ba7a8f51 100644
--- a/sysdeps/mips/mips64/memcpy.S
+++ b/sysdeps/mips/mips64/memcpy.S
@@ -42,8 +42,8 @@
ENTRY (memcpy)
.set noreorder
- slti a4, a2, 8 # Less than 8?
- bne a4, zero, L(last8)
+ slti a4, a2, 16 # Less than 16?
+ bne a4, zero, L(last16)
move v0, a0 # Setup exit value before too late
xor a4, a1, a0 # Find a0/a1 displacement
@@ -86,53 +86,53 @@ L(lop8w):
sd t7, -8(a0)
L(chk1w):
- andi a4, a2, 0x7 # 4 or more bytes left?
- beq a4, a2, L(last8)
- PTR_SUBU a3, a2, a4 # Yes, handle them one word at a time
+ andi a4, a2, 0x7 # 8 or more bytes left?
+ beq a4, a2, L(last16)
+ PTR_SUBU a3, a2, a4 # Yes, handle them one dword at a time
PTR_ADDU a3, a1 # a3 again end address
move a2, a4
-L(lop1w):
+L(lop1w):
ld a4, 0(a1)
PTR_ADDIU a0, 8
PTR_ADDIU a1, 8
bne a1, a3, L(lop1w)
sd a4, -8(a0)
-L(last8):
- blez a2, L(lst8e) # Handle last 8 bytes, one at a time
+L(last16):
+ blez a2, L(lst16e) # Handle last 16 bytes, one at a time
PTR_ADDU a3, a2, a1
-L(lst8l):
+L(lst16l):
lb a4, 0(a1)
PTR_ADDIU a0, 1
PTR_ADDIU a1, 1
- bne a1, a3, L(lst8l)
+ bne a1, a3, L(lst16l)
sb a4, -1(a0)
-L(lst8e):
+L(lst16e):
jr ra # Bye, bye
nop
L(shift):
PTR_SUBU a3, zero, a0 # Src and Dest unaligned
andi a3, 0x7 # (unoptimized case...)
- beq a3, zero, L(shfa5)
+ beq a3, zero, L(shft1)
PTR_SUBU a2, a3 # a2 = bytes left
LDHI a4, 0(a1) # Take care of first odd part
LDLO a4, 7(a1)
PTR_ADDU a1, a3
SDHI a4, 0(a0)
PTR_ADDU a0, a3
-L(shfa5):
+L(shft1):
andi a4, a2, 0x7
PTR_SUBU a3, a2, a4
PTR_ADDU a3, a1
L(shfth):
- LDHI a5, 0(a1) # Limp through, word by word
+ LDHI a5, 0(a1) # Limp through, dword by dword
LDLO a5, 7(a1)
PTR_ADDIU a0, 8
PTR_ADDIU a1, 8
bne a1, a3, L(shfth)
sd a5, -8(a0)
- b L(last8) # Handle anything which may be left
+ b L(last16) # Handle anything which may be left
move a2, a4
.set reorder
diff --git a/sysdeps/mips/mips64/memset.S b/sysdeps/mips/mips64/memset.S
index 6a3b154bad..d6e1790fbe 100644
--- a/sysdeps/mips/mips64/memset.S
+++ b/sysdeps/mips/mips64/memset.S
@@ -36,8 +36,8 @@
ENTRY (memset)
.set noreorder
- slti t5, a2, 8 # Less than 8?
- bne t5, zero, L(last8)
+ slti t5, a2, 16 # Less than 16?
+ bne t5, zero, L(last16)
move v0, a0 # Setup exit value before too late
beq a1, zero, L(ueven) # If zero pattern, no need to extend
@@ -64,24 +64,24 @@ L(chkw):
PTR_ADDU a3, a0 # a3 is last loop address +1
move a2, t4 # a2 is now # of bytes left after loop
L(loopw):
- PTR_ADDIU a0, 16 # Handle 2 words pr. iteration
+ PTR_ADDIU a0, 16 # Handle 2 dwords pr. iteration
sd a1, -16(a0)
bne a0, a3, L(loopw)
sd a1, -8(a0)
L(chkl):
andi t4, a2, 0x8 # Check if there is at least a double
- beq t4, zero, L(last8) # word remaining after the loop
+ beq t4, zero, L(last16) # word remaining after the loop
PTR_SUBU a2, t4
sd a1, 0(a0) # Yes...
PTR_ADDIU a0, 8
-L(last8):
- blez a2, L(exit) # Handle last 8 bytes (if cnt>0)
+L(last16):
+ blez a2, L(exit) # Handle last 16 bytes (if cnt>0)
PTR_ADDU a3, a2, a0 # a3 is last address +1
-L(lst8l):
+L(lst16l):
PTR_ADDIU a0, 1
- bne a0, a3, L(lst8l)
+ bne a0, a3, L(lst16l)
sb a1, -1(a0)
L(exit):
j ra # Bye, bye