diff options
author | Richard Henderson <rth@redhat.com> | 1999-03-29 13:25:15 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 1999-03-29 13:25:15 +0000 |
commit | ae6b87303186d9c11aaaf87b7a9500262c0f8c5a (patch) | |
tree | d6903bcec84aaf26f4e51de65f48f81f654eaab9 /sysdeps/sparc/sparc32/sparcv9 | |
parent | b47516084bfba8471da0bdb58641c0d27e6e48b5 (diff) | |
download | glibc-ae6b87303186d9c11aaaf87b7a9500262c0f8c5a.tar.gz glibc-ae6b87303186d9c11aaaf87b7a9500262c0f8c5a.tar.xz glibc-ae6b87303186d9c11aaaf87b7a9500262c0f8c5a.zip |
Sparc string routines from Jakub.
1999-03-29 Jakub Jelinek <jj@ultra.linux.cz> * sysdeps/sparc/sparc32/sparcv8/Makefile: New file. * sysdeps/sparc/sparc32/sparcv8/rem.S: Delay after write %y. * sysdeps/sparc/sparc32/sparcv8/sdiv.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/udiv.S: Likewise. * sysdeps/sparc/sparc32/sparcv8/urem.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/bcopy.c: New file. * sysdeps/sparc/sparc32/sparcv9/bzero.c: New file. * sysdeps/sparc/sparc32/sparcv9/memchr.S: New file. * sysdeps/sparc/sparc32/sparcv9/memcmp.S: New file. * sysdeps/sparc/sparc32/sparcv9/memcpy.S: New file. * sysdeps/sparc/sparc32/sparcv9/memset.S: New file. * sysdeps/sparc/sparc32/sparcv9/stpcpy.S: New file. * sysdeps/sparc/sparc32/sparcv9/strcat.S: New file. * sysdeps/sparc/sparc32/sparcv9/strchr.S: New file. * sysdeps/sparc/sparc32/sparcv9/strcmp.S: New file. * sysdeps/sparc/sparc32/sparcv9/strcpy.S: New file. * sysdeps/sparc/sparc32/sparcv9/strcspn.S: New file. * sysdeps/sparc/sparc32/sparcv9/strlen.S: New file. * sysdeps/sparc/sparc32/sparcv9/strncpy.S: New file. * sysdeps/sparc/sparc32/sparcv9/strpbrk.S: New file. * sysdeps/sparc/sparc32/sparcv9/strrchr.c: New file. * sysdeps/sparc/sparc32/sparcv9/strspn.S: New file. * sysdeps/sparc/sparc32/sparcv9/dotmul.S: New file. * sysdeps/sparc/sparc32/sparcv9/rem.S: New file. * sysdeps/sparc/sparc32/sparcv9/sdiv.S: New file. * sysdeps/sparc/sparc32/sparcv9/udiv.S: New file. * sysdeps/sparc/sparc32/sparcv9/umul.S: New file. * sysdeps/sparc/sparc32/sparcv9/urem.S: New file. * sysdeps/sparc/sparc32/sparcv9/Makefile: New file. * sysdeps/sparc/sparc32/sparcv9/stpncpy.S: New file. * sysdeps/sparc/sparc32/sparcv9/strncmp.S: New file. * sysdeps/sparc/sparc32/bcopy.c: New file. * sysdeps/sparc/sparc32/bzero.c: New file. * sysdeps/sparc/sparc32/memchr.S: New file. * sysdeps/sparc/sparc32/memcpy.S: New file. * sysdeps/sparc/sparc32/memmove.c: New file. * sysdeps/sparc/sparc32/memset.S: New file. * sysdeps/sparc/sparc32/stpcpy.S: New file. * sysdeps/sparc/sparc32/strchr.S: New file. * sysdeps/sparc/sparc32/strrchr.c: New file. * sysdeps/sparc/sparc32/strcpy.S: New file. * sysdeps/sparc/sparc32/strlen.S: New file. * sysdeps/sparc/sparc32/strcat.S: New file. * sysdeps/sparc/sparc32/strcmp.S: New file. * sysdeps/sparc/sparc64/bcopy.c: New file. * sysdeps/sparc/sparc64/bzero.c: New file. * sysdeps/sparc/sparc64/memchr.S: New file. * sysdeps/sparc/sparc64/memcmp.S: New file. * sysdeps/sparc/sparc64/memcpy.S: New file. * sysdeps/sparc/sparc64/memset.S: New file. * sysdeps/sparc/sparc64/stpcpy.S: New file. * sysdeps/sparc/sparc64/strcat.S: New file. * sysdeps/sparc/sparc64/strchr.S: New file. * sysdeps/sparc/sparc64/strcmp.S: New file. * sysdeps/sparc/sparc64/strcpy.S: New file. * sysdeps/sparc/sparc64/strcspn.S: New file. * sysdeps/sparc/sparc64/strlen.S: New file. * sysdeps/sparc/sparc64/strncpy.S: New file. * sysdeps/sparc/sparc64/strpbrk.S: New file. * sysdeps/sparc/sparc64/strrchr.c: New file. * sysdeps/sparc/sparc64/strspn.S: New file. * sysdeps/sparc/sparc64/stpncpy.S: New file. * sysdeps/sparc/sparc64/strncmp.S: New file. * sysdeps/unix/sysv/linux/sparc/sparc32/Makefile (ASFLAGS-.os): Append -fPIC, don't replace. * configure.in: Recognize sparcv8plus / sparcv9.
Diffstat (limited to 'sysdeps/sparc/sparc32/sparcv9')
26 files changed, 180 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/Makefile b/sysdeps/sparc/sparc32/sparcv9/Makefile new file mode 100644 index 0000000000..00675fd671 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/Makefile @@ -0,0 +1 @@ +CFLAGS += -mv8 -mtune=ultrasparc diff --git a/sysdeps/sparc/sparc32/sparcv9/bcopy.c b/sysdeps/sparc/sparc32/sparcv9/bcopy.c new file mode 100644 index 0000000000..9a455f33c4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/bcopy.c @@ -0,0 +1 @@ +/* bcopy is in memcpy.S */ diff --git a/sysdeps/sparc/sparc32/sparcv9/bzero.c b/sysdeps/sparc/sparc32/sparcv9/bzero.c new file mode 100644 index 0000000000..37f0f6f993 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/bzero.c @@ -0,0 +1 @@ +/* bzero is in memset.S */ diff --git a/sysdeps/sparc/sparc32/sparcv9/dotmul.S b/sysdeps/sparc/sparc32/sparcv9/dotmul.S new file mode 100644 index 0000000000..811cf1e89e --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/dotmul.S @@ -0,0 +1,17 @@ +/* + * Sparc v9 has multiply. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.mul) + + sra %o0, 0, %o0 + sra %o1, 0, %o1 + mulx %o0, %o1, %o0 + retl + srax %o0, 32, %o1 + +END(.mul) diff --git a/sysdeps/sparc/sparc32/sparcv9/memchr.S b/sysdeps/sparc/sparc32/sparcv9/memchr.S new file mode 100644 index 0000000000..c5dfbef184 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/memchr.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/memchr.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/memcmp.S b/sysdeps/sparc/sparc32/sparcv9/memcmp.S new file mode 100644 index 0000000000..44878f4486 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/memcmp.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/memcmp.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/memcpy.S b/sysdeps/sparc/sparc32/sparcv9/memcpy.S new file mode 100644 index 0000000000..675ec496b9 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/memcpy.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/memcpy.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/memset.S b/sysdeps/sparc/sparc32/sparcv9/memset.S new file mode 100644 index 0000000000..ac67b7ab7c --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/memset.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/memset.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/rem.S b/sysdeps/sparc/sparc32/sparcv9/rem.S new file mode 100644 index 0000000000..5385bd8305 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/rem.S @@ -0,0 +1,22 @@ +/* + * Sparc v9 has divide. + * As divx takes 68 cycles and sdivcc only 36, + * we use sdivcc eventhough it is deprecated. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.rem) + + sra %o0, 31, %o2 + wr %o2, 0, %y + sdivcc %o0, %o1, %o2 + xnor %o2, %g0, %o3 + movvs %icc, %o3, %o2 + smul %o2, %o1, %o2 + retl + sub %o0, %o2, %o0 + +END(.rem) diff --git a/sysdeps/sparc/sparc32/sparcv9/sdiv.S b/sysdeps/sparc/sparc32/sparcv9/sdiv.S new file mode 100644 index 0000000000..d765514cea --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/sdiv.S @@ -0,0 +1,20 @@ +/* + * Sparc v9 has divide. + * As divx takes 68 cycles and sdivcc only 36, + * we use sdivcc eventhough it is deprecated. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.div) + + sra %o0, 31, %o2 + wr %o2, 0, %y + sdivcc %o0, %o1, %o0 + xnor %o0, %g0, %o2 + retl + movvs %icc, %o2, %o0 + +END(.div) diff --git a/sysdeps/sparc/sparc32/sparcv9/stpcpy.S b/sysdeps/sparc/sparc32/sparcv9/stpcpy.S new file mode 100644 index 0000000000..440ad7e215 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/stpcpy.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/stpcpy.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/stpncpy.S b/sysdeps/sparc/sparc32/sparcv9/stpncpy.S new file mode 100644 index 0000000000..124136a0b2 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/stpncpy.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/stpncpy.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strcat.S b/sysdeps/sparc/sparc32/sparcv9/strcat.S new file mode 100644 index 0000000000..7a22235703 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strcat.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strcat.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strchr.S b/sysdeps/sparc/sparc32/sparcv9/strchr.S new file mode 100644 index 0000000000..ddd32120d4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strchr.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strchr.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strcmp.S b/sysdeps/sparc/sparc32/sparcv9/strcmp.S new file mode 100644 index 0000000000..5330f4359b --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strcmp.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strcmp.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strcpy.S b/sysdeps/sparc/sparc32/sparcv9/strcpy.S new file mode 100644 index 0000000000..0b35c9be08 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strcpy.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strcpy.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strcspn.S b/sysdeps/sparc/sparc32/sparcv9/strcspn.S new file mode 100644 index 0000000000..f9d6beabe4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strcspn.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strcspn.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strlen.S b/sysdeps/sparc/sparc32/sparcv9/strlen.S new file mode 100644 index 0000000000..b8f4dba4f4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strlen.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strlen.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strncmp.S b/sysdeps/sparc/sparc32/sparcv9/strncmp.S new file mode 100644 index 0000000000..addd89e05b --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strncmp.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strncmp.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strncpy.S b/sysdeps/sparc/sparc32/sparcv9/strncpy.S new file mode 100644 index 0000000000..688f9dfd65 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strncpy.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strncpy.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strpbrk.S b/sysdeps/sparc/sparc32/sparcv9/strpbrk.S new file mode 100644 index 0000000000..62294c0af4 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strpbrk.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strpbrk.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/strrchr.c b/sysdeps/sparc/sparc32/sparcv9/strrchr.c new file mode 100644 index 0000000000..ec608d6ab3 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strrchr.c @@ -0,0 +1 @@ +/* strrchr is in strchr.S */ diff --git a/sysdeps/sparc/sparc32/sparcv9/strspn.S b/sysdeps/sparc/sparc32/sparcv9/strspn.S new file mode 100644 index 0000000000..291e798085 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/strspn.S @@ -0,0 +1,4 @@ +#define ASI_PNF 0x82 +#define ASI_BLK_P 0xf0 +#define XCC icc +#include <sparc64/strspn.S> diff --git a/sysdeps/sparc/sparc32/sparcv9/udiv.S b/sysdeps/sparc/sparc32/sparcv9/udiv.S new file mode 100644 index 0000000000..de79899756 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/udiv.S @@ -0,0 +1,17 @@ +/* + * Sparc v9 has divide. + * As divx takes 68 cycles and udiv only 37, + * we use udiv eventhough it is deprecated. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.udiv) + + wr %g0, 0, %y + retl + udiv %o0, %o1, %o0 + +END(.udiv) diff --git a/sysdeps/sparc/sparc32/sparcv9/umul.S b/sysdeps/sparc/sparc32/sparcv9/umul.S new file mode 100644 index 0000000000..608b72aca1 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/umul.S @@ -0,0 +1,17 @@ +/* + * Sparc v9 has multiply. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.umul) + + srl %o0, 0, %o0 + srl %o1, 0, %o1 + mulx %o0, %o1, %o0 + retl + srlx %o0, 32, %o1 + +END(.umul) diff --git a/sysdeps/sparc/sparc32/sparcv9/urem.S b/sysdeps/sparc/sparc32/sparcv9/urem.S new file mode 100644 index 0000000000..cab16c9193 --- /dev/null +++ b/sysdeps/sparc/sparc32/sparcv9/urem.S @@ -0,0 +1,19 @@ +/* + * Sparc v9 has divide. + * As divx takes 68 cycles and udiv only 37, + * we use udiv eventhough it is deprecated. + */ + +#include <sysdep.h> + + .text + .align 32 +ENTRY(.urem) + + wr %g0, 0, %y + udiv %o0, %o1, %o2 + umul %o2, %o1, %o2 + retl + sub %o0, %o2, %o0 + +END(.urem) |