From: visa Date: Sat, 29 Jan 2022 05:47:36 +0000 (+0000) Subject: Use local symbols in libkern mips64 assembly routines. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=670c052563da293187039c29dc9958a745080cbf;p=openbsd Use local symbols in libkern mips64 assembly routines. OK miod@ --- diff --git a/sys/lib/libkern/arch/mips64/bcmp.S b/sys/lib/libkern/arch/mips64/bcmp.S index 5f5dcd755db..37bd8a7a2f6 100644 --- a/sys/lib/libkern/arch/mips64/bcmp.S +++ b/sys/lib/libkern/arch/mips64/bcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bcmp.S,v 1.4 2004/10/08 14:42:09 pefo Exp $ */ +/* $OpenBSD: bcmp.S,v 1.5 2022/01/29 05:47:36 visa Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -39,11 +39,11 @@ */ LEAF(bcmp, 0) .set noreorder - blt a2, 16, smallcmp # is it worth any trouble? + blt a2, 16, .Lsmallcmp # is it worth any trouble? xor v0, a0, a1 # compare low two bits of addresses and v0, v0, 3 PTR_SUBU a3, zero, a1 # compute # bytes to word align address - bne v0, zero, unalignedcmp # not possible to align addresses + bne v0, zero, .Lunalignedcmp # not possible to align addresses and a3, a3, 3 beq a3, zero, 1f @@ -52,7 +52,7 @@ LEAF(bcmp, 0) LWHI v0, 0(a0) # read 1, 2, or 3 bytes LWHI v1, 0(a1) PTR_ADDU a1, a1, a3 - bne v0, v1, nomatch + bne v0, v1, .Lnomatch PTR_ADDU a0, a0, a3 1: and a3, a2, ~3 # compute number of whole words left @@ -62,13 +62,13 @@ LEAF(bcmp, 0) lw v0, 0(a0) # compare words lw v1, 0(a1) PTR_ADDU a0, a0, 4 - bne v0, v1, nomatch + bne v0, v1, .Lnomatch PTR_ADDU a1, a1, 4 bne a0, a3, 2b nop - b smallcmp # finish remainder + b .Lsmallcmp # finish remainder nop -unalignedcmp: +.Lunalignedcmp: beq a3, zero, 2f PTR_SUBU a2, a2, a3 # subtract from remaining count PTR_ADDU a3, a3, a0 # compute ending address @@ -76,7 +76,7 @@ unalignedcmp: lbu v0, 0(a0) # compare bytes until a1 word aligned lbu v1, 0(a1) PTR_ADDU a0, a0, 1 - bne v0, v1, nomatch + bne v0, v1, .Lnomatch PTR_ADDU a1, a1, 1 bne a0, a3, 1b nop @@ -89,25 +89,25 @@ unalignedcmp: LWLO v0, 3(a0) lw v1, 0(a1) PTR_ADDU a0, a0, 4 - bne v0, v1, nomatch + bne v0, v1, .Lnomatch PTR_ADDU a1, a1, 4 bne a0, a3, 3b nop -smallcmp: - ble a2, zero, match +.Lsmallcmp: + ble a2, zero, .Lmatch PTR_ADDU a3, a2, a0 # compute ending address 1: lbu v0, 0(a0) lbu v1, 0(a1) PTR_ADDU a0, a0, 1 - bne v0, v1, nomatch + bne v0, v1, .Lnomatch PTR_ADDU a1, a1, 1 bne a0, a3, 1b nop -match: +.Lmatch: j ra move v0, zero -nomatch: +.Lnomatch: j ra dli v0, 1 END(bcmp) diff --git a/sys/lib/libkern/arch/mips64/bzero.S b/sys/lib/libkern/arch/mips64/bzero.S index aa2061b3314..4dd53966507 100644 --- a/sys/lib/libkern/arch/mips64/bzero.S +++ b/sys/lib/libkern/arch/mips64/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.6 2004/10/08 14:42:09 pefo Exp $ */ +/* $OpenBSD: bzero.S,v 1.7 2022/01/29 05:47:36 visa Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -41,7 +41,7 @@ LEAF(bzero, 0) ALEAF(blkclr) .set noreorder #ifdef _STANDALONE - blt a1, 12, smallclr # small amount to clear? + blt a1, 12, .Lsmallclr # small amount to clear? PTR_SUBU a3, zero, a0 # compute # bytes to word align address and a3, a3, 3 beq a3, zero, 1f # skip if word aligned @@ -58,7 +58,7 @@ ALEAF(blkclr) bne a0, a3, 2b # unrolling loop does not help sw zero, -4(a0) # since we are limited by memory speed #else - blt a1, 24, smallclr # small amount to clear? + blt a1, 24, .Lsmallclr # small amount to clear? PTR_SUBU a3, zero, a0 # compute # bytes to word align address and a3, a3, 7 beq a3, zero, 1f # skip if word aligned @@ -75,7 +75,7 @@ ALEAF(blkclr) bne a0, a3, 2b # unrolling loop does not help sd zero, -8(a0) # since we are limited by memory speed #endif -smallclr: +.Lsmallclr: ble a1, zero, 2f PTR_ADDU a3, a1, a0 # compute ending address 1: diff --git a/sys/lib/libkern/arch/mips64/memmove.S b/sys/lib/libkern/arch/mips64/memmove.S index 81b0d9868f0..411a187f391 100644 --- a/sys/lib/libkern/arch/mips64/memmove.S +++ b/sys/lib/libkern/arch/mips64/memmove.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memmove.S,v 1.5 2016/11/14 15:02:54 visa Exp $ */ +/* $OpenBSD: memmove.S,v 1.6 2022/01/29 05:47:36 visa Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -49,7 +49,7 @@ LEAF(memcpy, 0) PTR_ADDU t0, a0, a2 # t0 = end of s1 region sltu t1, a1, t0 sltu t2, a0, a1 - j forward # do forward copy + j .Lforward # do forward copy slt t2, a2, 12 # check for small copy ALEAF(memmove) @@ -63,7 +63,7 @@ ALEAF(bcopy) sltu t1, a1, t0 sltu t2, a0, a1 and t1, t1, t2 # t1 = true if from < to < (from+len) - beq t1, zero, forward # non overlapping, do forward copy + beq t1, zero, .Lforward # non overlapping, do forward copy slt t2, a2, 12 # check for small copy ble a2, zero, 2f @@ -77,13 +77,13 @@ ALEAF(bcopy) 2: j ra nop -forward: +.Lforward: #ifdef _STANDALONE - bne t2, zero, smallcpy # do a small bcopy + bne t2, zero, .Lsmallcpy # do a small bcopy xor v1, a0, a1 # compare low two bits of addresses and v1, v1, 3 PTR_SUBU a3, zero, a1 # compute # bytes to word align address - beq v1, zero, aligned # addresses can be word aligned + beq v1, zero, .Laligned # addresses can be word aligned and a3, a3, 3 beq a3, zero, 1f @@ -106,9 +106,9 @@ forward: PTR_ADDU a1, a1, 4 bne a0, a3, 2b nop # We have to do this mmu-bug. - b smallcpy + b .Lsmallcpy nop -aligned: +.Laligned: beq a3, zero, 1f PTR_SUBU a2, a2, a3 # subtract from remaining count LWHI v1, 0(a0) # copy 1, 2, or 3 bytes to align @@ -127,11 +127,11 @@ aligned: bne a0, a3, 2b PTR_ADDU a1, a1, 4 #else - bne t2, zero, smallcpy # do a small bcopy + bne t2, zero, .Lsmallcpy # do a small bcopy xor v1, a0, a1 # compare low three bits of addresses and v1, v1, 7 PTR_SUBU a3, zero, a1 # compute # bytes to dword align address - beq v1, zero, aligned # addresses can be dword aligned + beq v1, zero, .Laligned # addresses can be dword aligned and a3, a3, 7 beq a3, zero, 1f @@ -144,7 +144,7 @@ aligned: 1: and v1, a2, 7 # compute number of dwords left PTR_SUBU a3, a2, v1 - beq a3, zero, smallcpy + beq a3, zero, .Lsmallcpy move a2, v1 PTR_ADDU a3, a3, a0 # compute ending address 2: @@ -155,9 +155,9 @@ aligned: PTR_ADDU a1, a1, 8 bne a0, a3, 2b nop # We have to do this mmu-bug. - b smallcpy + b .Lsmallcpy nop -aligned: +.Laligned: beq a3, zero, 1f PTR_SUBU a2, a2, a3 # subtract from remaining count LDHI v1, 0(a0) # copy 1-7 bytes to align @@ -167,7 +167,7 @@ aligned: 1: and v1, a2, 7 # compute number of whole dwords left PTR_SUBU a3, a2, v1 - beq a3, zero, smallcpy + beq a3, zero, .Lsmallcpy move a2, v1 PTR_ADDU a3, a3, a0 # compute ending address 2: @@ -177,7 +177,7 @@ aligned: bne a0, a3, 2b PTR_ADDU a1, a1, 8 #endif -smallcpy: +.Lsmallcpy: ble a2, zero, 2f PTR_ADDU a3, a2, a0 # compute ending address 1: diff --git a/sys/lib/libkern/arch/mips64/strcmp.S b/sys/lib/libkern/arch/mips64/strcmp.S index 430efad02b6..be99e26e3ed 100644 --- a/sys/lib/libkern/arch/mips64/strcmp.S +++ b/sys/lib/libkern/arch/mips64/strcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.S,v 1.4 2004/10/08 14:42:09 pefo Exp $ */ +/* $OpenBSD: strcmp.S,v 1.5 2022/01/29 05:47:36 visa Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -42,20 +42,20 @@ LEAF(strcmp, 0) 1: lbu t0, 0(a0) # get two bytes and compare them lbu t1, 0(a1) - beq t0, zero, LessOrEq # end of first string? + beq t0, zero, .LessOrEq # end of first string? nop - bne t0, t1, NotEq + bne t0, t1, .LNotEq nop lbu t0, 1(a0) # unroll loop lbu t1, 1(a1) - beq t0, zero, LessOrEq # end of first string? + beq t0, zero, .LessOrEq # end of first string? PTR_ADDU a0, a0, 2 beq t0, t1, 1b PTR_ADDU a1, a1, 2 -NotEq: +.LNotEq: j ra PTR_SUBU v0, t0, t1 -LessOrEq: +.LessOrEq: j ra PTR_SUBU v0, zero, t1 END(strcmp)