diff options
142 files changed, 1031 insertions, 1062 deletions
diff --git a/lib/csu/m68k/Makefile b/lib/csu/m68k/Makefile index b14b34131db..1d3f71d90c6 100644 --- a/lib/csu/m68k/Makefile +++ b/lib/csu/m68k/Makefile @@ -1,42 +1,61 @@ -# $OpenBSD: Makefile,v 1.7 2011/11/08 10:37:09 guenther Exp $ +# $OpenBSD: Makefile,v 1.8 2013/02/02 13:29:14 miod Exp $ # from: @(#)Makefile 5.5 (Berkeley) 5/21/91 -CFLAGS+= -I${.CURDIR}/.. -OBJS= crt0.o gcrt0.o scrt0.o -SRCS= crt0.c +OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o +SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c + +ELFDIR= ${.CURDIR}/../common_elf +.PATH: ${ELFDIR} +CFLAGS+= -I${ELFDIR} -I${.CURDIR} + +PICFLAG= -fpic all: ${OBJS} -crt0.o: ${SRCS} - @echo "${COMPILE.c} -DCRT0 -DDYNAMIC ${.CURDIR}/${SRCS} -o ${.TARGET}" - @${COMPILE.c} -DCRT0 -DDYNAMIC ${.CURDIR}/${SRCS} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} +crt0.o: crt0.c + @echo ${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET} + @${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o -gcrt0.o: ${SRCS} - @echo "${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}" - @${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} +gcrt0.o: crt0.c + @echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET} + @${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o -scrt0.o: ${SRCS} - @echo "${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}" - @${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o - @${LD} -x -r ${.TARGET}.o -o ${.TARGET} +crtbegin.o: crtbegin.c + @echo ${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET} + @${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + +crtbeginS.o: crtbeginS.c + @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET} + @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + +crtend.o: crtend.c + @echo ${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET} + @${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o + @rm -f ${.TARGET}.o + +crtendS.o: crtendS.c + @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET} + @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o + @${LD} -x -r -o ${.TARGET} ${.TARGET}.o @rm -f ${.TARGET}.o realinstall: ${INSTALL} ${INSTALL_COPY} -S -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \ ${DESTDIR}/usr/lib -.if make(depend) -CPPFLAGS+= -DDYNAMIC -.endif - -afterdepend: .depend +afterdepend:: .depend @(TMP=/tmp/_depend$$$$; \ - sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o s\1.o:/' \ - < .depend > $$TMP; \ + sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o:/' \ + < .depend > $$TMP; \ mv $$TMP .depend) .include <bsd.prog.mk> diff --git a/lib/csu/m68k/crt0.c b/lib/csu/m68k/crt0.c index 368e0cdac39..d1e9a104a42 100644 --- a/lib/csu/m68k/crt0.c +++ b/lib/csu/m68k/crt0.c @@ -1,9 +1,11 @@ -/* $OpenBSD: crt0.c,v 1.9 2005/08/04 16:33:05 espie Exp $ */ -/* $NetBSD: crt0.c,v 1.14 1995/06/03 13:16:11 pk Exp $ */ +/* $OpenBSD: crt0.c,v 1.10 2013/02/02 13:29:14 miod Exp $ */ +/* $NetBSD: crt0.c,v 1.13 2011/03/07 05:09:10 joerg Exp $ */ + /* - * Copyright (c) 1993 Paul Kranenburg + * Copyright (c) 1999 Klaus Klein + * Copyright (c) 1995 Christopher G. Demetriou * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -14,10 +16,12 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by Paul Kranenburg. + * This product includes software developed for the + * NetBSD Project. See http://www.NetBSD.org/ for + * information about NetBSD. * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * + * derived from this software without specific prior written permission. + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -28,47 +32,53 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * + * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> */ - -#include <sys/param.h> #include <stdlib.h> +#include <limits.h> + +static char *_strrchr(char *, char); -#include "common.h" +char **environ; +char *__progname = ""; +char __progname_storage[NAME_MAX+1]; -extern void start(void) asm("start"); +#ifdef MCRT0 +extern void monstartup(u_long, u_long); +extern void _mcleanup(void); +extern unsigned char _etext, _eprol; +#endif /* MCRT0 */ + +static void ___start(int, char **, char **, void (*)(void)) __used; + +__asm("\n" +" .text \n" +" .align 2 \n" +" .globl __start \n" +"__start: \n" +" movl %sp,%a0 \n" +" movl (%a0)+,%d0 | argc\n" +" movl %a1,-(%sp) | cleanup\n" +" pea 4(%a0,%d0.l*4) | envp\n" +" movl %a0,-(%sp) | argv\n" +" movl %d0,-(%sp) | argc\n" +" jsr ___start"); void -start() +___start(int argc, char **argv, char **envp, + void (*cleanup)(void)) { - struct kframe { - int kargc; - char *kargv[1]; /* size depends on kargc */ - char kargstr[1]; /* size varies */ - char kenvstr[1]; /* size varies */ - }; - /* - * ALL REGISTER VARIABLES!!! - */ - register struct kframe *kfp; - register char **argv, *ap; char *s; -#ifdef lint - kfp = 0; - initcode = initcode = 0; -#else /* not lint */ - asm("lea a6@(4),%0" : "=r" (kfp)); /* catch it quick */ -#endif /* not lint */ - argv = &kfp->kargv[0]; - environ = argv + kfp->kargc + 1; - - if (ap = argv[0]) { - if ((__progname = _strrchr(ap, '/')) == NULL) - __progname = ap; + environ = envp; + + if ((__progname = argv[0]) != NULL) { /* NULL ptr if argc = 0 */ + if ((__progname = _strrchr(__progname, '/')) == NULL) + __progname = argv[0]; else - ++__progname; + __progname++; for (s = __progname_storage; *__progname && s < &__progname_storage[sizeof __progname_storage - 1]; ) *s++ = *__progname++; @@ -76,43 +86,35 @@ start() __progname = __progname_storage; } -#ifdef DYNAMIC - /* ld(1) convention: if DYNAMIC = 0 then statically linked */ -#ifdef stupid_gcc - if (&_DYNAMIC) -#else - if ( ({volatile caddr_t x = (caddr_t)&_DYNAMIC; x; }) ) -#endif - __load_rtld(&_DYNAMIC); -#endif /* DYNAMIC */ - -asm("eprol:"); + if (cleanup) + atexit(cleanup); #ifdef MCRT0 atexit(_mcleanup); - monstartup((u_long)&eprol, (u_long)&etext); -#endif /* MCRT0 */ + monstartup((u_long)&_eprol, (u_long)&_etext); +#endif -asm ("__callmain:"); /* Defined for the benefit of debuggers */ - exit(main(kfp->kargc, argv, environ)); -} + __init(); -#ifdef DYNAMIC - asm(" ___syscall:"); - asm(" movel a7@+,a0"); /* return address */ - asm(" movel a7@,d0"); /* syscall number */ - asm(" movel a0,a7@"); - asm(" trap #0"); /* do system call */ - asm(" bcc 1f"); /* check error */ - asm(" moveq #-1,d0"); - asm(" 1: movel a7@,a0"); /* get return address, leave */ - asm(" jmp a0@"); /* correct amount on stack */ + exit(main(argc, argv, environ)); +} -#endif /* DYNAMIC */ +static char * +_strrchr(p, ch) +register char *p, ch; +{ + register char *save; -#include "common.c" + for (save = NULL;; ++p) { + if (*p == ch) + save = (char *)p; + if (!*p) + return(save); + } +/* NOTREACHED */ +} #ifdef MCRT0 -asm (" .text"); +asm (" .text"); asm ("_eprol:"); #endif diff --git a/lib/csu/m68k/md_init.h b/lib/csu/m68k/md_init.h new file mode 100644 index 00000000000..65dcb141f0e --- /dev/null +++ b/lib/csu/m68k/md_init.h @@ -0,0 +1,55 @@ +/* $OpenBSD: md_init.h,v 1.1 2013/02/02 13:29:14 miod Exp $ */ + +/*- + * Copyright (c) 2001 Ross Harvey + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#define MD_SECT_CALL_FUNC(section, func) \ + __asm (".section "#section", \"ax\" \n" \ + " jbsr " #func " \n" \ + " .previous") + +#define MD_SECTION_PROLOGUE(sect, entry_pt) \ + __asm ( \ + ".section "#sect",\"ax\",@progbits \n" \ + " .globl " #entry_pt " \n" \ + #entry_pt": \n" \ + " .align 2 \n" \ + " /* fall thru */ \n" \ + " .previous") + + +#define MD_SECTION_EPILOGUE(sect) \ + __asm ( \ + ".section "#sect",\"ax\",@progbits \n" \ + " rts \n" \ + " .previous") diff --git a/lib/libc/arch/m68k/SYS.h b/lib/libc/arch/m68k/SYS.h index a3a6e5fa95c..f478d7a7c67 100644 --- a/lib/libc/arch/m68k/SYS.h +++ b/lib/libc/arch/m68k/SYS.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.16 2003/06/02 20:18:30 millert Exp $ + * $OpenBSD: SYS.h,v 1.17 2013/02/02 13:29:14 miod Exp $ */ #include <sys/syscall.h> @@ -41,13 +41,13 @@ #ifdef __STDC__ # define __ENTRY(p,x) ENTRY(p##x) # define __DO_SYSCALL(x) \ - movl _IMMEDIATE_ SYS_##x, d0; \ + movl _IMMEDIATE_ SYS_##x, %d0; \ trap _IMMEDIATE_ 0 # define __LABEL2(p,x) _C_LABEL(p##x) #else # define __ENTRY(p,x) ENTRY(p/**/x) # define __DO_SYSCALL(x) \ - movl _IMMEDIATE_ SYS_/**/x, d0; \ + movl _IMMEDIATE_ SYS_/**/x, %d0;\ trap _IMMEDIATE_ 0 # define __LABEL2(p,x) _C_LABEL(p/**/x) #endif @@ -62,22 +62,22 @@ /* perform a syscall, set errno */ #define __SYSCALL(p,x,y) \ - .even; \ - err: jra __cerror; \ + .even; \ + err: jra PIC_PLT(__cerror); \ __SYSCALL_NOERROR(p,x,y); \ - jcs err + jcs err /* perform a syscall, return */ #define __PSEUDO_NOERROR(p,x,y) \ __SYSCALL_NOERROR(p,x,y); \ - rts + rts /* perform a syscall, set errno, return */ #define __PSEUDO(p,x,y) \ __SYSCALL(p,x,y); \ - rts + rts #ifdef __STDC__ diff --git a/lib/libc/arch/m68k/gen/_setjmp.S b/lib/libc/arch/m68k/gen/_setjmp.S index 344f6a9d0b9..a1808cbbcfd 100644 --- a/lib/libc/arch/m68k/gen/_setjmp.S +++ b/lib/libc/arch/m68k/gen/_setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: _setjmp.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: _setjmp.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -46,34 +46,34 @@ #include "DEFS.h" ENTRY(_setjmp) - movl sp@(4),a0 /* save area pointer */ - clrl a0@+ /* no old onstack */ - clrl a0@+ /* no old sigmask */ - movl sp,a0@+ /* save old SP */ - movl a6,a0@+ /* save old FP */ - clrl a0@+ /* no old AP */ - movl sp@,a0@+ /* save old PC */ - clrl a0@+ /* clear PS */ - moveml #0x3CFC,a0@ /* save other non-scratch regs */ - clrl d0 /* return zero */ + movl %sp@(4),%a0 /* save area pointer */ + clrl %a0@+ /* no old onstack */ + clrl %a0@+ /* no old sigmask */ + movl %sp,%a0@+ /* save old SP */ + movl %a6,%a0@+ /* save old FP */ + clrl %a0@+ /* no old AP */ + movl %sp@,%a0@+ /* save old PC */ + clrl %a0@+ /* clear PS */ + moveml #0x3CFC,%a0@ /* save other non-scratch regs */ + clrl %d0 /* return zero */ rts ENTRY(_longjmp) - movl sp@(4),a0 /* save area pointer */ - addql #8,a0 /* skip onstack/sigmask */ - tstl a0@ /* ensure non-zero SP */ + movl %sp@(4),%a0 /* save area pointer */ + addql #8,%a0 /* skip onstack/sigmask */ + tstl %a0@ /* ensure non-zero SP */ jeq botch /* oops! */ - movl sp@(8),d0 /* grab return value */ + movl %sp@(8),%d0 /* grab return value */ jne ok /* non-zero ok */ - moveq #1,d0 /* else make non-zero */ + moveq #1,%d0 /* else make non-zero */ ok: - movl a0@+,sp /* restore SP */ - movl a0@+,a6 /* restore FP */ - addql #4,a0 /* skip AP */ - movl a0@+,sp@ /* restore PC */ - moveml a0@(4),#0x3CFC /* restore non-scratch regs */ + movl %a0@+,%sp /* restore SP */ + movl %a0@+,%a6 /* restore FP */ + addql #4,%a0 /* skip AP */ + movl %a0@+,%sp@ /* restore PC */ + moveml %a0@(4),#0x3CFC /* restore non-scratch regs */ rts botch: - jbsr _longjmperror + jbsr PIC_PLT(_C_LABEL(longjmperror)) stop #0 diff --git a/lib/libc/arch/m68k/gen/adddf3.S b/lib/libc/arch/m68k/gen/adddf3.S index 0a2d9f7ecfc..b051bb55f87 100644 --- a/lib/libc/arch/m68k/gen/adddf3.S +++ b/lib/libc/arch/m68k/gen/adddf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: adddf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: adddf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ /* double + double */ ENTRY(__adddf3) - fmoved sp@(4),fp0 - faddd sp@(12),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + faddd %sp@(12),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/addsf3.S b/lib/libc/arch/m68k/gen/addsf3.S index a6008c67c41..d1816b4c395 100644 --- a/lib/libc/arch/m68k/gen/addsf3.S +++ b/lib/libc/arch/m68k/gen/addsf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: addsf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: addsf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,6 @@ /* single + single */ ENTRY(__addsf3) - fmoves sp@(4),fp0 - fadds sp@(8),fp0 - fmoves fp0,d0 + fmoves %sp@(4),%fp0 + fadds %sp@(8),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/ashlsi3.S b/lib/libc/arch/m68k/gen/ashlsi3.S index 69ad59b059e..53748e01e25 100644 --- a/lib/libc/arch/m68k/gen/ashlsi3.S +++ b/lib/libc/arch/m68k/gen/ashlsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ashlsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: ashlsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,7 @@ /* int << int */ ENTRY(__ashlsi3) - movel sp@(8),d1 - movel sp@(4),d0 - asll d1,d0 + movel %sp@(8),%d1 + movel %sp@(4),%d0 + asll %d1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/ashrsi3.S b/lib/libc/arch/m68k/gen/ashrsi3.S index 54509f55b3c..32c7c438a86 100644 --- a/lib/libc/arch/m68k/gen/ashrsi3.S +++ b/lib/libc/arch/m68k/gen/ashrsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ashrsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: ashrsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,7 @@ /* int >> int */ ENTRY(__ashrsi3) - movel sp@(8),d1 - movel sp@(4),d0 - asrl d1,d0 + movel %sp@(8),%d1 + movel %sp@(4),%d0 + asrl %d1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/cmpdf2.S b/lib/libc/arch/m68k/gen/cmpdf2.S index 76beefa7352..0ee2e0f8b84 100644 --- a/lib/libc/arch/m68k/gen/cmpdf2.S +++ b/lib/libc/arch/m68k/gen/cmpdf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpdf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: cmpdf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -38,12 +38,12 @@ /* double < double: -1 */ /* double == double: 0 */ ENTRY(__cmpdf2) - fmoved sp@(4),fp0 - fcmpd sp@(12),fp0 + fmoved %sp@(4),%fp0 + fcmpd %sp@(12),%fp0 fbgt Lagtb - fslt d0 - extbl d0 + fslt %d0 + extbl %d0 rts Lagtb: - moveq #1,d0 + moveq #1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/cmpsf2.S b/lib/libc/arch/m68k/gen/cmpsf2.S index a7b49bc02b2..a8c01dffd2c 100644 --- a/lib/libc/arch/m68k/gen/cmpsf2.S +++ b/lib/libc/arch/m68k/gen/cmpsf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpsf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: cmpsf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -38,12 +38,12 @@ /* single < single: -1 */ /* single == single: 0 */ ENTRY(__cmpsf2) - fmoves sp@(4),fp0 - fcmps sp@(8),fp0 + fmoves %sp@(4),%fp0 + fcmps %sp@(8),%fp0 fbgt Lagtb - fslt d0 - extbl d0 + fslt %d0 + extbl %d0 rts Lagtb: - moveq #1,d0 + moveq #1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/divdf3.S b/lib/libc/arch/m68k/gen/divdf3.S index 90427ac8c25..e45801cd742 100644 --- a/lib/libc/arch/m68k/gen/divdf3.S +++ b/lib/libc/arch/m68k/gen/divdf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: divdf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: divdf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ /* double / double */ ENTRY(__divdf3) - fmoved sp@(4),fp0 - fdivd sp@(12),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + fdivd %sp@(12),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/divsf3.S b/lib/libc/arch/m68k/gen/divsf3.S index 23f6a6d6b2b..472f2f0d413 100644 --- a/lib/libc/arch/m68k/gen/divsf3.S +++ b/lib/libc/arch/m68k/gen/divsf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: divsf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: divsf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,6 @@ /* single / single */ ENTRY(__divsf3) - fmoves sp@(4),fp0 - fdivs sp@(8),fp0 - fmoves fp0,d0 + fmoves %sp@(4),%fp0 + fdivs %sp@(8),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/divsi3.S b/lib/libc/arch/m68k/gen/divsi3.S index 533233f8480..de45d79a740 100644 --- a/lib/libc/arch/m68k/gen/divsi3.S +++ b/lib/libc/arch/m68k/gen/divsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: divsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: divsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* int / int */ ENTRY(__divsi3) - movel sp@(4),d0 - divsl sp@(8),d0 + movel %sp@(4),%d0 + divsl %sp@(8),%d0 rts diff --git a/lib/libc/arch/m68k/gen/extendsfdf2.S b/lib/libc/arch/m68k/gen/extendsfdf2.S index 267bdf89caa..a340d2722e1 100644 --- a/lib/libc/arch/m68k/gen/extendsfdf2.S +++ b/lib/libc/arch/m68k/gen/extendsfdf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: extendsfdf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: extendsfdf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,8 +36,5 @@ /* (double) float */ ENTRY(__extendsfdf2) - fmoves sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoves %sp@(4),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/fabs.S b/lib/libc/arch/m68k/gen/fabs.S index d12fd7dd7bb..d25e45f24f9 100644 --- a/lib/libc/arch/m68k/gen/fabs.S +++ b/lib/libc/arch/m68k/gen/fabs.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fabs.S,v 1.8 2011/07/08 22:28:33 martynas Exp $ */ +/* $OpenBSD: fabs.S,v 1.9 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,11 +37,8 @@ #include "DEFS.h" ENTRY(fabs) - fmoved sp@(4),fp0 + fmoved %sp@(4),%fp0 fjnlt L1 - fnegx fp0 + fnegx %fp0 L1: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libc/arch/m68k/gen/fixdfsi.S b/lib/libc/arch/m68k/gen/fixdfsi.S index 39df06ef321..603b94acb13 100644 --- a/lib/libc/arch/m68k/gen/fixdfsi.S +++ b/lib/libc/arch/m68k/gen/fixdfsi.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fixdfsi.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fixdfsi.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* (int) double */ ENTRY(__fixdfsi) - fintrzd sp@(4),fp0 - fmovel fp0,d0 + fintrzd %sp@(4),%fp0 + fmovel %fp0,%d0 rts diff --git a/lib/libc/arch/m68k/gen/fixunsdfsi.S b/lib/libc/arch/m68k/gen/fixunsdfsi.S index 5d8e20caadd..a8c0d85c1b2 100644 --- a/lib/libc/arch/m68k/gen/fixunsdfsi.S +++ b/lib/libc/arch/m68k/gen/fixunsdfsi.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fixunsdfsi.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fixunsdfsi.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,13 +36,13 @@ /* (unsigned) double */ ENTRY(__fixunsdfsi) - fintrzd sp@(4),fp0 - fcmpd #0r2147483648.0,fp0 + fintrzd %sp@(4),%fp0 + fcmpd #0r2147483648.0,%fp0 fbge Lwaybig - fmovel fp0,d0 + fmovel %fp0,%d0 rts Lwaybig: - fsubd #0r2147483648.0,fp0 - fmovel fp0,d0 - bset #31,d0 + fsubd #0r2147483648.0,%fp0 + fmovel %fp0,%d0 + bset #31,%d0 rts diff --git a/lib/libc/arch/m68k/gen/floatsidf.S b/lib/libc/arch/m68k/gen/floatsidf.S index 6a62a4de77a..dadcc71175d 100644 --- a/lib/libc/arch/m68k/gen/floatsidf.S +++ b/lib/libc/arch/m68k/gen/floatsidf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: floatsidf.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: floatsidf.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ /* (double) int */ ENTRY(__floatsidf) - fmovel sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmovel %sp@(4),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/flt_rounds.S b/lib/libc/arch/m68k/gen/flt_rounds.S index a234cf59c3b..a3bf134b3ae 100644 --- a/lib/libc/arch/m68k/gen/flt_rounds.S +++ b/lib/libc/arch/m68k/gen/flt_rounds.S @@ -1,4 +1,4 @@ -/* $OpenBSD: flt_rounds.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: flt_rounds.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. @@ -8,15 +8,17 @@ .text .even +#if 0 +/* XXX This is, effectively, an exclusive-or with 1 operation. */ _map: .byte 1 /* round to nearest */ .byte 0 /* round to zero */ .byte 3 /* round to negative infinity */ .byte 2 /* round to positive infinity */ +#endif ENTRY(__flt_rounds) - fmovel fpcr,d0 - bfextu d0{#26:#2},d0 - lea _map,a0 - moveb a0@(d0:l:1),d0 + fmovel %fpcr,%d0 + bfextu %d0{#26:#2},%d0 + eorib #1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/fpgetmask.S b/lib/libc/arch/m68k/gen/fpgetmask.S index c851d737b27..bc30ed8e550 100644 --- a/lib/libc/arch/m68k/gen/fpgetmask.S +++ b/lib/libc/arch/m68k/gen/fpgetmask.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpgetmask.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpgetmask.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by Charles M. Hannum, Apr 9, 1995 * Public domain. @@ -7,6 +7,6 @@ #include <machine/asm.h> ENTRY(fpgetmask) - fmovel fpcr,d0 - bfextu d0{#18:#5},d0 + fmovel %fpcr,%d0 + bfextu %d0{#18:#5},%d0 rts diff --git a/lib/libc/arch/m68k/gen/fpgetround.S b/lib/libc/arch/m68k/gen/fpgetround.S index 8c046e32172..6b69ffa4bd6 100644 --- a/lib/libc/arch/m68k/gen/fpgetround.S +++ b/lib/libc/arch/m68k/gen/fpgetround.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpgetround.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpgetround.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. @@ -7,6 +7,6 @@ #include <machine/asm.h> ENTRY(fpgetround) - fmovel fpcr,d0 - bfextu d0{#26:#2},d0 + fmovel %fpcr,%d0 + bfextu %d0{#26:#2},%d0 rts diff --git a/lib/libc/arch/m68k/gen/fpgetsticky.S b/lib/libc/arch/m68k/gen/fpgetsticky.S index 96bb994d57b..9fe4fb0355b 100644 --- a/lib/libc/arch/m68k/gen/fpgetsticky.S +++ b/lib/libc/arch/m68k/gen/fpgetsticky.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpgetsticky.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpgetsticky.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by Charles M. Hannum, Apr 9, 1995 * Public domain. @@ -7,6 +7,6 @@ #include <machine/asm.h> ENTRY(fpgetsticky) - fmovel fpsr,d0 - bfextu d0{#24:#5},d0 + fmovel %fpsr,%d0 + bfextu %d0{#24:#5},%d0 rts diff --git a/lib/libc/arch/m68k/gen/fpsetmask.S b/lib/libc/arch/m68k/gen/fpsetmask.S index ccd7a5d72b0..d628436b458 100644 --- a/lib/libc/arch/m68k/gen/fpsetmask.S +++ b/lib/libc/arch/m68k/gen/fpsetmask.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpsetmask.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpsetmask.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by Charles M. Hannum, Apr 9, 1995 * Public Domain. @@ -7,11 +7,11 @@ #include <machine/asm.h> ENTRY(fpsetmask) - movel d2,sp@- - fmovel fpcr,d1 - movel sp@(8),d2 - bfextu d1{#18:#5},d0 - bfins d2,d1{#18:#5} - movel sp@+,d2 - fmovel d1,fpcr + movel %d2,%sp@- + fmovel %fpcr,%d1 + movel %sp@(8),%d2 + bfextu %d1{#18:#5},%d0 + bfins %d2,%d1{#18:#5} + movel %sp@+,%d2 + fmovel %d1,%fpcr rts diff --git a/lib/libc/arch/m68k/gen/fpsetround.S b/lib/libc/arch/m68k/gen/fpsetround.S index d7ae52b0afc..79c33b0a667 100644 --- a/lib/libc/arch/m68k/gen/fpsetround.S +++ b/lib/libc/arch/m68k/gen/fpsetround.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpsetround.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpsetround.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin, Apr 6, 1995 * Public Domain. @@ -7,11 +7,11 @@ #include <machine/asm.h> ENTRY(fpsetround) - movel d2,sp@- - fmovel fpcr,d1 - movel sp@(8),d2 - bfextu d1{#26,#2},d0 - bfins d2,d1{#26:#2} - movel sp@+,d2 - fmovel d1,fpcr + movel %d2,%sp@- + fmovel %fpcr,%d1 + movel %sp@(8),%d2 + bfextu %d1{#26,#2},%d0 + bfins %d2,%d1{#26:#2} + movel %sp@+,%d2 + fmovel %d1,%fpcr rts diff --git a/lib/libc/arch/m68k/gen/fpsetsticky.S b/lib/libc/arch/m68k/gen/fpsetsticky.S index f25ba277b3f..499694fc415 100644 --- a/lib/libc/arch/m68k/gen/fpsetsticky.S +++ b/lib/libc/arch/m68k/gen/fpsetsticky.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fpsetsticky.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fpsetsticky.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by Charles M. Hannum, Apr 9, 1995 * Public domain. @@ -7,11 +7,11 @@ #include <machine/asm.h> ENTRY(fpsetsticky) - movel d2,sp@- - fmovel fpsr,d1 - movel sp@(8),d2 - bfextu d1{#24:#5},d0 - bfins d2,d1{#24:#5} - movel sp@+,d2 - fmovel d1,fpsr + movel %d2,%sp@- + fmovel %fpsr,%d1 + movel %sp@(8),%d2 + bfextu %d1{#24:#5},%d0 + bfins %d2,%d1{#24:#5} + movel %sp@+,%d2 + fmovel %d1,%fpsr rts diff --git a/lib/libc/arch/m68k/gen/ldexp.S b/lib/libc/arch/m68k/gen/ldexp.S index a2827ee4145..f6500aca644 100644 --- a/lib/libc/arch/m68k/gen/ldexp.S +++ b/lib/libc/arch/m68k/gen/ldexp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldexp.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: ldexp.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -39,12 +39,9 @@ * returns: val * (2**exp), for integer exp */ ENTRY(ldexp) - fmoved sp@(4),fp0 + fmoved %sp@(4),%fp0 fbeq Ldone - ftwotoxl sp@(12),fp1 - fmulx fp1,fp0 + ftwotoxl %sp@(12),%fp1 + fmulx %fp1,%fp0 Ldone: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libc/arch/m68k/gen/lshlsi3.S b/lib/libc/arch/m68k/gen/lshlsi3.S index 82d9e45075d..f961344a399 100644 --- a/lib/libc/arch/m68k/gen/lshlsi3.S +++ b/lib/libc/arch/m68k/gen/lshlsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: lshlsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: lshlsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,7 @@ /* unsigned << unsigned */ ENTRY(__lshlsi3) - movel sp@(8),d1 - movel sp@(4),d0 - lsll d1,d0 + movel %sp@(8),%d1 + movel %sp@(4),%d0 + lsll %d1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/lshrsi3.S b/lib/libc/arch/m68k/gen/lshrsi3.S index 06241ae715e..cb8071e899f 100644 --- a/lib/libc/arch/m68k/gen/lshrsi3.S +++ b/lib/libc/arch/m68k/gen/lshrsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: lshrsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: lshrsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,7 @@ /* unsigned >> unsigned */ ENTRY(__lshrsi3) - movel sp@(8),d1 - movel sp@(4),d0 - lsrl d1,d0 + movel %sp@(8),%d1 + movel %sp@(4),%d0 + lsrl %d1,%d0 rts diff --git a/lib/libc/arch/m68k/gen/modf.S b/lib/libc/arch/m68k/gen/modf.S index aa32d6815b4..e87a7c4ab91 100644 --- a/lib/libc/arch/m68k/gen/modf.S +++ b/lib/libc/arch/m68k/gen/modf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: modf.S,v 1.6 2011/07/08 22:28:33 martynas Exp $ */ +/* $OpenBSD: modf.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -39,12 +39,9 @@ * returns: xxx and n (in *iptr) where val == n.xxx */ ENTRY(modf) - fmoved sp@(4),fp0 - movel sp@(12),a0 - fintrzx fp0,fp1 - fmoved fp1,a0@ - fsubx fp1,fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + movel %sp@(12),%a0 + fintrzx %fp0,%fp1 + fmoved %fp1,%a0@ + fsubx %fp1,%fp0 rts diff --git a/lib/libc/arch/m68k/gen/modsi3.S b/lib/libc/arch/m68k/gen/modsi3.S index ef290581947..1e712fd2ae4 100644 --- a/lib/libc/arch/m68k/gen/modsi3.S +++ b/lib/libc/arch/m68k/gen/modsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: modsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: modsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* int % int */ ENTRY(__modsi3) - movel sp@(4),d1 - divsll sp@(8),d0:d1 + movel %sp@(4),%d1 + divsll %sp@(8),%d0:%d1 rts diff --git a/lib/libc/arch/m68k/gen/muldf3.S b/lib/libc/arch/m68k/gen/muldf3.S index f3a1a15ac3d..9fdc7359f86 100644 --- a/lib/libc/arch/m68k/gen/muldf3.S +++ b/lib/libc/arch/m68k/gen/muldf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: muldf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: muldf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ /* double * double */ ENTRY(__muldf3) - fmoved sp@(4),fp0 - fmuld sp@(12),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + fmuld %sp@(12),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/mulsf3.S b/lib/libc/arch/m68k/gen/mulsf3.S index 3a76d70f6e6..3caa81c38e1 100644 --- a/lib/libc/arch/m68k/gen/mulsf3.S +++ b/lib/libc/arch/m68k/gen/mulsf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mulsf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: mulsf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,6 @@ /* single * single */ ENTRY(__mulsf3) - fmoves sp@(4),fp0 - fmuls sp@(8),fp0 - fmoves fp0,d0 + fmoves %sp@(4),%fp0 + fmuls %sp@(8),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/mulsi3.S b/lib/libc/arch/m68k/gen/mulsi3.S index d26f1f8ac4e..5c87afff761 100644 --- a/lib/libc/arch/m68k/gen/mulsi3.S +++ b/lib/libc/arch/m68k/gen/mulsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mulsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: mulsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* int * int */ ENTRY(__mulsi3) - movel sp@(4),d0 - mulsl sp@(8),d0 + movel %sp@(4),%d0 + mulsl %sp@(8),%d0 rts diff --git a/lib/libc/arch/m68k/gen/negdf2.S b/lib/libc/arch/m68k/gen/negdf2.S index 0dd7e7946de..c5c5ea30ebe 100644 --- a/lib/libc/arch/m68k/gen/negdf2.S +++ b/lib/libc/arch/m68k/gen/negdf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: negdf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: negdf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,5 @@ /* -double */ ENTRY(__negdf2) - movel sp@(4),d0 - movel sp@(8),d1 - bchg #31,d0 + fnegd %sp@(4),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/negsf2.S b/lib/libc/arch/m68k/gen/negsf2.S index 1777070a135..311d5183243 100644 --- a/lib/libc/arch/m68k/gen/negsf2.S +++ b/lib/libc/arch/m68k/gen/negsf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: negsf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: negsf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,5 @@ /* -single */ ENTRY(__negsf2) - movel sp@(4),d0 - bchg #31,d0 + fnegs %sp@(4),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/setjmp.S b/lib/libc/arch/m68k/gen/setjmp.S index 01ab2b39d76..161acadf949 100644 --- a/lib/libc/arch/m68k/gen/setjmp.S +++ b/lib/libc/arch/m68k/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.5 2011/11/22 21:13:30 guenther Exp $ */ +/* $OpenBSD: setjmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -46,40 +46,41 @@ #include "DEFS.h" ENTRY(setjmp) - subl #12,sp /* space for sigaltstack args/rvals */ - clrl sp@ /* don't change it... */ - movl sp,sp@(4) /* ...but return the current val */ - jbsr _sigaltstack /* note: flags returned in sp@(8) */ - clrl sp@ /* don't change mask, just return */ - jbsr _sigblock /* old value */ - movl sp@(8),d1 /* old flags value */ - andl #1,d1 /* extract onstack flag */ - addl #12,sp - movl sp@(4),a0 /* save area pointer */ - movl d1,a0@+ /* save old onstack value */ - movl d0,a0@+ /* save old signal mask */ - lea sp@(4),a1 /* adjust saved SP since we won't rts */ - movl a1,a0@+ /* save old SP */ - movl a6,a0@+ /* save old FP */ - clrl a0@+ /* no AP */ - movl sp@,a0@+ /* save old PC */ - clrl a0@+ /* clean PS */ - moveml #0x3CFC,a0@ /* save remaining non-scratch regs */ - clrl d0 /* return 0 */ + subl #12,%sp /* space for sigaltstack args/rvals */ + clrl %sp@ /* don't change it... */ + movl %sp,%sp@(4) /* ...but return the current val */ + jbsr PIC_PLT(_C_LABEL(sigaltstack)) + /* note: flags returned in %sp@(8) */ + clrl %sp@ /* don't change mask, just return old value */ + jbsr PIC_PLT(_C_LABEL(sigblock)) + movl %sp@(8),%d1 /* old flags value */ + andl #1,%d1 /* extract onstack flag */ + addl #12,%sp + movl %sp@(4),%a0 /* save area pointer */ + movl %d1,%a0@+ /* save old onstack value */ + movl %d0,%a0@+ /* save old signal mask */ + lea %sp@(4),%a1 /* adjust saved SP since we won't rts */ + movl %a1,%a0@+ /* save old SP */ + movl %a6,%a0@+ /* save old FP */ + clrl %a0@+ /* no AP */ + movl %sp@,%a0@+ /* save old PC */ + clrl %a0@+ /* clean PS */ + moveml #0x3CFC,%a0@ /* save remaining non-scratch regs */ + clrl %d0 /* return 0 */ rts ENTRY(longjmp) - movl sp@(4),a0 /* save area pointer */ - tstl a0@(8) /* ensure non-zero SP */ + movl %sp@(4),%a0 /* save area pointer */ + tstl %a0@(8) /* ensure non-zero SP */ jeq botch /* oops! */ - movl sp@(8),d0 /* grab return value */ + movl %sp@(8),%d0 /* grab return value */ jne ok /* non-zero ok */ - moveq #1,d0 /* else make non-zero */ + moveq #1,%d0 /* else make non-zero */ ok: - moveml a0@(28),#0x3CFC /* restore non-scratch regs */ - movl a0,sp@- /* let sigreturn */ - jbsr _sigreturn /* finish for us */ + moveml %a0@(28),#0x3CFC/* restore non-scratch regs */ + movl %a0,%sp@- /* let sigreturn finish for us */ + jbsr PIC_PLT(_C_LABEL(sigreturn)) botch: - jbsr _longjmperror + jbsr PIC_PLT(_C_LABEL(longjmperror)) stop #0 diff --git a/lib/libc/arch/m68k/gen/sigsetjmp.S b/lib/libc/arch/m68k/gen/sigsetjmp.S index d87d956232b..595cddf2181 100644 --- a/lib/libc/arch/m68k/gen/sigsetjmp.S +++ b/lib/libc/arch/m68k/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigsetjmp.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: sigsetjmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -49,20 +49,20 @@ #include <m68k/setjmp.h> ENTRY(sigsetjmp) - movl sp@(8),d1 /* grab the mask */ - movl sp@(4),a0 /* grab the area pointer */ - movl d1,a0@(_JBLEN * 4 ) /* save at end of area */ - tstl d1 + movl %sp@(8),%d1 /* grab the mask */ + movl %sp@(4),%a0 /* grab the area pointer */ + movl %d1,%a0@(_JBLEN * 4 ) /* save at end of area */ + tstl %d1 bne dosig - jra __setjmp + jra PIC_PLT(_C_LABEL(_setjmp)) dosig: - jra _setjmp + jra PIC_PLT(_C_LABEL(setjmp)) ENTRY(siglongjmp) - movl sp@(4),a0 /* save area pointer */ - tstl a0@(_JBLEN * 4) /* check mask... */ + movl %sp@(4),%a0 /* save area pointer */ + tstl %a0@(_JBLEN * 4) /* check mask... */ bne didsig - jra __longjmp + jra PIC_PLT(_C_LABEL(_longjmp)) didsig: - jra _longjmp + jra PIC_PLT(_C_LABEL(longjmp)) diff --git a/lib/libc/arch/m68k/gen/subdf3.S b/lib/libc/arch/m68k/gen/subdf3.S index 0c86a4c832b..07a425a97c1 100644 --- a/lib/libc/arch/m68k/gen/subdf3.S +++ b/lib/libc/arch/m68k/gen/subdf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: subdf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: subdf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ /* double - double */ ENTRY(__subdf3) - fmoved sp@(4),fp0 - fsubd sp@(12),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + fsubd %sp@(12),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/subsf3.S b/lib/libc/arch/m68k/gen/subsf3.S index ffaa8c5074b..9914141d8e3 100644 --- a/lib/libc/arch/m68k/gen/subsf3.S +++ b/lib/libc/arch/m68k/gen/subsf3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: subsf3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: subsf3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,7 +36,6 @@ /* single - single */ ENTRY(__subsf3) - fmoves sp@(4),fp0 - fsubs sp@(8),fp0 - fmoves fp0,d0 + fmoves %sp@(4),%fp0 + fsubs %sp@(8),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/truncdfsf2.S b/lib/libc/arch/m68k/gen/truncdfsf2.S index 7f611ee6a14..a14c83d3b0c 100644 --- a/lib/libc/arch/m68k/gen/truncdfsf2.S +++ b/lib/libc/arch/m68k/gen/truncdfsf2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: truncdfsf2.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: truncdfsf2.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,5 @@ /* (float) double */ ENTRY(__truncdfsf2) - fmoved sp@(4),fp0 - fmoves fp0,d0 + fmoved %sp@(4),%fp0 rts diff --git a/lib/libc/arch/m68k/gen/udivsi3.S b/lib/libc/arch/m68k/gen/udivsi3.S index 43c9284ca79..425b61289e8 100644 --- a/lib/libc/arch/m68k/gen/udivsi3.S +++ b/lib/libc/arch/m68k/gen/udivsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: udivsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: udivsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* unsigned / unsigned */ ENTRY(__udivsi3) - movel sp@(4),d0 - divul sp@(8),d0 + movel %sp@(4),%d0 + divul %sp@(8),%d0 rts diff --git a/lib/libc/arch/m68k/gen/umodsi3.S b/lib/libc/arch/m68k/gen/umodsi3.S index bafb8f15b67..875eb675f0b 100644 --- a/lib/libc/arch/m68k/gen/umodsi3.S +++ b/lib/libc/arch/m68k/gen/umodsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: umodsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: umodsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* unsigned % unsigned */ ENTRY(__umodsi3) - movel sp@(4),d1 - divull sp@(8),d0:d1 + movel %sp@(4),%d1 + divull %sp@(8),%d0:%d1 rts diff --git a/lib/libc/arch/m68k/gen/umulsi3.S b/lib/libc/arch/m68k/gen/umulsi3.S index 3b53edef05d..41f3d841b77 100644 --- a/lib/libc/arch/m68k/gen/umulsi3.S +++ b/lib/libc/arch/m68k/gen/umulsi3.S @@ -1,4 +1,4 @@ -/* $OpenBSD: umulsi3.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: umulsi3.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ /* unsigned * unsigned */ ENTRY(__umulsi3) - movel sp@(4),d0 - mulul sp@(8),d0 + movel %sp@(4),%d0 + mulul %sp@(8),%d0 rts diff --git a/lib/libc/arch/m68k/net/htonl.S b/lib/libc/arch/m68k/net/htonl.S index 35847677528..48130bfa1b7 100644 --- a/lib/libc/arch/m68k/net/htonl.S +++ b/lib/libc/arch/m68k/net/htonl.S @@ -36,5 +36,5 @@ #include "DEFS.h" ENTRY(htonl) - movl sp@(4),d0 + movl %sp@(4),%d0 rts diff --git a/lib/libc/arch/m68k/net/htons.S b/lib/libc/arch/m68k/net/htons.S index 47d22132036..3fe9cfab4e2 100644 --- a/lib/libc/arch/m68k/net/htons.S +++ b/lib/libc/arch/m68k/net/htons.S @@ -36,6 +36,6 @@ #include "DEFS.h" ENTRY(htons) - clrl d0 - movw sp@(6),d0 + clrl %d0 + movw %sp@(6),%d0 rts diff --git a/lib/libc/arch/m68k/net/ntohl.S b/lib/libc/arch/m68k/net/ntohl.S index d9f36a1b8bb..a920b6fd86b 100644 --- a/lib/libc/arch/m68k/net/ntohl.S +++ b/lib/libc/arch/m68k/net/ntohl.S @@ -36,5 +36,5 @@ #include "DEFS.h" ENTRY(ntohl) - movl sp@(4),d0 + movl %sp@(4),%d0 rts diff --git a/lib/libc/arch/m68k/net/ntohs.S b/lib/libc/arch/m68k/net/ntohs.S index 6a5227372f7..20864fcb6fa 100644 --- a/lib/libc/arch/m68k/net/ntohs.S +++ b/lib/libc/arch/m68k/net/ntohs.S @@ -36,6 +36,6 @@ #include "DEFS.h" ENTRY(ntohs) - clrl d0 - movw sp@(6),d0 + clrl %d0 + movw %sp@(6),%d0 rts diff --git a/lib/libc/arch/m68k/stdlib/abs.S b/lib/libc/arch/m68k/stdlib/abs.S index fd0f2c377d6..3dca0d6b333 100644 --- a/lib/libc/arch/m68k/stdlib/abs.S +++ b/lib/libc/arch/m68k/stdlib/abs.S @@ -36,8 +36,8 @@ #include "DEFS.h" ENTRY(abs) - movl sp@(4),d0 + movl %sp@(4),%d0 jge L1 - negl d0 + negl %d0 L1: rts diff --git a/lib/libc/arch/m68k/stdlib/insque.S b/lib/libc/arch/m68k/stdlib/insque.S index 2416ac09e41..a77e3f20e35 100644 --- a/lib/libc/arch/m68k/stdlib/insque.S +++ b/lib/libc/arch/m68k/stdlib/insque.S @@ -1,4 +1,4 @@ -/* $OpenBSD: insque.S,v 1.3 2009/10/28 06:49:55 deraadt Exp $ */ +/* $OpenBSD: insque.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -40,11 +40,11 @@ #include "DEFS.h" ENTRY(insque) - movl sp@(8),a0 - movl sp@(4),a1 - movl a0@,a1@ - movl a0,a1@(4) - movl a1,a0@ - movl a1@,a0 - movl a1,a0@(4) + movl %sp@(8),%a0 + movl %sp@(4),%a1 + movl %a0@,%a1@ + movl %a0,%a1@(4) + movl %a1,%a0@ + movl %a1@,%a0 + movl %a1,%a0@(4) rts diff --git a/lib/libc/arch/m68k/stdlib/remque.S b/lib/libc/arch/m68k/stdlib/remque.S index 0b4def14aff..80175876cec 100644 --- a/lib/libc/arch/m68k/stdlib/remque.S +++ b/lib/libc/arch/m68k/stdlib/remque.S @@ -1,4 +1,4 @@ -/* $OpenBSD: remque.S,v 1.3 2009/10/28 06:49:55 deraadt Exp $ */ +/* $OpenBSD: remque.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -40,9 +40,9 @@ #include "DEFS.h" ENTRY(remque) - movl sp@(4),a0 - movl a0@,a1 - movl a0@(4),a0 - movl a0,a1@(4) - movl a1,a0@ + movl %sp@(4),%a0 + movl %a0@,%a1 + movl %a0@(4),%a0 + movl %a0,%a1@(4) + movl %a1,%a0@ rts diff --git a/lib/libc/arch/m68k/string/bcmp.S b/lib/libc/arch/m68k/string/bcmp.S index 6aa048e5a8f..e786fec6947 100644 --- a/lib/libc/arch/m68k/string/bcmp.S +++ b/lib/libc/arch/m68k/string/bcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bcmp.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: bcmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -45,38 +45,38 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteq | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteq: - moveq #1,d0 + moveq #1,%d0 bcdone: rts diff --git a/lib/libc/arch/m68k/string/bcopy.S b/lib/libc/arch/m68k/string/bcopy.S index 457bd8c9821..5be54a74a63 100644 --- a/lib/libc/arch/m68k/string/bcopy.S +++ b/lib/libc/arch/m68k/string/bcopy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bcopy.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: bcopy.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -52,72 +52,74 @@ ENTRY(memmove) ENTRY(bcopy) #endif #endif - movl sp@(12),d1 | check count + movl %sp@(12),%d1 | check count beq bcdone | == 0, do not do anything #if defined(MEMCOPY) || defined(MEMMOVE) - movl sp@(4),a1 | dest address - movl sp@(8),a0 | src address + movl %sp@(4),%a1 | dest address + movl %sp@(8),%a0 | src address #else - movl sp@(4),a0 | src address - movl sp@(8),a1 | dest address + movl %sp@(4),%a0 | src address + movl %sp@(8),%a1 | dest address #endif - cmpl a1,a0 | src after dest? + cmpl %a1,%a0 | src after dest? blt bcback | yes, must copy backwards - movl a0,d0 - btst #0,d0 | src address odd? + movl %a0,%d0 + btst #0,%d0 | src address odd? beq bcfeven | no, skip alignment - movb a0@+,a1@+ | yes, copy a byte - subql #1,d1 | adjust count + movb %a0@+,%a1@+ | yes, copy a byte + subql #1,%d1 | adjust count beq bcdone | count 0, all done bcfeven: - movl a1,d0 - btst #0,d0 | dest address odd? + movl %a1,%d0 + btst #0,%d0 | dest address odd? bne bcfbloop | yes, no hope for alignment, copy bytes - movl d1,d0 | no, both even - lsrl #2,d0 | convert count to longword count + movl %d1,%d0 | no, both even + lsrl #2,%d0 | convert count to longword count beq bcfbloop | count 0, skip longword loop bcflloop: - movl a0@+,a1@+ | copy a longword - subql #1,d0 | adjust count + movl %a0@+,%a1@+ | copy a longword + subql #1,%d0 | adjust count bne bcflloop | still more, keep copying - andl #3,d1 | what remains + andl #3,%d1 | what remains beq bcdone | nothing, all done bcfbloop: - movb a0@+,a1@+ | copy a byte - subql #1,d1 | adjust count + movb %a0@+,%a1@+ | copy a byte + subql #1,%d1 | adjust count bne bcfbloop | still more, keep going bcdone: #if defined(MEMCOPY) || defined(MEMMOVE) - movl sp@(4),d0 | dest address + movl %sp@(4),%d0 | dest address + moveal %d0,%a0 #endif rts bcback: - addl d1,a0 | src pointer to end - addl d1,a1 | dest pointer to end - movl a0,d0 - btst #0,d0 | src address odd? + addl %d1,%a0 | src pointer to end + addl %d1,%a1 | dest pointer to end + movl %a0,%d0 + btst #0,%d0 | src address odd? beq bcbeven | no, skip alignment - movb a0@-,a1@- | yes, copy a byte - subql #1,d1 | adjust count + movb %a0@-,%a1@- | yes, copy a byte + subql #1,%d1 | adjust count beq bcdone | count 0, all done bcbeven: - movl a1,d0 - btst #0,d0 | dest address odd? + movl %a1,%d0 + btst #0,%d0 | dest address odd? bne bcbbloop | yes, no hope for alignment, copy bytes - movl d1,d0 | no, both even - lsrl #2,d0 | convert count to longword count + movl %d1,%d0 | no, both even + lsrl #2,%d0 | convert count to longword count beq bcbbloop | count 0, skip longword loop bcblloop: - movl a0@-,a1@- | copy a longword - subql #1,d0 | adjust count + movl %a0@-,%a1@- | copy a longword + subql #1,%d0 | adjust count bne bcblloop | still more, keep copying - andl #3,d1 | what remains + andl #3,%d1 | what remains beq bcdone | nothing, all done bcbbloop: - movb a0@-,a1@- | copy a byte - subql #1,d1 | adjust count + movb %a0@-,%a1@- | copy a byte + subql #1,%d1 | adjust count bne bcbbloop | still more, keep going #if defined(MEMCOPY) || defined(MEMMOVE) - movl sp@(4),d0 | dest address + movl %sp@(4),%d0 | dest address + moveal %d0,%a0 #endif rts diff --git a/lib/libc/arch/m68k/string/bzero.S b/lib/libc/arch/m68k/string/bzero.S index 4d244f3b075..a9615410e25 100644 --- a/lib/libc/arch/m68k/string/bzero.S +++ b/lib/libc/arch/m68k/string/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: bzero.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -44,28 +44,28 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bzero) - movl sp@(4),a0 | destination - movl sp@(8),d0 | count + movl %sp@(4),%a0 | destination + movl %sp@(8),%d0 | count beq bzdone | nothing to do - movl a0,d1 - btst #0,d1 | address odd? + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - clrb a0@+ | yes, clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | yes, clear a byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - movl d0,d1 - lsrl #2,d1 | convert to longword count + movl %d0,%d1 + lsrl #2,%d1 | convert to longword count beq bzbloop | no longwords, skip loop bzlloop: - clrl a0@+ | clear a longword - subql #1,d1 | adjust count + clrl %a0@+ | clear a longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - clrb a0@+ | clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | clear a byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: rts diff --git a/lib/libc/arch/m68k/string/ffs.S b/lib/libc/arch/m68k/string/ffs.S index da7eb9e2d93..0cbd45426d0 100644 --- a/lib/libc/arch/m68k/string/ffs.S +++ b/lib/libc/arch/m68k/string/ffs.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: ffs.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,11 +37,11 @@ /* bit = ffs(value) */ ENTRY(ffs) - movl sp@(4),d0 - movl d0,d1 - negl d0 - andl d0,d1 - movql #32,d0 - bfffo d1{#0:#32},d1 - subl d1,d0 + movl %sp@(4),%d0 + movl %d0,%d1 + negl %d0 + andl %d0,%d1 + movql #32,%d0 + bfffo %d1{#0:#32},%d1 + subl %d1,%d0 rts diff --git a/lib/libc/arch/m68k/string/index.S b/lib/libc/arch/m68k/string/index.S index c1785302cf1..3d637e12bb3 100644 --- a/lib/libc/arch/m68k/string/index.S +++ b/lib/libc/arch/m68k/string/index.S @@ -1,4 +1,4 @@ -/* $OpenBSD: index.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: index.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -39,15 +39,16 @@ ENTRY(strchr) #else ENTRY(index) #endif - movl sp@(4),a0 | string - movb sp@(11),d0 | char to look for + movl %sp@(4),%a0 | string + movb %sp@(11),%d0 | char to look for ixloop: - cmpb a0@,d0 | found our char? + cmpb %a0@,%d0 | found our char? beq ixfound | yes, break out - tstb a0@+ | null? + tstb %a0@+ | null? bne ixloop | no, keep going - moveq #0,d0 | not found, return null + moveq #0,%d0 | not found, return null + moveal %d0,%a0 rts ixfound: - movl a0,d0 | found, return pointer + movl %a0,%d0 | found, return pointer rts diff --git a/lib/libc/arch/m68k/string/memcmp.S b/lib/libc/arch/m68k/string/memcmp.S index 7a923368a5c..b34565d42bb 100644 --- a/lib/libc/arch/m68k/string/memcmp.S +++ b/lib/libc/arch/m68k/string/memcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memcmp.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: memcmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -45,47 +45,47 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteql | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteql: - subql #4,a0 - subql #4,a1 - movl #4,d0 + subql #4,%a0 + subql #4,%a1 + movl #4,%d0 jra bcbloop bcnoteq: - clrl d0 - clrl d1 - movb a0@-,d0 - movb a1@-,d1 - subl d1,d0 + clrl %d0 + clrl %d1 + movb %a0@-,%d0 + movb %a1@-,%d1 + subl %d1,%d0 bcdone: rts diff --git a/lib/libc/arch/m68k/string/memset.S b/lib/libc/arch/m68k/string/memset.S index ce5807e09a5..2d868d36036 100644 --- a/lib/libc/arch/m68k/string/memset.S +++ b/lib/libc/arch/m68k/string/memset.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memset.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: memset.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -44,59 +44,43 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memset) - movl d2,sp@- - movl sp@(8),a0 | destination - movl sp@(16),d0 | count + movl %d2,%sp@- + movl %sp@(8),%a0 | destination + movl %sp@(16),%d0 | count beq bzdone | nothing to do - movb sp@(15),d2 | character - movl a0,d1 - btst #0,d1 | address odd? + movb %sp@(15),%d2 | character + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - cmpl #15,d0 + cmpl #15,%d0 ble bzbloop | too small to be worthwhile - clrl d1 | replicate byte to fill longword - movb d2,d1 - movl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - movl d0,d1 | convert to longword count - lsrl #2,d1 -#ifdef DEBUG - moveml #0xffff,sp@- - movl d2,sp@- - movl d1,sp@- - movl d0,sp@- - movl a0,sp@- - movl #foo,sp@- - jsr _printf - addl #20,sp - moveml sp@+,#0xffff -#endif + clrl %d1 | replicate byte to fill longword + movb %d2,%d1 + movl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + movl %d0,%d1 | convert to longword count + lsrl #2,%d1 bzlloop: - movl d2,a0@+ | set one longword - subql #1,d1 | adjust count + movl %d2,%a0@+ | set one longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: - movl sp@(8),d0 | return destination - movl sp@+,d2 + movl %sp@(8),%d0 | return destination + moveal %d0,%a0 + movl %sp@+,%d2 rts - -#ifdef DEBUG - .globl _printf -foo: - .asciz "a0=%08x d0=%08x d1=%08x d2=%08x\n" -#endif diff --git a/lib/libc/arch/m68k/string/rindex.S b/lib/libc/arch/m68k/string/rindex.S index e6cd50d0a4b..70fff50a7f7 100644 --- a/lib/libc/arch/m68k/string/rindex.S +++ b/lib/libc/arch/m68k/string/rindex.S @@ -1,4 +1,4 @@ -/* $OpenBSD: rindex.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: rindex.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -39,15 +39,16 @@ ENTRY(strrchr) #else ENTRY(rindex) #endif - movl sp@(4),a0 | string - movb sp@(11),d0 | char to look for - subl a1,a1 | clear rindex pointer + movl %sp@(4),%a0 | string + movb %sp@(11),%d0 | char to look for + subl %a1,%a1 | clear rindex pointer rixloop: - cmpb a0@,d0 | found our char? + cmpb %a0@,%d0 | found our char? bne rixnope | no, check for null - movl a0,a1 | yes, remember location + movl %a0,%a1 | yes, remember location rixnope: - tstb a0@+ | null? + tstb %a0@+ | null? bne rixloop | no, keep going - movl a1,d0 | return value + movl %a1,%d0 | return value + moveal %d0,%a0 rts diff --git a/lib/libc/arch/m68k/string/strcat.S b/lib/libc/arch/m68k/string/strcat.S index aca9c9ee0bf..ca149eb2ff1 100644 --- a/lib/libc/arch/m68k/string/strcat.S +++ b/lib/libc/arch/m68k/string/strcat.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcat.S,v 1.7 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strcat.S,v 1.8 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,20 +36,21 @@ #if defined(APIWARN) #APP - .stabs "warning: strcat() is almost always misused, consider using strlcat()",30,0,0,0 - .stabs "_strcat",1,0,0,0 + .section .gnu.warning.strcat + .ascii "warning: strcat() is almost always misused, consider using strlcat()" #NO_APP #endif ENTRY(strcat) - movl sp@(8),a0 | a0 = fromaddr - movl sp@(4),d0 | return value is toaddr - movl d0,a1 | a1 = toaddr + movl %sp@(8),%a0 | a0 = fromaddr + movl %sp@(4),%d0 | return value is toaddr + movl %d0,%a1 | a1 = toaddr slloop: - tstb a1@+ | null? + tstb %a1@+ | null? bne slloop | no, keep going - subql #1,a1 + subql #1,%a1 scloop: - movb a0@+,a1@+ | copy a byte + movb %a0@+,%a1@+ | copy a byte bne scloop | copied non-null, keep going + moveal %d0,%a0 rts diff --git a/lib/libc/arch/m68k/string/strcmp.S b/lib/libc/arch/m68k/string/strcmp.S index 5184eb9d2fa..039d9118a09 100644 --- a/lib/libc/arch/m68k/string/strcmp.S +++ b/lib/libc/arch/m68k/string/strcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strcmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -41,17 +41,17 @@ * right?? */ ENTRY(strcmp) - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? bne scloop | no, keep going - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/lib/libc/arch/m68k/string/strcpy.S b/lib/libc/arch/m68k/string/strcpy.S index 045cd87382e..edd326df6d0 100644 --- a/lib/libc/arch/m68k/string/strcpy.S +++ b/lib/libc/arch/m68k/string/strcpy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcpy.S,v 1.8 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strcpy.S,v 1.9 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,16 +37,17 @@ #if defined(APIWARN) #APP - .stabs "warning: strcpy() is almost always misused, consider using strlcpy()",30,0,0,0 - .stabs "_strcpy",1,0,0,0 + .section .gnu.warning.strcpy + .ascii "warning: strcpy() is almost always misused, consider using strlcpy()" #NO_APP #endif ENTRY(strcpy) - movl sp@(8),a0 | a0 = fromaddr - movl sp@(4),d0 | return value is toaddr - movl d0,a1 | a1 = toaddr + movl %sp@(8),%a0 | a0 = fromaddr + movl %sp@(4),%d0 | return value is toaddr + movl %d0,%a1 | a1 = toaddr scloop: - movb a0@+,a1@+ | copy a byte + movb %a0@+,%a1@+ | copy a byte bne scloop | copied non-null, keep going + moveal %d0,%a0 rts diff --git a/lib/libc/arch/m68k/string/strlcpy.S b/lib/libc/arch/m68k/string/strlcpy.S index 20a2432a8e9..85243e5a2a7 100644 --- a/lib/libc/arch/m68k/string/strlcpy.S +++ b/lib/libc/arch/m68k/string/strlcpy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strlcpy.S,v 1.7 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strlcpy.S,v 1.8 2013/02/02 13:29:14 miod Exp $ */ /* * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> * @@ -26,31 +26,32 @@ */ ENTRY(strlcpy) - movl sp@(8),a0 | a0 = src - movl a0,a1 | working copy of src ptr - movl a0,d0 | return (d0) value is len(src) - notl d0 | take the complement of d0 + movl %sp@(8),%a0 | a0 = src + movl %a0,%a1 | working copy of src ptr + movl %a0,%d0 | return (d0) value is len(src) + notl %d0 | take the complement of d0 strlcpy_len: - tstb a1@+ | did we hit the terminating NUL? + tstb %a1@+ | did we hit the terminating NUL? bne strlcpy_len | nope, keep going - addl a1,d0 + addl %a1,%d0 | now set things up to do the copy - movl sp@(4),a1 | a1 = dst - movl sp@(12),d1 | d1 = count + movl %sp@(4),%a1 | a1 = dst + movl %sp@(12),%d1 | d1 = count beq strlcpy_done | zero count, just return - subql #1,d1 | subtract one for the NUL - cmpl d0, d1 | must set d1 to MIN(d0, d1) + subql #1,%d1 | subtract one for the NUL + cmpl %d0, %d1 | must set d1 to MIN(d0, d1) ble strlcpy_check | count - 1 <= len(src), so d1 is ok - movl d0, d1 | d1 is too big, set it to len(src) + movl %d0, %d1 | d1 is too big, set it to len(src) strlcpy_check: - tstl d1 | is d1 zero? + tstl %d1 | is d1 zero? beq strlcpy_clear | if so, skip copy and set byte to NUL strlcpy_copy: - movb a0@+,a1@+ | copy a byte - subql #1,d1 | decrement count + movb %a0@+,%a1@+ | copy a byte + subql #1,%d1 | decrement count bne strlcpy_copy | space left? continue copying... strlcpy_clear: - clrb a1@ | clear last byte + clrb %a1@ | clear last byte strlcpy_done: + moveal %d0,%a0 rts diff --git a/lib/libc/arch/m68k/string/strlen.S b/lib/libc/arch/m68k/string/strlen.S index 60af12589b7..f2ca58bbe58 100644 --- a/lib/libc/arch/m68k/string/strlen.S +++ b/lib/libc/arch/m68k/string/strlen.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strlen.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strlen.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,11 +35,11 @@ #include "DEFS.h" ENTRY(strlen) - movl sp@(4),a0 | string - movl a0,d0 - notl d0 + movl %sp@(4),%a0 | string + movl %a0,%d0 + notl %d0 slloop: - tstb a0@+ | null? + tstb %a0@+ | null? bne slloop | no, keep going - addl a0,d0 + addl %a0,%d0 rts diff --git a/lib/libc/arch/m68k/string/strncmp.S b/lib/libc/arch/m68k/string/strncmp.S index ccfcd09d144..ed6a3022de1 100644 --- a/lib/libc/arch/m68k/string/strncmp.S +++ b/lib/libc/arch/m68k/string/strncmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncmp.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strncmp.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -41,22 +41,22 @@ * right?? */ ENTRY(strncmp) - movl sp@(12),d1 | count + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? beq scdone | yes, all done - subql #1,d1 | no, adjust count + subql #1,%d1 | no, adjust count bne scloop | more to do, keep going scdone: - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/lib/libc/arch/m68k/string/strncpy.S b/lib/libc/arch/m68k/string/strncpy.S index c83fc1d5744..b29bd43f6b3 100644 --- a/lib/libc/arch/m68k/string/strncpy.S +++ b/lib/libc/arch/m68k/string/strncpy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncpy.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: strncpy.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,20 +35,21 @@ #include "DEFS.h" ENTRY(strncpy) - movl sp@(4),d0 | return value is toaddr - movl sp@(12),d1 | count + movl %sp@(4),%d0 | return value is toaddr + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(8),a0 | a0 = fromaddr - movl d0,a1 | a1 = toaddr + movl %sp@(8),%a0 | a0 = fromaddr + movl %d0,%a1 | a1 = toaddr scloop: - movb a0@+,a1@+ | copy a byte + movb %a0@+,%a1@+ | copy a byte beq scploop | copied null, go pad if necessary - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne scloop | more room, keep going scdone: + moveal %d0,%a0 rts scploop: - subql #1,d1 | adjust count + subql #1,%d1 | adjust count beq scdone | no more room, all done - clrb a1@+ | clear a byte + clrb %a1@+ | clear a byte jra scploop | keep going diff --git a/lib/libc/arch/m68k/string/swab.S b/lib/libc/arch/m68k/string/swab.S index be00b9d7dd8..bd8c4679710 100644 --- a/lib/libc/arch/m68k/string/swab.S +++ b/lib/libc/arch/m68k/string/swab.S @@ -1,4 +1,4 @@ -/* $OpenBSD: swab.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: swab.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -27,17 +27,17 @@ #include "DEFS.h" ENTRY(swab) - movl sp@(12),d1 | #bytes - lsrl #1,d1 | -> #words + movl %sp@(12),%d1 | #bytes + lsrl #1,%d1 | -> #words beq swab_end - subql #1,d1 | for proper dbf behaviour - movl sp@(4),a0 | src - movl sp@(8),a1 | and dst + subql #1,%d1 | for proper dbf behaviour + movl %sp@(4),%a0 | src + movl %sp@(8),%a1 | and dst swab_loop: - movw a0@+,d0 - rorw #8,d0 - movw d0,a1@+ - dbf d1,swab_loop + movw %a0@+,%d0 + rorw #8,%d0 + movw %d0,%a1@+ + dbf %d1,swab_loop swab_end: rts diff --git a/lib/libc/arch/m68k/sys/Ovfork.S b/lib/libc/arch/m68k/sys/Ovfork.S index c14d4ed3b94..e3c3cb7f8cd 100644 --- a/lib/libc/arch/m68k/sys/Ovfork.S +++ b/lib/libc/arch/m68k/sys/Ovfork.S @@ -1,4 +1,4 @@ -/* $OpenBSD: Ovfork.S,v 1.6 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: Ovfork.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -51,22 +51,21 @@ */ SYSENTRY(vfork) - movl sp@+,a0 - movl #SYS_vfork,d0 + movl %sp@+,%a0 + movl #SYS_vfork,%d0 trap #0 jcs err - subql #1,d1 /* from 1 to 0 in child, 0 to -1 in parent */ - andl d1,d0 - jmp a0@ + subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */ + andl %d1,%d0 + jmp %a0@ err: - .globl _errno + .globl _C_LABEL(errno) #ifdef __PIC__ - movel #__GLOBAL_OFFSET_TABLE_,a1 - lea pc@(0,a1:l),a1 - movl a1@(_errno:w),a1 - movl d0,a1@ + lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a1 + movl %a1@(_C_LABEL(errno)@GOT:w),%a1 + movl %d0,%a1@ #else - movl d0,_errno + movl %d0,_C_LABEL(errno) #endif - moveq #-1,d0 - jmp a0@ + moveq #-1,%d0 + jmp %a0@ diff --git a/lib/libc/arch/m68k/sys/__get_tcb.S b/lib/libc/arch/m68k/sys/__get_tcb.S new file mode 100644 index 00000000000..54ff014a9c9 --- /dev/null +++ b/lib/libc/arch/m68k/sys/__get_tcb.S @@ -0,0 +1,34 @@ +/* $OpenBSD: __get_tcb.S,v 1.1 2013/02/02 13:29:14 miod Exp $ */ +/* $NetBSD: shmat.S,v 1.2 2008/04/28 20:22:56 martin Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "SYS.h" + +SYSCALL(__get_tcb) + movl %d0,%a0 + rts diff --git a/lib/libc/arch/m68k/sys/brk.S b/lib/libc/arch/m68k/sys/brk.S index dbe3e2ded58..38f003e7937 100644 --- a/lib/libc/arch/m68k/sys/brk.S +++ b/lib/libc/arch/m68k/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.7 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.8 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,36 +35,36 @@ #include "SYS.h" .globl _end - .globl minbrk - .globl __curbrk + .globl _C_LABEL(__minbrk) + .globl _C_LABEL(__curbrk) .data -minbrk: .long _end +_C_LABEL(__minbrk): + .long _end .text ENTRY(brk) #ifdef __PIC__ - movl #__GLOBAL_OFFSET_TABLE_,a1 - lea pc@(0,a1:l),a1 - movl a1@(minbrk:w),a0 - movl a0@,d0 + lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a1 + movl %a1@(_C_LABEL(__minbrk)@GOT:w),%a0 + movl %a0@,%d0 #else - movl minbrk,d0 + movl _C_LABEL(__minbrk),%d0 #endif - cmpl sp@(4),d0 + cmpl %sp@(4),%d0 jls ok - movl d0,sp@(4) + movl %d0,%sp@(4) ok: - movl #SYS_break,d0 + movl #SYS_break,%d0 trap #0 jcs err #ifdef __PIC__ - movl a1@(__curbrk:w),a0 - movl sp@(4),a0@ + movl %a1@(_C_LABEL(__curbrk)@GOT:w),%a0 + movl %sp@(4),%a0@ #else - movl sp@(4),__curbrk + movl %sp@(4),_C_LABEL(__curbrk) #endif - clrl d0 + clrl %d0 rts err: - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/cerror.S b/lib/libc/arch/m68k/sys/cerror.S index 7a9c929ee0d..d76710d7308 100644 --- a/lib/libc/arch/m68k/sys/cerror.S +++ b/lib/libc/arch/m68k/sys/cerror.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cerror.S,v 1.8 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: cerror.S,v 1.9 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,16 +37,16 @@ WEAK_ALIAS(_cerror,__cerror) .even - .globl _errno -___cerror: + .globl _C_LABEL(errno) +__cerror: #ifdef __PIC__ - movl #__GLOBAL_OFFSET_TABLE_,a0 - lea pc@(0,a0:l),a0 - movl a0@(_errno:w),a0 - movl d0,a0@ + lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a0 + movl %a0@(_C_LABEL(errno)@GOT:w),%a0 + movl %d0,%a0@ #else - movl d0,_errno + movl %d0,_C_LABEL(errno) #endif - movl #-1,d0 - movl #-1,d1 + movl #-1,%d0 + movl #-1,%d1 + moveal %d0,%a0 rts diff --git a/lib/libc/arch/m68k/sys/exect.S b/lib/libc/arch/m68k/sys/exect.S index 7aab4517532..58318d67cfe 100644 --- a/lib/libc/arch/m68k/sys/exect.S +++ b/lib/libc/arch/m68k/sys/exect.S @@ -1,4 +1,4 @@ -/* $OpenBSD: exect.S,v 1.5 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: exect.S,v 1.6 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,6 +36,6 @@ #include <machine/psl.h> ENTRY(exect) - movl #SYS_execve,d0 + movl #SYS_execve,%d0 trap #0 - jra __cerror /* exect(file, argv, env) */ + jra PIC_PLT(__cerror) /* exect(file, argv, env) */ diff --git a/lib/libc/arch/m68k/sys/fork.S b/lib/libc/arch/m68k/sys/fork.S index 9c56d109914..eeeaa32cc52 100644 --- a/lib/libc/arch/m68k/sys/fork.S +++ b/lib/libc/arch/m68k/sys/fork.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fork.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: fork.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,6 +35,6 @@ #include "SYS.h" SYSCALL(fork) - subql #1,d1 /* from 1 to 0 in child, 0 to -1 in parent */ - andl d1,d0 + subql #1,%d1 /* from 1 to 0 in child, 0 to -1 in parent */ + andl %d1,%d0 rts /* pid = fork() */ diff --git a/lib/libc/arch/m68k/sys/sbrk.S b/lib/libc/arch/m68k/sys/sbrk.S index b2e880d73b1..a8d07a01a28 100644 --- a/lib/libc/arch/m68k/sys/sbrk.S +++ b/lib/libc/arch/m68k/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.6 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,32 +35,32 @@ #include "SYS.h" .globl _end - .globl __curbrk + .globl _C_LABEL(__curbrk) .data -__curbrk:.long _end +_C_LABEL(__curbrk): + .long _end .text ENTRY(sbrk) #ifdef __PIC__ - movl #__GLOBAL_OFFSET_TABLE_,a1 - lea pc@(0,a1:l),a1 - movl a1@(__curbrk:w),a1 - movl a1@,d0 + lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a1 + movl %a1@(_C_LABEL(__curbrk)@GOT:w),%a1 + movl %a1@,%d0 #else - movl __curbrk,d0 + movl _C_LABEL(__curbrk),%d0 #endif - addl d0,sp@(4) - movl #SYS_break,d0 + addl %d0,%sp@(4) + movl #SYS_break,%d0 trap #0 jcs err #ifdef __PIC__ - movl a1@,d0 - movl sp@(4),a1@ + movl %a1@,%d0 + movl %sp@(4),%a1@ #else - movl __curbrk,d0 - movl sp@(4),__curbrk + movl _C_LABEL(__curbrk),%d0 + movl %sp@(4),_C_LABEL(__curbrk) #endif rts err: - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/shmat.S b/lib/libc/arch/m68k/sys/shmat.S new file mode 100644 index 00000000000..edb1972fef4 --- /dev/null +++ b/lib/libc/arch/m68k/sys/shmat.S @@ -0,0 +1,34 @@ +/* $OpenBSD: shmat.S,v 1.1 2013/02/02 13:29:14 miod Exp $ */ +/* $NetBSD: shmat.S,v 1.2 2008/04/28 20:22:56 martin Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "SYS.h" + +SYSCALL(shmat) + movl %d0,%a0 + rts diff --git a/lib/libc/arch/m68k/sys/sigpending.S b/lib/libc/arch/m68k/sys/sigpending.S index 69b5ee80a7e..e42ba64273a 100644 --- a/lib/libc/arch/m68k/sys/sigpending.S +++ b/lib/libc/arch/m68k/sys/sigpending.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigpending.S,v 1.4 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: sigpending.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ #include "SYS.h" SYSCALL(sigpending) - movl sp@(4),a0 - movl d0,a0@ - clrl d0 + movl %sp@(4),%a0 + movl %d0,%a0@ + clrl %d0 rts diff --git a/lib/libc/arch/m68k/sys/sigprocmask.S b/lib/libc/arch/m68k/sys/sigprocmask.S index 848dc003991..2a40aba059c 100644 --- a/lib/libc/arch/m68k/sys/sigprocmask.S +++ b/lib/libc/arch/m68k/sys/sigprocmask.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigprocmask.S,v 1.6 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: sigprocmask.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,24 +35,24 @@ #include "SYS.h" SYSENTRY(sigprocmask) - tstl sp@(8) /* check new sigset pointer */ + tstl %sp@(8) /* check new sigset pointer */ jne gotptr /* if not null, indirect */ -/* movl #0,sp@(8) /* null mask pointer: block empty set */ - movl #1,sp@(4) /* SIG_BLOCK */ +/* movl #0,%sp@(8) */ /* null mask pointer: block empty set */ + movl #1,%sp@(4) /* SIG_BLOCK */ jra doit gotptr: - movl sp@(8),a0 - movl a0@,sp@(8) /* indirect to new mask arg */ + movl %sp@(8),%a0 + movl %a0@,%sp@(8) /* indirect to new mask arg */ doit: - movl #SYS_sigprocmask,d0 + movl #SYS_sigprocmask,%d0 trap #0 jcs err - tstl sp@(12) /* test if old mask requested */ + tstl %sp@(12) /* test if old mask requested */ jeq out - movl sp@(12),a0 - movl d0,a0@ /* store old mask */ + movl %sp@(12),%a0 + movl %d0,%a0@ /* store old mask */ out: - clrl d0 + clrl %d0 rts err: - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/sigreturn.S b/lib/libc/arch/m68k/sys/sigreturn.S index 086230173d9..1071d52b4e9 100644 --- a/lib/libc/arch/m68k/sys/sigreturn.S +++ b/lib/libc/arch/m68k/sys/sigreturn.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigreturn.S,v 1.8 2012/09/01 09:55:50 miod Exp $ */ +/* $OpenBSD: sigreturn.S,v 1.9 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -42,17 +42,17 @@ /* XXX should bring into line with __ENTRY in SYS.h */ #ifdef __STDC__ #define ENTRY(x) \ - .globl _##x; .even; _##x:; moveml _IMMEDIATE_ 0xC0C0,sp@-; .data; \ - PROF##x:; .long 0; .text; lea PROF##x,a0; jbsr mcount; \ - moveml sp@+,_IMMEDIATE_ 0x0303 + .globl _##x; .even; _##x:; moveml _IMMEDIATE_ 0xC0C0,%sp@-; .data; \ + PROF##x:; .long 0; .text; lea PROF##x,%a0; jbsr mcount; \ + moveml %sp@+,_IMMEDIATE_ 0x0303 #else #define ENTRY(x) \ - .globl _/**/x; .even; _/**/x:; moveml #0xC0C0,sp@-; .data; \ - PROF/**/x:; .long 0; .text; lea PROF/**/x,a0; jbsr mcount; \ - moveml sp@+,#0x0303 + .globl _/**/x; .even; _/**/x:; moveml #0xC0C0,%sp@-; .data; \ + PROF/**/x:; .long 0; .text; lea PROF/**/x,%a0; jbsr mcount; \ + moveml %sp@+,#0x0303 #endif #endif /* PROF */ SYSENTRY(sigreturn) trap #1 /* signals sigreturn() */ - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/sigsuspend.S b/lib/libc/arch/m68k/sys/sigsuspend.S index b4fe69f7630..63c216cc507 100644 --- a/lib/libc/arch/m68k/sys/sigsuspend.S +++ b/lib/libc/arch/m68k/sys/sigsuspend.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigsuspend.S,v 1.6 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: sigsuspend.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,12 +35,12 @@ #include "SYS.h" SYSENTRY(sigsuspend) - movl sp@(4),a0 - movl a0@,sp@(4) /* indirect to mask arg */ - movl #SYS_sigsuspend,d0 + movl %sp@(4),%a0 + movl %a0@,%sp@(4) /* indirect to mask arg */ + movl #SYS_sigsuspend,%d0 trap #0 jcs err - clrl d0 /* shouldn't happen */ + clrl %d0 /* shouldn't happen */ rts err: - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/syscall.S b/lib/libc/arch/m68k/sys/syscall.S index 8881a0678fe..e8a30c96325 100644 --- a/lib/libc/arch/m68k/sys/syscall.S +++ b/lib/libc/arch/m68k/sys/syscall.S @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.S,v 1.6 2005/08/07 16:40:14 espie Exp $ */ +/* $OpenBSD: syscall.S,v 1.7 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,9 +35,9 @@ #include "SYS.h" SYSENTRY(syscall) - clrl d0 + clrl %d0 trap #0 jcs err rts err: - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/arch/m68k/sys/tfork_thread.S b/lib/libc/arch/m68k/sys/tfork_thread.S index b44442f2bcb..59e3cf246dd 100644 --- a/lib/libc/arch/m68k/sys/tfork_thread.S +++ b/lib/libc/arch/m68k/sys/tfork_thread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: tfork_thread.S,v 1.2 2012/06/21 00:56:59 guenther Exp $ */ +/* $OpenBSD: tfork_thread.S,v 1.3 2013/02/02 13:29:14 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -34,8 +34,8 @@ ENTRY(__tfork_thread) /* * Move info for the new thread into registers. */ - movl sp@(16), a0 /* arg */ - movl sp@(12), a1 /* func */ + movl %sp@(16), %a0 /* arg */ + movl %sp@(12), %a1 /* func */ /* * We did not create a frame, so the stack is ready for an immediate @@ -44,7 +44,7 @@ ENTRY(__tfork_thread) __DO_SYSCALL(__tfork) jcs 9f - tstl d0 + tstl %d0 jeq 1f /* @@ -56,9 +56,9 @@ ENTRY(__tfork_thread) /* * child process: invoke function, then exit. */ - movl a0, sp@- /* stack with arg pushed on it */ - jsr a1@ /* func */ - addq #4, sp + movl %a0, %sp@- /* stack with arg pushed on it */ + jsr %a1@ /* func */ + addq #4, %sp __DO_SYSCALL(__threxit) @@ -66,4 +66,4 @@ ENTRY(__tfork_thread) /* * system call failure. */ - jra __cerror + jra PIC_PLT(__cerror) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 6b2fb42ce1d..fd814a6c6ca 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.107 2012/09/04 03:10:42 okan Exp $ +# $OpenBSD: Makefile.inc,v 1.108 2013/02/02 13:29:14 miod Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -22,7 +22,8 @@ SRCS+= ftruncate.c lseek.c mquery.c mmap.c ptrace.c semctl.c truncate.c \ # stack protector helper functions SRCS+= stack_protector.c -# modules with default implementations on all architectures: +# modules with default implementations on all architectures, unless overriden +# below: ASM= __get_tcb.o __getcwd.o __semctl.o __set_tcb.o __syscall.o \ __sysctl.o __threxit.o __thrsigdivert.o __thrsleep.o \ __thrwakeup.o accept.o access.o acct.o adjfreq.o adjtime.o \ @@ -57,6 +58,15 @@ ASM= __get_tcb.o __getcwd.o __semctl.o __set_tcb.o __syscall.o \ symlinkat.o sync.o sysarch.o umask.o unlink.o unlinkat.o \ unmount.o utimensat.o utimes.o wait4.o write.o writev.o +# modules with specific implementations on some architectures, and the +# default implementation elsewhere: +SRCS_m68k= __get_tcb.S shmat.S chdir.S + +SRCS+= ${SRCS_${MACHINE_CPU}} +.for i in ${SRCS_${MACHINE_CPU}} +ASM:= ${ASM:N${i:R}.o} +.endfor + GASM= ${ASM:.o=.go} PASM= ${ASM:.o=.po} SASM= ${ASM:.o=.so} diff --git a/lib/libm/arch/mc68881/e_acos.S b/lib/libm/arch/mc68881/e_acos.S index b37d54ba829..ae27b657d13 100644 --- a/lib/libm/arch/mc68881/e_acos.S +++ b/lib/libm/arch/mc68881/e_acos.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_acos.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_acos.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(acos) - facosd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + facosd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_acosf.S b/lib/libm/arch/mc68881/e_acosf.S index 4b32011e520..9e11c0e26c6 100644 --- a/lib/libm/arch/mc68881/e_acosf.S +++ b/lib/libm/arch/mc68881/e_acosf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_acosf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_acosf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(acosf) - facoss sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + facoss %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_acosl.S b/lib/libm/arch/mc68881/e_acosl.S index 2b6acc27698..13b21bf7022 100644 --- a/lib/libm/arch/mc68881/e_acosl.S +++ b/lib/libm/arch/mc68881/e_acosl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_acosl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: e_acosl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(acosl) - facosx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + facosx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_asin.S b/lib/libm/arch/mc68881/e_asin.S index 38d8910cd1f..86bf36faaaa 100644 --- a/lib/libm/arch/mc68881/e_asin.S +++ b/lib/libm/arch/mc68881/e_asin.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_asin.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_asin.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(asin) - fasind sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fasind %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_asinf.S b/lib/libm/arch/mc68881/e_asinf.S index e24dff81df6..8c413291e9e 100644 --- a/lib/libm/arch/mc68881/e_asinf.S +++ b/lib/libm/arch/mc68881/e_asinf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_asinf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_asinf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(asinf) - fasins sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fasins %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_asinl.S b/lib/libm/arch/mc68881/e_asinl.S index 558f0bc1c3a..14f71ee9db2 100644 --- a/lib/libm/arch/mc68881/e_asinl.S +++ b/lib/libm/arch/mc68881/e_asinl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_asinl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: e_asinl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(asinl) - fasinx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fasinx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_atanh.S b/lib/libm/arch/mc68881/e_atanh.S index 4084b0b3bff..9ff8c643167 100644 --- a/lib/libm/arch/mc68881/e_atanh.S +++ b/lib/libm/arch/mc68881/e_atanh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_atanh.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_atanh.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(atanh) - fatanhd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fatanhd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_atanhf.S b/lib/libm/arch/mc68881/e_atanhf.S index 34d36eba476..b8ae826a9a6 100644 --- a/lib/libm/arch/mc68881/e_atanhf.S +++ b/lib/libm/arch/mc68881/e_atanhf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_atanhf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_atanhf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(atanhf) - fatanhs sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fatanhs %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_cosh.S b/lib/libm/arch/mc68881/e_cosh.S index b2cf85b7cdb..1ba4f03fa43 100644 --- a/lib/libm/arch/mc68881/e_cosh.S +++ b/lib/libm/arch/mc68881/e_cosh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_cosh.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_cosh.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(cosh) - fcoshd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fcoshd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_coshf.S b/lib/libm/arch/mc68881/e_coshf.S index 52120c75951..17d99f5bc7e 100644 --- a/lib/libm/arch/mc68881/e_coshf.S +++ b/lib/libm/arch/mc68881/e_coshf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_coshf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_coshf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(coshf) - fcoshs sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fcoshs %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_exp.S b/lib/libm/arch/mc68881/e_exp.S index 3fd33ea1791..2a0c4047d8b 100644 --- a/lib/libm/arch/mc68881/e_exp.S +++ b/lib/libm/arch/mc68881/e_exp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_exp.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_exp.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(exp) - fetoxd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fetoxd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_expf.S b/lib/libm/arch/mc68881/e_expf.S index 0448c95376f..ba57b8248b3 100644 --- a/lib/libm/arch/mc68881/e_expf.S +++ b/lib/libm/arch/mc68881/e_expf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_expf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_expf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(expf) - fetoxs sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fetoxs %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_log.S b/lib/libm/arch/mc68881/e_log.S index ecca1c78db9..a8a71170459 100644 --- a/lib/libm/arch/mc68881/e_log.S +++ b/lib/libm/arch/mc68881/e_log.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(log) - flognd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + flognd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_log10.S b/lib/libm/arch/mc68881/e_log10.S index 9be1b63c0b5..4efa21a8c58 100644 --- a/lib/libm/arch/mc68881/e_log10.S +++ b/lib/libm/arch/mc68881/e_log10.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log10.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_log10.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(log10) - flog10d sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + flog10d %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_log10f.S b/lib/libm/arch/mc68881/e_log10f.S index 6bd43ed0ee9..6727b9a7475 100644 --- a/lib/libm/arch/mc68881/e_log10f.S +++ b/lib/libm/arch/mc68881/e_log10f.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_log10f.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_log10f.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(log10f) - flog10s sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + flog10s %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_logf.S b/lib/libm/arch/mc68881/e_logf.S index e18f337741e..27d80badb40 100644 --- a/lib/libm/arch/mc68881/e_logf.S +++ b/lib/libm/arch/mc68881/e_logf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_logf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_logf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(logf) - flogns sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + flogns %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_remainder.S b/lib/libm/arch/mc68881/e_remainder.S index 87dd01cfc63..acb1a68d064 100644 --- a/lib/libm/arch/mc68881/e_remainder.S +++ b/lib/libm/arch/mc68881/e_remainder.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_remainder.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_remainder.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -7,9 +7,6 @@ #include <machine/asm.h> ENTRY(remainder) - fmoved sp@(4),fp0 - fremd sp@(12),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fmoved %sp@(4),%fp0 + fremd %sp@(12),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_remainderf.S b/lib/libm/arch/mc68881/e_remainderf.S index e3d5d92440b..5f7cb5bd165 100644 --- a/lib/libm/arch/mc68881/e_remainderf.S +++ b/lib/libm/arch/mc68881/e_remainderf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_remainderf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_remainderf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -7,8 +7,6 @@ #include <machine/asm.h> ENTRY(remainderf) - fmoves sp@(4),fp0 - frems sp@(8),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fmoves %sp@(4),%fp0 + frems %sp@(8),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_scalb.S b/lib/libm/arch/mc68881/e_scalb.S index f133e0621c1..8107744054f 100644 --- a/lib/libm/arch/mc68881/e_scalb.S +++ b/lib/libm/arch/mc68881/e_scalb.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_scalb.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_scalb.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -7,11 +7,8 @@ #include <machine/asm.h> ENTRY(scalb) - fmoved sp@(4),fp0 + fmoved %sp@(4),%fp0 fbeq Ldone - fscaled sp@(12),fp0 + fscaled %sp@(12),%fp0 Ldone: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libm/arch/mc68881/e_scalbf.S b/lib/libm/arch/mc68881/e_scalbf.S index 683a515cbc8..a86d4d17e05 100644 --- a/lib/libm/arch/mc68881/e_scalbf.S +++ b/lib/libm/arch/mc68881/e_scalbf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_scalbf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_scalbf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. * Public domain. @@ -7,10 +7,8 @@ #include <machine/asm.h> ENTRY(scalbf) - fmoves sp@(4),fp0 + fmoves %sp@(4),%fp0 fbeq Ldone - fscales sp@(8),fp0 + fscales %sp@(8),%fp0 Ldone: - fmoves fp0,sp@- - movel sp@+,d0 rts diff --git a/lib/libm/arch/mc68881/e_sinh.S b/lib/libm/arch/mc68881/e_sinh.S index 10e35b20882..28f20de1712 100644 --- a/lib/libm/arch/mc68881/e_sinh.S +++ b/lib/libm/arch/mc68881/e_sinh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sinh.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sinh.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(sinh) - fsinhd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fsinhd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_sinhf.S b/lib/libm/arch/mc68881/e_sinhf.S index 781d046fda2..a1236689ba0 100644 --- a/lib/libm/arch/mc68881/e_sinhf.S +++ b/lib/libm/arch/mc68881/e_sinhf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sinhf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_sinhf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(sinhf) - fsinhs sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fsinhs %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_sqrt.S b/lib/libm/arch/mc68881/e_sqrt.S index df4f21f01e1..72e3cec3dc6 100644 --- a/lib/libm/arch/mc68881/e_sqrt.S +++ b/lib/libm/arch/mc68881/e_sqrt.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrt.S,v 1.4 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sqrt.S,v 1.5 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -41,8 +41,5 @@ */ ENTRY(sqrt) - fsqrtd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fsqrtd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_sqrtf.S b/lib/libm/arch/mc68881/e_sqrtf.S index 1c507b68368..446a240bc0c 100644 --- a/lib/libm/arch/mc68881/e_sqrtf.S +++ b/lib/libm/arch/mc68881/e_sqrtf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: e_sqrtf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -41,7 +41,5 @@ */ ENTRY(sqrtf) - fsqrts sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fsqrts %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/e_sqrtl.S b/lib/libm/arch/mc68881/e_sqrtl.S index 8681ad49c0d..dc5b9184c24 100644 --- a/lib/libm/arch/mc68881/e_sqrtl.S +++ b/lib/libm/arch/mc68881/e_sqrtl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: e_sqrtl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -40,9 +40,6 @@ * to the rounding mode. */ -.lcomm _ASM_LABEL(__rv),12 ENTRY(sqrtl) - fsqrtx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fsqrtx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/fenv.c b/lib/libm/arch/mc68881/fenv.c index 1fb626741e3..9a25b9b7832 100644 --- a/lib/libm/arch/mc68881/fenv.c +++ b/lib/libm/arch/mc68881/fenv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.c,v 1.3 2012/12/05 23:20:03 deraadt Exp $ */ +/* $OpenBSD: fenv.c,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /* * Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org> @@ -44,13 +44,13 @@ feclearexcept(int excepts) excepts &= FE_ALL_EXCEPT; /* Store the current floating-point status register */ - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fpsr)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fpsr)); /* Clear the requested floating-point exceptions */ fpsr &= ~excepts; /* Load the floating-point status register */ - __asm__ __volatile__ ("fmovel %0, fpsr" : : "dm" (fpsr)); + __asm__ __volatile__ ("fmovel %0, %%fpsr" : : "dm" (fpsr)); return (0); } @@ -68,7 +68,7 @@ fegetexceptflag(fexcept_t *flagp, int excepts) excepts &= FE_ALL_EXCEPT; /* Store the current floating-point status register */ - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fpsr)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fpsr)); /* Store the results in flagp */ *flagp = fpsr & excepts; @@ -132,14 +132,14 @@ fesetexceptflag(const fexcept_t *flagp, int excepts) excepts &= FE_ALL_EXCEPT; /* Store the current floating-point status register */ - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fpsr)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fpsr)); /* Set the requested status flags */ fpsr &= ~excepts; fpsr |= *flagp & excepts; /* Load the floating-point status register */ - __asm__ __volatile__ ("fmovel %0, fpsr" : : "dm" (fpsr)); + __asm__ __volatile__ ("fmovel %0, %%fpsr" : : "dm" (fpsr)); return (0); } @@ -157,7 +157,7 @@ fetestexcept(int excepts) excepts &= FE_ALL_EXCEPT; /* Store the current floating-point status register */ - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fpsr)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fpsr)); return (fpsr & excepts); } @@ -171,7 +171,7 @@ fegetround(void) unsigned int fpcr; /* Store the current floating-point control register */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fpcr)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fpcr)); return (fpcr & _ROUND_MASK); } @@ -191,14 +191,14 @@ fesetround(int round) return (-1); /* Store the current floating-point control register */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fpcr)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fpcr)); /* Set the rounding direction */ fpcr &= ~_ROUND_MASK; fpcr |= round; /* Load the floating-point control register */ - __asm__ __volatile__ ("fmovel %0, fpcr" : : "dm" (fpcr)); + __asm__ __volatile__ ("fmovel %0, %%fpcr" : : "dm" (fpcr)); return (0); } @@ -211,8 +211,8 @@ int fegetenv(fenv_t *envp) { /* Store the current floating-point control and status registers */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (envp->__control)); - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (envp->__status)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (envp->__control)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (envp->__status)); return (0); } @@ -229,18 +229,18 @@ feholdexcept(fenv_t *envp) unsigned int fpsr, fpcr; /* Store the current floating-point control and status registers */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (envp->__control)); - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (envp->__status)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (envp->__control)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (envp->__status)); /* Clear exception flags in FPSR */ fpsr = envp->__status; fpsr &= ~FE_ALL_EXCEPT; - __asm__ __volatile__ ("fmovel %0, fpsr" : : "dm" (fpsr)); + __asm__ __volatile__ ("fmovel %0, %%fpsr" : : "dm" (fpsr)); /* Mask all exceptions */ fpcr = envp->__control; fpcr &= ~(FE_ALL_EXCEPT << _MASK_SHIFT); - __asm__ __volatile__ ("fmovel %0, fpcr" : : "dm" (fpcr)); + __asm__ __volatile__ ("fmovel %0, %%fpcr" : : "dm" (fpcr)); return (0); } @@ -259,8 +259,8 @@ fesetenv(const fenv_t *envp) fenv_t fenv; /* Store the current floating-point control and status registers */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fenv.__control)); - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fenv.__status)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fenv.__control)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fenv.__status)); /* Set the requested control flags */ fenv.__control &= ~((FE_ALL_EXCEPT << _MASK_SHIFT) | _ROUND_MASK); @@ -272,8 +272,8 @@ fesetenv(const fenv_t *envp) fenv.__status |= envp->__status & FE_ALL_EXCEPT; /* Load the floating-point control and status registers */ - __asm__ __volatile__ ("fmovel %0, fpcr" : : "dm" (fenv.__control)); - __asm__ __volatile__ ("fmovel %0, fpsr" : : "dm" (fenv.__status)); + __asm__ __volatile__ ("fmovel %0, %%fpcr" : : "dm" (fenv.__control)); + __asm__ __volatile__ ("fmovel %0, %%fpsr" : : "dm" (fenv.__status)); return (0); } @@ -292,7 +292,7 @@ feupdateenv(const fenv_t *envp) unsigned int fpsr; /* Store the current floating-point status register */ - __asm__ __volatile__ ("fmovel fpsr, %0" : "=dm" (fpsr)); + __asm__ __volatile__ ("fmovel %%fpsr, %0" : "=dm" (fpsr)); /* Install new floating-point environment */ fesetenv(envp); @@ -314,13 +314,13 @@ feenableexcept(int mask) mask &= FE_ALL_EXCEPT; /* Store the current floating-point control register */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fpcr)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fpcr)); omask = (fpcr >> _MASK_SHIFT) & FE_ALL_EXCEPT; fpcr |= mask << _MASK_SHIFT; /* Load the floating-point control register */ - __asm__ __volatile__ ("fmovel %0, fpcr" : : "dm" (fpcr)); + __asm__ __volatile__ ("fmovel %0, %%fpcr" : : "dm" (fpcr)); return (omask); @@ -334,13 +334,13 @@ fedisableexcept(int mask) mask &= FE_ALL_EXCEPT; /* Store the current floating-point control register */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fpcr)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fpcr)); omask = (fpcr >> _MASK_SHIFT) & FE_ALL_EXCEPT; fpcr &= ~(mask << _MASK_SHIFT); /* Load the floating-point control register */ - __asm__ __volatile__ ("fmovel %0, fpcr" : : "dm" (fpcr)); + __asm__ __volatile__ ("fmovel %0, %%fpcr" : : "dm" (fpcr)); return (omask); } @@ -351,7 +351,7 @@ fegetexcept(void) unsigned int fpcr; /* Store the current floating-point control register */ - __asm__ __volatile__ ("fmovel fpcr, %0" : "=dm" (fpcr)); + __asm__ __volatile__ ("fmovel %%fpcr, %0" : "=dm" (fpcr)); return ((fpcr >> _MASK_SHIFT) & FE_ALL_EXCEPT); } diff --git a/lib/libm/arch/mc68881/s_atan.S b/lib/libm/arch/mc68881/s_atan.S index bac3acb7aba..1c4cab3a53b 100644 --- a/lib/libm/arch/mc68881/s_atan.S +++ b/lib/libm/arch/mc68881/s_atan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atan.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_atan.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(atan) - fatand sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fatand %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_atanf.S b/lib/libm/arch/mc68881/s_atanf.S index 3f2b7ab2047..1f218993561 100644 --- a/lib/libm/arch/mc68881/s_atanf.S +++ b/lib/libm/arch/mc68881/s_atanf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atanf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_atanf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(atanf) - fatans sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fatans %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_atanl.S b/lib/libm/arch/mc68881/s_atanl.S index 851253b8e18..dd1b0253c5b 100644 --- a/lib/libm/arch/mc68881/s_atanl.S +++ b/lib/libm/arch/mc68881/s_atanl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_atanl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_atanl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(atanl) - fatanx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fatanx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_ceil.S b/lib/libm/arch/mc68881/s_ceil.S index 9eb33cfab2b..2facce9f55e 100644 --- a/lib/libm/arch/mc68881/s_ceil.S +++ b/lib/libm/arch/mc68881/s_ceil.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceil.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_ceil.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,19 +37,16 @@ | ceil(x) | -floor(-x), for all real x ENTRY(ceil) - fmovel fpcr,d0 | save old FPCR - fmoved sp@(4),fp0 | get argument + fmovel %fpcr,%d0 | save old FPCR + fmoved %sp@(4),%fp0 | get argument fbun Lret | if NaN, return NaN fbolt Lrtz | <0, round to zero - fmovel #0x30,fpcr | >=0, round to inf + fmovel #0x30,%fpcr | >=0, round to inf jra Ldoit Lrtz: - fmovel #0x10,fpcr + fmovel #0x10,%fpcr Ldoit: - fintd sp@(4),fp0 | truncate - fmovel d0,fpcr | restore old FPCR + fintd %sp@(4),%fp0 | truncate + fmovel %d0,%fpcr | restore old FPCR Lret: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libm/arch/mc68881/s_ceilf.S b/lib/libm/arch/mc68881/s_ceilf.S index 917738d370c..abe6309c8a3 100644 --- a/lib/libm/arch/mc68881/s_ceilf.S +++ b/lib/libm/arch/mc68881/s_ceilf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceilf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_ceilf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,18 +37,16 @@ | ceilf(x) | -floorf(-x), for all real x ENTRY(ceilf) - fmovel fpcr,d0 | save old FPCR - fmoves sp@(4),fp0 | get argument + fmovel %fpcr,%d0 | save old FPCR + fmoves %sp@(4),%fp0 | get argument fbun Lret | if NaN, return NaN fbolt Lrtz | <0, round to zero - fmovel #0x30,fpcr | >=0, round to inf + fmovel #0x30,%fpcr | >=0, round to inf jra Ldoit Lrtz: - fmovel #0x10,fpcr + fmovel #0x10,%fpcr Ldoit: - fints sp@(4),fp0 | truncate - fmovel d0,fpcr | restore old FPCR + fints %sp@(4),%fp0 | truncate + fmovel %d0,%fpcr | restore old FPCR Lret: - fmoves fp0,sp@- - movel sp@+,d0 rts diff --git a/lib/libm/arch/mc68881/s_copysign.S b/lib/libm/arch/mc68881/s_copysign.S index 2005cd85d24..67e9e43b748 100644 --- a/lib/libm/arch/mc68881/s_copysign.S +++ b/lib/libm/arch/mc68881/s_copysign.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysign.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_copysign.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,12 +37,12 @@ | copysign(x,y) | returns x with the sign of y. ENTRY(copysign) - movl sp@(4),d0 - movl sp@(8),d1 - tstw sp@(12) + tstw %sp@(12) jmi Lneg - bclr #31,d0 + bclr #31,%sp@(4) + fmoved %sp@(4),%fp0 rts Lneg: - bset #31,d0 + bset #31,%sp@(4) + fmoved %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_copysignf.S b/lib/libm/arch/mc68881/s_copysignf.S index 13557b47220..c8ea7082331 100644 --- a/lib/libm/arch/mc68881/s_copysignf.S +++ b/lib/libm/arch/mc68881/s_copysignf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_copysignf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,11 +37,12 @@ | copysignf(x,y) | returns x with the sign of y. ENTRY(copysignf) - movl sp@(4),d0 - tstw sp@(8) + tstw %sp@(8) jmi Lneg - bclr #31,d0 + bclr #31,%sp@(4) + fmoves %sp@(4),%fp0 rts Lneg: - bset #31,d0 + bset #31,%sp@(4) + fmoves %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_copysignl.S b/lib/libm/arch/mc68881/s_copysignl.S index 028c193da0e..68f9e3c11e5 100644 --- a/lib/libm/arch/mc68881/s_copysignl.S +++ b/lib/libm/arch/mc68881/s_copysignl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_copysignl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,15 +36,13 @@ | copysignl(x,y) | returns x with the sign of y. -.lcomm _ASM_LABEL(__rv),12 ENTRY(copysignl) - fmovex sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 - tstw sp@(16) + tstw %sp@(16) jmi Lneg - bclr #31,_ASM_LABEL(__rv) + bclr #31,%sp@(4) + fmovex %sp@(4),%fp0 rts Lneg: - bset #31,_ASM_LABEL(__rv) + bset #31,%sp@(4) + fmovex %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_cos.S b/lib/libm/arch/mc68881/s_cos.S index bece51656e4..7411f4c62dc 100644 --- a/lib/libm/arch/mc68881/s_cos.S +++ b/lib/libm/arch/mc68881/s_cos.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cos.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_cos.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(cos) - fcosd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fcosd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_cosf.S b/lib/libm/arch/mc68881/s_cosf.S index 4b38fda2138..30a270727cd 100644 --- a/lib/libm/arch/mc68881/s_cosf.S +++ b/lib/libm/arch/mc68881/s_cosf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cosf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_cosf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(cosf) - fcoss sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fcoss %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_cosl.S b/lib/libm/arch/mc68881/s_cosl.S index ba057cf3123..4c204d715a3 100644 --- a/lib/libm/arch/mc68881/s_cosl.S +++ b/lib/libm/arch/mc68881/s_cosl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_cosl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_cosl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(cosl) - fcosx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fcosx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_expm1.S b/lib/libm/arch/mc68881/s_expm1.S index cb4e8c1156f..28efc4704cd 100644 --- a/lib/libm/arch/mc68881/s_expm1.S +++ b/lib/libm/arch/mc68881/s_expm1.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_expm1.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_expm1.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(expm1) - fetoxm1d sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fetoxm1d %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_expm1f.S b/lib/libm/arch/mc68881/s_expm1f.S index 0ad65025439..86d67f94885 100644 --- a/lib/libm/arch/mc68881/s_expm1f.S +++ b/lib/libm/arch/mc68881/s_expm1f.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_expm1f.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_expm1f.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(expm1f) - fetoxm1s sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fetoxm1s %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_floor.S b/lib/libm/arch/mc68881/s_floor.S index d97b2ee2b12..7eb7aebb6b3 100644 --- a/lib/libm/arch/mc68881/s_floor.S +++ b/lib/libm/arch/mc68881/s_floor.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floor.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_floor.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,19 +37,16 @@ | floor(x) | the largest integer no larger than x ENTRY(floor) - fmovel fpcr,d0 | save old FPCR - fmoved sp@(4),fp0 | get argument + fmovel %fpcr,%d0 | save old FPCR + fmoved %sp@(4),%fp0 | get argument fbun Lret | if NaN, return NaN fboge Lrtz | >=0, round to zero - fmovel #0x20,fpcr | <0, round to -inf + fmovel #0x20,%fpcr | <0, round to -inf jra Ldoit Lrtz: - fmovel #0x10,fpcr + fmovel #0x10,%fpcr Ldoit: - fintd sp@(4),fp0 | truncate - fmovel d0,fpcr | restore old FPCR + fintd %sp@(4),%fp0 | truncate + fmovel %d0,%fpcr | restore old FPCR Lret: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libm/arch/mc68881/s_floorf.S b/lib/libm/arch/mc68881/s_floorf.S index e305934c718..7ee68bd6256 100644 --- a/lib/libm/arch/mc68881/s_floorf.S +++ b/lib/libm/arch/mc68881/s_floorf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floorf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_floorf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,18 +37,16 @@ | floorf(x) | the largest integer no larger than x ENTRY(floorf) - fmovel fpcr,d0 | save old FPCR - fmoves sp@(4),fp0 | get argument + fmovel %fpcr,%d0 | save old FPCR + fmoves %sp@(4),%fp0 | get argument fbun Lret | if NaN, return NaN fboge Lrtz | >=0, round to zero - fmovel #0x20,fpcr | <0, round to -inf + fmovel #0x20,%fpcr | <0, round to -inf jra Ldoit Lrtz: - fmovel #0x10,fpcr + fmovel #0x10,%fpcr Ldoit: - fints sp@(4),fp0 | truncate - fmovel d0,fpcr | restore old FPCR + fints %sp@(4),%fp0 | truncate + fmovel %d0,%fpcr | restore old FPCR Lret: - fmoves fp0,sp@- - movel sp@+,d0 rts diff --git a/lib/libm/arch/mc68881/s_log1p.S b/lib/libm/arch/mc68881/s_log1p.S index cbdcb810e83..2a368eebe3e 100644 --- a/lib/libm/arch/mc68881/s_log1p.S +++ b/lib/libm/arch/mc68881/s_log1p.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1p.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_log1p.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(log1p) - flognp1d sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + flognp1d %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_log1pf.S b/lib/libm/arch/mc68881/s_log1pf.S index 9d39680752d..a8bbb1bdff6 100644 --- a/lib/libm/arch/mc68881/s_log1pf.S +++ b/lib/libm/arch/mc68881/s_log1pf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_log1pf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_log1pf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(log1pf) - flognp1s sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + flognp1s %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_logb.S b/lib/libm/arch/mc68881/s_logb.S index 4d744c5f86f..badd6a64dad 100644 --- a/lib/libm/arch/mc68881/s_logb.S +++ b/lib/libm/arch/mc68881/s_logb.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_logb.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_logb.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -38,24 +38,21 @@ | returns the unbiased exponent of x, a signed integer in double precision, | except that logb(0) is -INF, logb(INF) is +INF, and logb(NAN) is that NAN. ENTRY(logb) - movw sp@(4),d0 - movw #0x7FF0,d1 | exponent bits - andw d1,d0 | mask off all else - cmpw d1,d0 | max exponent? + movw %sp@(4),%d0 + movw #0x7FF0,%d1 | exponent bits + andw %d1,%d0 | mask off all else + cmpw %d1,%d0 | max exponent? bne Lfinite | no, is finite - fmoved sp@(4),fp0 | yes, infinite or NaN + fmoved %sp@(4),%fp0 | yes, infinite or NaN fbun Ldone | NaN returns NaN - fabsx fp0 | +-inf returns inf + fabsx %fp0 | +-inf returns inf jra Ldone Lfinite: - fmoved sp@(4),fp0 | get entire number + fmoved %sp@(4),%fp0 | get entire number fbne Lnonz | zero? - flog2x fp0 | yes, log(0) a convenient source of -inf + flog2x %fp0 | yes, log(0) a convenient source of -inf jra Ldone Lnonz: - fgetexpx fp0 | get exponent + fgetexpx %fp0 | get exponent Ldone: - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 rts diff --git a/lib/libm/arch/mc68881/s_logbf.S b/lib/libm/arch/mc68881/s_logbf.S index cb72e6a5577..fa357e7aec9 100644 --- a/lib/libm/arch/mc68881/s_logbf.S +++ b/lib/libm/arch/mc68881/s_logbf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_logbf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_logbf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -38,23 +38,21 @@ | returns the unbiased exponent of x, a signed integer in single precision, | except that logbf(0) is -INF, logbf(INF) is +INF, and logbf(NAN) is that NAN. ENTRY(logbf) - movw sp@(4),d0 - movw #0x7F80,d1 | exponent bits - andw d1,d0 | mask off all else - cmpw d1,d0 | max exponent? + movw %sp@(4),%d0 + movw #0x7F80,%d1 | exponent bits + andw %d1,%d0 | mask off all else + cmpw %d1,%d0 | max exponent? bne Lfinite | no, is finite - fmoves sp@(4),fp0 | yes, infinite or NaN + fmoves %sp@(4),%fp0 | yes, infinite or NaN fbun Ldone | NaN returns NaN - fabsx fp0 | +-inf returns inf + fabsx %fp0 | +-inf returns inf jra Ldone Lfinite: - fmoves sp@(4),fp0 | get entire number + fmoves %sp@(4),%fp0 | get entire number fbne Lnonz | zero? - flog2x fp0 | yes, log(0) a convenient source of -inf + flog2x %fp0 | yes, log(0) a convenient source of -inf jra Ldone Lnonz: - fgetexpx fp0 | get exponent + fgetexpx %fp0 | get exponent Ldone: - fmoves fp0,sp@- - movel sp@+,d0 rts diff --git a/lib/libm/arch/mc68881/s_logbl.S b/lib/libm/arch/mc68881/s_logbl.S index 9db15d7cc79..67af3bae140 100644 --- a/lib/libm/arch/mc68881/s_logbl.S +++ b/lib/libm/arch/mc68881/s_logbl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_logbl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_logbl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,25 +37,22 @@ | logbl(x) | returns the unbiased exponent of x, a signed integer in double precision, | except that logbl(0) is -INF, logbl(INF) is +INF, and logbl(NAN) is that NAN. -.lcomm _ASM_LABEL(__rv),12 ENTRY(logbl) - movw sp@(4),d0 - movw #0x7FFF,d1 | exponent bits - andw d1,d0 | mask off all else - cmpw d1,d0 | max exponent? + movw %sp@(4),%d0 + movw #0x7FFF,%d1 | exponent bits + andw %d1,%d0 | mask off all else + cmpw %d1,%d0 | max exponent? bne Lfinite | no, is finite - fmovex sp@(4),fp0 | yes, infinite or NaN + fmovex %sp@(4),%fp0 | yes, infinite or NaN fbun Ldone | NaN returns NaN - fabsx fp0 | +-inf returns inf - jra Ldone + fabsx %fp0 | +-inf returns inf + rts Lfinite: - fmovex sp@(4),fp0 | get entire number + fmovex %sp@(4),%fp0 | get entire number fbne Lnonz | zero? - flog2x fp0 | yes, log(0) a convenient source of -inf - jra Ldone + flog2x %fp0 | yes, log(0) a convenient source of -inf + rts Lnonz: - fgetexpx fp0 | get exponent + fgetexpx %fp0 | get exponent Ldone: - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 rts diff --git a/lib/libm/arch/mc68881/s_rint.S b/lib/libm/arch/mc68881/s_rint.S index 3c3abc02371..777826a58fe 100644 --- a/lib/libm/arch/mc68881/s_rint.S +++ b/lib/libm/arch/mc68881/s_rint.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rint.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_rint.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,8 +37,5 @@ | rint(x) | delivers integer nearest x in direction of prevailing rounding mode ENTRY(rint) - fintd sp@(4),fp0 | use prevailing rounding mode - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fintd %sp@(4),%fp0 | use prevailing rounding mode rts diff --git a/lib/libm/arch/mc68881/s_rintf.S b/lib/libm/arch/mc68881/s_rintf.S index 47cf4359fdb..c3f61810b8b 100644 --- a/lib/libm/arch/mc68881/s_rintf.S +++ b/lib/libm/arch/mc68881/s_rintf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rintf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_rintf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -37,7 +37,5 @@ | rintf(x) | delivers integer nearest x in direction of prevailing rounding mode ENTRY(rintf) - fints sp@(4),fp0 | use prevailing rounding mode - fmoves fp0,sp@- - movel sp@+,d0 + fints %sp@(4),%fp0 | use prevailing rounding mode rts diff --git a/lib/libm/arch/mc68881/s_rintl.S b/lib/libm/arch/mc68881/s_rintl.S index af9717f85c5..95cc76f4a41 100644 --- a/lib/libm/arch/mc68881/s_rintl.S +++ b/lib/libm/arch/mc68881/s_rintl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_rintl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_rintl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,9 +36,6 @@ | rintl(x) | delivers integer nearest x in direction of prevailing rounding mode -.lcomm _ASM_LABEL(__rv),12 ENTRY(rintl) - fintx sp@(4),fp0 | use prevailing rounding mode - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fintx %sp@(4),%fp0 | use prevailing rounding mode rts diff --git a/lib/libm/arch/mc68881/s_scalbnf.S b/lib/libm/arch/mc68881/s_scalbnf.S index 8b86f4a2101..8a72e166eeb 100644 --- a/lib/libm/arch/mc68881/s_scalbnf.S +++ b/lib/libm/arch/mc68881/s_scalbnf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_scalbnf.S,v 1.2 2012/12/30 01:48:50 miod Exp $ */ +/* $OpenBSD: s_scalbnf.S,v 1.3 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -38,10 +38,8 @@ | returns x * (2**N), for integer values N. ALTENTRY(ldexpf,scalbnf) ENTRY(scalbnf) - fmoves sp@(4),fp0 + fmoves %sp@(4),%fp0 fbeq Ldone - fscalel sp@(8),fp0 + fscalel %sp@(8),%fp0 Ldone: - fmoves fp0,sp@- - movel sp@+,d0 rts diff --git a/lib/libm/arch/mc68881/s_scalbnl.S b/lib/libm/arch/mc68881/s_scalbnl.S index c20331c61bf..d0d39eae3c2 100644 --- a/lib/libm/arch/mc68881/s_scalbnl.S +++ b/lib/libm/arch/mc68881/s_scalbnl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_scalbnl.S,v 1.2 2012/12/30 01:48:51 miod Exp $ */ +/* $OpenBSD: s_scalbnl.S,v 1.3 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -36,13 +36,10 @@ | scalbnl(x, N) | returns x * (2**N), for integer values N. -.lcomm _ASM_LABEL(__rv),12 ALTENTRY(ldexpl,scalbnl) ENTRY(scalbnl) - fmovex sp@(4),fp0 + fmovex %sp@(4),%fp0 fbeq Ldone - fscalel sp@(16),fp0 + fscalel %sp@(16),%fp0 Ldone: - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 rts diff --git a/lib/libm/arch/mc68881/s_sin.S b/lib/libm/arch/mc68881/s_sin.S index d6f2196e3a7..d6b8e1bcc82 100644 --- a/lib/libm/arch/mc68881/s_sin.S +++ b/lib/libm/arch/mc68881/s_sin.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sin.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_sin.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(sin) - fsind sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + fsind %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_sinf.S b/lib/libm/arch/mc68881/s_sinf.S index b459dd67538..ce15a8d9906 100644 --- a/lib/libm/arch/mc68881/s_sinf.S +++ b/lib/libm/arch/mc68881/s_sinf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sinf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_sinf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(sinf) - fsins sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + fsins %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_sinl.S b/lib/libm/arch/mc68881/s_sinl.S index 3fd595567e1..9f400fa3a4f 100644 --- a/lib/libm/arch/mc68881/s_sinl.S +++ b/lib/libm/arch/mc68881/s_sinl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_sinl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_sinl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(sinl) - fsinx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + fsinx %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_tan.S b/lib/libm/arch/mc68881/s_tan.S index ce7237b3bb9..7018e037293 100644 --- a/lib/libm/arch/mc68881/s_tan.S +++ b/lib/libm/arch/mc68881/s_tan.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tan.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_tan.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(tan) - ftand sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + ftand %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_tanf.S b/lib/libm/arch/mc68881/s_tanf.S index 74d17e307fa..61396a0dcc1 100644 --- a/lib/libm/arch/mc68881/s_tanf.S +++ b/lib/libm/arch/mc68881/s_tanf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_tanf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(tanf) - ftans sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + ftans %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_tanh.S b/lib/libm/arch/mc68881/s_tanh.S index 58e4086c182..0a6c735ecca 100644 --- a/lib/libm/arch/mc68881/s_tanh.S +++ b/lib/libm/arch/mc68881/s_tanh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanh.S,v 1.3 2005/08/02 11:17:32 espie Exp $ */ +/* $OpenBSD: s_tanh.S,v 1.4 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,8 +35,5 @@ #include <machine/asm.h> ENTRY(tanh) - ftanhd sp@(4),fp0 - fmoved fp0,sp@- - movel sp@+,d0 - movel sp@+,d1 + ftanhd %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_tanhf.S b/lib/libm/arch/mc68881/s_tanhf.S index 284552b01c7..6ef25127fbd 100644 --- a/lib/libm/arch/mc68881/s_tanhf.S +++ b/lib/libm/arch/mc68881/s_tanhf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanhf.S,v 1.1 2011/05/28 21:55:04 martynas Exp $ */ +/* $OpenBSD: s_tanhf.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,7 +35,5 @@ #include <machine/asm.h> ENTRY(tanhf) - ftanhs sp@(4),fp0 - fmoves fp0,sp@- - movel sp@+,d0 + ftanhs %sp@(4),%fp0 rts diff --git a/lib/libm/arch/mc68881/s_tanl.S b/lib/libm/arch/mc68881/s_tanl.S index 1cca0d76e08..d450af0ddaa 100644 --- a/lib/libm/arch/mc68881/s_tanl.S +++ b/lib/libm/arch/mc68881/s_tanl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_tanl.S,v 1.1 2011/05/28 22:13:52 martynas Exp $ */ +/* $OpenBSD: s_tanl.S,v 1.2 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,9 +34,6 @@ #include <machine/asm.h> -.lcomm _ASM_LABEL(__rv),12 ENTRY(tanl) - ftanx sp@(4),fp0 - fmovex fp0,_ASM_LABEL(__rv) - movel #_ASM_LABEL(__rv),d0 + ftanx %sp@(4),%fp0 rts diff --git a/lib/librthread/arch/m68k/cerror.S b/lib/librthread/arch/m68k/cerror.S index 15c2b617cdc..71eb4029678 100644 --- a/lib/librthread/arch/m68k/cerror.S +++ b/lib/librthread/arch/m68k/cerror.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cerror.S,v 1.2 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: cerror.S,v 1.3 2013/02/02 13:29:14 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,20 +34,19 @@ #include "SYS.h" + .globl _C_LABEL(__errno) .even - .globl ___errno __cerror: - movl d0,sp@- + movl %d0,%sp@- #ifdef __PIC__ - movl #__GLOBAL_OFFSET_TABLE_,a0 - lea pc@(0,a0:l),a0 - movl a0@(___errno:l),a0 - jsr a0@ + lea %pc@(_GLOBAL_OFFSET_TABLE_@GOTPC),%a0 + movl %a0@(_C_LABEL(__errno)@GOT:l),%a0 + jsr %a0@ #else - jbsr ___errno + jbsr _C_LABEL(__errno) #endif - movl d0,a0 - movl sp@+,a0@ - movl #-1,d0 - movl #-1,d1 + movl %d0,%a0 + movl %sp@+,%a0@ + movl #-1,%d0 + movl #-1,%d1 rts |