Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/a29khif')
-rw-r--r--newlib/libc/sys/a29khif/Makefile.am48
-rw-r--r--newlib/libc/sys/a29khif/Makefile.in337
-rw-r--r--newlib/libc/sys/a29khif/_alloc.s55
-rw-r--r--newlib/libc/sys/a29khif/_close.s40
-rw-r--r--newlib/libc/sys/a29khif/_cycles.s39
-rw-r--r--newlib/libc/sys/a29khif/_exit.s39
-rw-r--r--newlib/libc/sys/a29khif/_fstat.s79
-rw-r--r--newlib/libc/sys/a29khif/_getpsiz.s38
-rw-r--r--newlib/libc/sys/a29khif/_gettz.s39
-rw-r--r--newlib/libc/sys/a29khif/_ioctl.s39
-rw-r--r--newlib/libc/sys/a29khif/_iostat.s43
-rw-r--r--newlib/libc/sys/a29khif/_iowait.s39
-rw-r--r--newlib/libc/sys/a29khif/_isatty.s22
-rw-r--r--newlib/libc/sys/a29khif/_lseek.s42
-rw-r--r--newlib/libc/sys/a29khif/_open.s39
-rw-r--r--newlib/libc/sys/a29khif/_query.s39
-rw-r--r--newlib/libc/sys/a29khif/_read.s38
-rw-r--r--newlib/libc/sys/a29khif/_sbrk.s30
-rw-r--r--newlib/libc/sys/a29khif/_setim.s39
-rw-r--r--newlib/libc/sys/a29khif/_settrap.s39
-rw-r--r--newlib/libc/sys/a29khif/_setvec.s38
-rw-r--r--newlib/libc/sys/a29khif/_tmpnam.s41
-rw-r--r--newlib/libc/sys/a29khif/_write.s40
-rw-r--r--newlib/libc/sys/a29khif/aclocal.m4282
-rw-r--r--newlib/libc/sys/a29khif/alloc.s64
-rw-r--r--newlib/libc/sys/a29khif/clock.s41
-rwxr-xr-xnewlib/libc/sys/a29khif/configure1687
-rw-r--r--newlib/libc/sys/a29khif/configure.in12
-rw-r--r--newlib/libc/sys/a29khif/crt0.s226
-rw-r--r--newlib/libc/sys/a29khif/getargs.s38
-rw-r--r--newlib/libc/sys/a29khif/getenv.s48
-rw-r--r--newlib/libc/sys/a29khif/getpid.c12
-rw-r--r--newlib/libc/sys/a29khif/kill.c21
-rw-r--r--newlib/libc/sys/a29khif/read.s54
-rw-r--r--newlib/libc/sys/a29khif/remove.s43
-rw-r--r--newlib/libc/sys/a29khif/rename.s41
-rw-r--r--newlib/libc/sys/a29khif/signal.s452
-rw-r--r--newlib/libc/sys/a29khif/stubs.s135
-rw-r--r--newlib/libc/sys/a29khif/sys/cpudef.h270
-rw-r--r--newlib/libc/sys/a29khif/sys/fpsymbol.h2970
-rw-r--r--newlib/libc/sys/a29khif/sys/intrinsi.h457
-rw-r--r--newlib/libc/sys/a29khif/sys/macros.h37
-rw-r--r--newlib/libc/sys/a29khif/sys/proreg.h60
-rw-r--r--newlib/libc/sys/a29khif/sys/romdcl.h392
-rw-r--r--newlib/libc/sys/a29khif/sys/smartmac.h1491
-rw-r--r--newlib/libc/sys/a29khif/sys/sysmac.h165
-rw-r--r--newlib/libc/sys/a29khif/systime.s44
-rw-r--r--newlib/libc/sys/a29khif/vec.s35
48 files changed, 10319 insertions, 0 deletions
diff --git a/newlib/libc/sys/a29khif/Makefile.am b/newlib/libc/sys/a29khif/Makefile.am
new file mode 100644
index 000000000..48f389695
--- /dev/null
+++ b/newlib/libc/sys/a29khif/Makefile.am
@@ -0,0 +1,48 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+noinst_LIBRARIES = lib.a
+
+lib_a_SOURCES = \
+ _alloc.s \
+ _close.s \
+ _cycles.s \
+ _exit.s \
+ _getpsiz.s \
+ _gettz.s \
+ _ioctl.s \
+ _iostat.s \
+ _iowait.s \
+ _lseek.s \
+ _open.s \
+ _query.s \
+ _read.s \
+ _setim.s \
+ _settrap.s \
+ _setvec.s \
+ _tmpnam.s \
+ _write.s \
+ alloc.s \
+ clock.s \
+ getargs.s \
+ getenv.s \
+ read.s \
+ remove.s \
+ rename.s \
+ signal.s \
+ _sbrk.s \
+ _fstat.s \
+ _isatty.s \
+ systime.s \
+ vec.s \
+ kill.c \
+ getpid.c \
+ stubs.s
+
+all: crt0.o
+
+ACLOCAL_AMFLAGS = -I ../../..
+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/sys/a29khif/Makefile.in b/newlib/libc/sys/a29khif/Makefile.in
new file mode 100644
index 000000000..027a83098
--- /dev/null
+++ b/newlib/libc/sys/a29khif/Makefile.in
@@ -0,0 +1,337 @@
+# Makefile.in generated automatically by automake 1.3 from Makefile.am
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DISTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AR = @AR@
+AS = @AS@
+CC = @CC@
+CPP = @CPP@
+EXEEXT = @EXEEXT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+machine_dir = @machine_dir@
+newlib_basedir = @newlib_basedir@
+sys_dir = @sys_dir@
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+noinst_LIBRARIES = lib.a
+
+lib_a_SOURCES = \
+ _alloc.s \
+ _close.s \
+ _cycles.s \
+ _exit.s \
+ _getpsiz.s \
+ _gettz.s \
+ _ioctl.s \
+ _iostat.s \
+ _iowait.s \
+ _lseek.s \
+ _open.s \
+ _query.s \
+ _read.s \
+ _setim.s \
+ _settrap.s \
+ _setvec.s \
+ _tmpnam.s \
+ _write.s \
+ alloc.s \
+ clock.s \
+ getargs.s \
+ getenv.s \
+ read.s \
+ remove.s \
+ rename.s \
+ signal.s \
+ _sbrk.s \
+ _fstat.s \
+ _isatty.s \
+ systime.s \
+ vec.s \
+ kill.c \
+ getpid.c \
+ stubs.s
+
+ACLOCAL_AMFLAGS = -I ../../..
+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+lib_a_LIBADD =
+lib_a_OBJECTS = _alloc.o _close.o _cycles.o _exit.o _getpsiz.o _gettz.o \
+_ioctl.o _iostat.o _iowait.o _lseek.o _open.o _query.o _read.o _setim.o \
+_settrap.o _setvec.o _tmpnam.o _write.o alloc.o clock.o getargs.o \
+getenv.o read.o remove.o rename.o signal.o _sbrk.o _fstat.o _isatty.o \
+systime.o vec.o kill.o getpid.o stubs.o
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = Makefile.am Makefile.in aclocal.m4 configure configure.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = $(lib_a_SOURCES)
+OBJECTS = $(lib_a_OBJECTS)
+
+all: Makefile $(LIBRARIES)
+
+.SUFFIXES:
+.SUFFIXES: .S .c .o .s
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINT@ configure.in ../../../acinclude.m4 \
+ ../../../aclocal.m4
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-noinstLIBRARIES:
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+distclean-noinstLIBRARIES:
+
+maintainer-clean-noinstLIBRARIES:
+
+.c.o:
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
+ -rm -f lib.a
+ $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
+ $(RANLIB) lib.a
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @echo "========================"; \
+ echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "========================"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ @for file in $(DISTFILES); do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+info:
+dvi:
+check:
+ $(MAKE) $(AM_MAKEFLAGS)
+installcheck:
+install-info:
+install-exec:
+ @$(NORMAL_INSTALL)
+
+install-data:
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall:
+
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+
+
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+ mostlyclean-tags mostlyclean-generic
+
+clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
+ mostlyclean
+
+distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
+ distclean-generic clean
+ -rm -f config.status
+
+maintainer-clean: maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-generic distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f config.status
+
+.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
+clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info dvi installcheck \
+install-info install-exec install-data install uninstall all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+all: crt0.o
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/newlib/libc/sys/a29khif/_alloc.s b/newlib/libc/sys/a29khif/_alloc.s
new file mode 100644
index 000000000..ecdd1ddb1
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_alloc.s
@@ -0,0 +1,55 @@
+; @(#)_alloc.s 1.4 90/10/14 21:57:19, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; 07/06/89 (JS) Replaced call to const tav,HIF_macro @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 to syscall macro,
+; and deleted call to reterr macro as a NULL needs to be
+; returned on failure.
+; _alloc.s
+; void *vp = _sysalloc( int size );
+;
+ .file "_alloc.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __sysalloc
+__sysalloc:
+ const tav,HIF_alloc @ asneq V_SYSCALL,gr1,gr1
+ jmpti tav, lr0
+ const tpc, _errno
+ consth tpc, _errno
+ store 0, 0, tav, tpc
+ jmpi lr0
+ const v0, 0 ; return NULL on error.
+
+;
+; int errret = _sysfree( void *addr, int size );
+;
+ .global __sysfree
+__sysfree:
+ const tav,HIF_free @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_close.s b/newlib/libc/sys/a29khif/_close.s
new file mode 100644
index 000000000..04f52ae00
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_close.s
@@ -0,0 +1,40 @@
+; @(#)_close.s 1.4 90/10/14 21:57:20, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _close.s
+; int cc = _close( int fd );
+;
+ .file "_close.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __close
+;; syscalls used now -- .global _close
+
+__close:
+;; syscalls used now -- _close:
+ const tav,HIF_close @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_cycles.s b/newlib/libc/sys/a29khif/_cycles.s
new file mode 100644
index 000000000..94f9df3b4
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_cycles.s
@@ -0,0 +1,39 @@
+; @(#)_cycles.s 1.2 90/10/14 21:57:21, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _cycles.s
+; struct { unsigned long low_ticks, long hi_ticks } = _cycles( );
+;
+ .file "_cycles.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00020000 ; Debugger tag word
+ .global __cycles
+
+__cycles:
+ const tav,HIF_cycles @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_exit.s b/newlib/libc/sys/a29khif/_exit.s
new file mode 100644
index 000000000..65b9b83e3
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_exit.s
@@ -0,0 +1,39 @@
+; @(#)_exit.s 1.2 90/10/14 21:57:22, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _exit.s
+; _exit( int rc );
+;
+ .file "_exit.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __exit
+
+__exit:
+ const tav,HIF_exit @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_fstat.s b/newlib/libc/sys/a29khif/_fstat.s
new file mode 100644
index 000000000..0144d76d9
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_fstat.s
@@ -0,0 +1,79 @@
+ .file "_fstat.c"
+ .sect .lit,lit
+gcc2_compiled.:
+ .text
+ .align 4
+ .global __fstat
+;; syscalls used now -- .global _fstat
+ .word 0x40000
+__fstat:
+;; syscalls used now -- _fstat:
+ sub gr1,gr1,32
+ asgeu V_SPILL,gr1,gr126
+ add lr1,gr1,48
+ sll lr5,lr10,0
+ const gr116,__iostat
+ consth gr116,__iostat
+ calli lr0,gr116
+ sll lr2,lr5,0
+ sll lr10,gr96,0
+ jmpt lr10,L8
+ sll gr116,lr10,30
+ jmpf gr116,L3
+ add gr116,lr11,12
+ add gr117,lr11,12
+ const gr116,4096
+ store 0,0,gr116,gr117
+ add gr117,lr11,4
+ const gr116,1
+ jmp L4
+ store 0,0,gr116,gr117
+L3:
+ const gr117,8192
+ store 0,0,gr117,gr116
+ add gr116,lr11,4
+ store 0,0,gr117,gr116
+L4:
+ add gr117,lr11,20
+ const gr116,0
+ store 0,0,gr116,gr117
+ store 0,0,gr116,lr11
+ const gr116,_time
+ consth gr116,_time
+ calli lr0,gr116
+ const lr2,0
+ add gr116,lr11,16
+ store 0,0,gr96,gr116
+ sll lr2,lr5,0
+ const lr3,0
+ const lr7,__lseek
+ consth lr7,__lseek
+ calli lr0,lr7
+ const lr4,1
+ sll lr10,gr96,0
+ constn lr6,65535
+ cpneq gr116,lr10,lr6
+ jmpf gr116,L7
+ sll lr2,lr5,0
+ const lr3,0
+ calli lr0,lr7
+ const lr4,2
+ add gr116,lr11,8
+ store 0,0,gr96,gr116
+ cpneq gr96,gr96,lr6
+ jmpf gr96,L7
+ sll lr2,lr5,0
+ sll lr3,lr10,0
+ calli lr0,lr7
+ const lr4,0
+ cpneq gr96,gr96,lr6
+ jmpt gr96,L8
+ const gr96,0
+L7:
+ constn gr96,65535
+L8:
+ add gr1,gr1,32
+ nop
+ jmpi lr0
+ asleu V_FILL,lr1,gr127
+
diff --git a/newlib/libc/sys/a29khif/_getpsiz.s b/newlib/libc/sys/a29khif/_getpsiz.s
new file mode 100644
index 000000000..b9949a003
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_getpsiz.s
@@ -0,0 +1,38 @@
+; @(#)_getpsiz.s 1.2 90/10/14 21:57:23, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _getpsiz.s
+; int size = _getpsiz( );
+;
+ .file "_getpsiz.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00020000 ; Debugger tag word
+ .global __getpsiz
+
+__getpsiz:
+ const tav,HIF_getpagesize @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .end
diff --git a/newlib/libc/sys/a29khif/_gettz.s b/newlib/libc/sys/a29khif/_gettz.s
new file mode 100644
index 000000000..36cf1c702
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_gettz.s
@@ -0,0 +1,39 @@
+; @(#)_gettz.s 2.2 90/10/14 21:57:24, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _gettz.s
+; _gettz( void );
+;
+ .file "_gettz.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00020000 ; Debugger tag word
+ .global __gettz
+
+__gettz:
+ const tav,HIF_gettz @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_ioctl.s b/newlib/libc/sys/a29khif/_ioctl.s
new file mode 100644
index 000000000..0ca51c504
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_ioctl.s
@@ -0,0 +1,39 @@
+; @(#)_ioctl.s 1.2 90/10/14 21:57:25, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _ioctl.s
+; _ioctl( int fd );
+;
+ .file "_ioctl.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __ioctl
+
+__ioctl:
+ const tav,HIF_ioctl @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_iostat.s b/newlib/libc/sys/a29khif/_iostat.s
new file mode 100644
index 000000000..ae97c5de5
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_iostat.s
@@ -0,0 +1,43 @@
+;----------------------------------------------------------------------------
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _iostat.s
+; _iostat( int fd );
+;
+ .file "_iostat.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __iostat
+ .global _iostat
+
+__iostat:
+_iostat:
+ const tav,HIF_iostat @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
+
diff --git a/newlib/libc/sys/a29khif/_iowait.s b/newlib/libc/sys/a29khif/_iowait.s
new file mode 100644
index 000000000..3e2ad61cd
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_iowait.s
@@ -0,0 +1,39 @@
+; @(#)_iowait.s 1.3 90/10/14 21:57:27, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _iowait.s
+; _iowait( int fd );
+;
+ .file "_iowait.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __iowait
+
+__iowait:
+ const tav,HIF_iowait @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_isatty.s b/newlib/libc/sys/a29khif/_isatty.s
new file mode 100644
index 000000000..55110e2fc
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_isatty.s
@@ -0,0 +1,22 @@
+ .file "isatty.c"
+ .sect .lit,lit
+gcc2_compiled.:
+ .text
+ .align 4
+ .global __isatty
+ .global _isatty
+ .word 0x30000
+__isatty:
+_isatty:
+ sub gr1,gr1,16
+ asgeu V_SPILL,gr1,gr126
+ add lr1,gr1,28
+ const gr116,__iostat
+ consth gr116,__iostat
+ calli lr0,gr116
+ sll lr2,lr6,0
+ sll gr96,gr96,30
+ add gr1,gr1,16
+ srl gr96,gr96,31
+ jmpi lr0
+ asleu V_FILL,lr1,gr127
diff --git a/newlib/libc/sys/a29khif/_lseek.s b/newlib/libc/sys/a29khif/_lseek.s
new file mode 100644
index 000000000..56a7fc6c9
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_lseek.s
@@ -0,0 +1,42 @@
+; @(#)_lseek.s 1.4 90/10/14 21:57:28, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _lseek.s
+; int cc = _lseek( int fd, long offset, int whence );
+;
+ .file "_lseek.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00050000 ; Debugger tag word
+ .global __lseek
+;; syscalls used now -- .global _lseek
+
+
+__lseek:
+;; syscalls used now -- _lseek:
+ const tav,HIF_lseek @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_open.s b/newlib/libc/sys/a29khif/_open.s
new file mode 100644
index 000000000..3a9ed7e61
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_open.s
@@ -0,0 +1,39 @@
+; @(#)_open.s 1.4 90/10/14 21:57:30, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _open.s
+; int fd = _open( char *path, int oflag [, int mode ] );
+;
+ .file "_open.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00050000 ; Debugger tag word
+ .global __open
+
+__open:
+ const tav,HIF_open @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_query.s b/newlib/libc/sys/a29khif/_query.s
new file mode 100644
index 000000000..6887bea93
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_query.s
@@ -0,0 +1,39 @@
+; @(#)_query.s 2.2 90/10/14 21:57:31, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _query.s
+; _query( query_code );
+;
+ .file "_query.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __query
+
+__query:
+ const tav,HIF_query @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_read.s b/newlib/libc/sys/a29khif/_read.s
new file mode 100644
index 000000000..23ebbe732
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_read.s
@@ -0,0 +1,38 @@
+; @(#)_read.s 1.4 90/10/14 21:57:32, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _read.s
+; int nread = _read( int fd, char *buf, int count );
+;
+ .file "_read.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00050000 ; Debugger tag word
+ .global __read
+
+__read:
+ const tav,HIF_read @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .end
diff --git a/newlib/libc/sys/a29khif/_sbrk.s b/newlib/libc/sys/a29khif/_sbrk.s
new file mode 100644
index 000000000..33c1269cd
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_sbrk.s
@@ -0,0 +1,30 @@
+ .file "sbrk.c"
+ .sect .lit,lit
+gcc2_compiled.:
+ .text
+ .align 4
+ .global __sbrk
+ .word 0x30000
+__sbrk:
+ sub gr1,gr1,16
+ asgeu V_SPILL,gr1,gr126
+ add lr1,gr1,28
+ sll lr2,lr6,0
+ jmpt lr2,L4
+ constn gr96,65535
+ const gr116,__sysalloc
+ consth gr116,__sysalloc
+ calli lr0,gr116
+ nop
+ sll gr117,gr96,0
+ cpneq gr116,gr117,0
+ jmpf gr116,L4
+ constn gr96,65535
+ sll gr96,gr117,0
+L4:
+ add gr1,gr1,16
+ nop
+ jmpi lr0
+ asleu V_FILL,lr1,gr127
+
+
diff --git a/newlib/libc/sys/a29khif/_setim.s b/newlib/libc/sys/a29khif/_setim.s
new file mode 100644
index 000000000..0cf86aeda
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_setim.s
@@ -0,0 +1,39 @@
+; @(#)_setim.s 2.2 90/10/14 21:57:33, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _setim.s
+; _setim( im, di );
+;
+ .file "_setim.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00040000 ; Debugger tag word
+ .global __setim
+
+__setim:
+ const tav,HIF_setim @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_settrap.s b/newlib/libc/sys/a29khif/_settrap.s
new file mode 100644
index 000000000..259097288
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_settrap.s
@@ -0,0 +1,39 @@
+; @(#)_settrap.s 2.2 90/10/14 21:57:34, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _settrap.s
+; void *prevaddr = _settrap( int trapno, void *trapaddr );
+;
+ .file "_settrap.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00040000 ; Debugger tag word
+ .global __settrap
+
+__settrap:
+ const tav,HIF_settrap @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_setvec.s b/newlib/libc/sys/a29khif/_setvec.s
new file mode 100644
index 000000000..09d4076f5
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_setvec.s
@@ -0,0 +1,38 @@
+; @(#)_setvec.s 1.2 90/10/14 21:57:35, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _setvec.s
+; int success = _setvec( int trap_no, void (*handler)( void ) );
+;
+ .file "_setvec.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00040000 ; Debugger tag word
+ .global __setvec
+
+__setvec:
+ const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .end
diff --git a/newlib/libc/sys/a29khif/_tmpnam.s b/newlib/libc/sys/a29khif/_tmpnam.s
new file mode 100644
index 000000000..c7795e27a
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_tmpnam.s
@@ -0,0 +1,41 @@
+; @(#)_tmpnam.s 1.2 90/10/14 21:57:36, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _tmpnam.s
+; char *cp = _khif_tmpnam( char *bufr );
+; /* same as ANSI tmpnam(), but NULL arg is not allowed */
+; NOTE - Will not work on BSD (no tmpnam sys call)
+;
+ .file "_tmpnam.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __khif_tmpnam
+
+__khif_tmpnam:
+ const tav,HIF_tmpnam @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/_write.s b/newlib/libc/sys/a29khif/_write.s
new file mode 100644
index 000000000..21c0e5815
--- /dev/null
+++ b/newlib/libc/sys/a29khif/_write.s
@@ -0,0 +1,40 @@
+; @(#)_write.s 1.4 90/10/14 21:57:37, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _write.s
+; int written = _write( int fd, char *buf, int count );
+;
+ .file "_write.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00050000 ; Debugger tag word
+ .global __write
+;; syscalls used now -- .global _write
+
+__write:
+;; syscalls used now -- _write:
+ const tav,HIF_write @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .end
diff --git a/newlib/libc/sys/a29khif/aclocal.m4 b/newlib/libc/sys/a29khif/aclocal.m4
new file mode 100644
index 000000000..70d481020
--- /dev/null
+++ b/newlib/libc/sys/a29khif/aclocal.m4
@@ -0,0 +1,282 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+dnl This provides configure definitions used by all the newlib
+dnl configure.in files.
+
+dnl Basic newlib configury. This calls basic introductory stuff,
+dnl including AM_INIT_AUTOMAKE and AC_CANONICAL_HOST. It also runs
+dnl configure.host. The only argument is the relative path to the top
+dnl newlib directory.
+
+AC_DEFUN(NEWLIB_CONFIGURE,
+[
+dnl Default to --enable-multilib
+AC_ARG_ENABLE(multilib,
+[ --enable-multilib build many library versions (default)],
+[case "${enableval}" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
+ esac], [multilib=yes])dnl
+
+dnl Support --enable-target-optspace
+AC_ARG_ENABLE(target-optspace,
+[ --enable-target-optspace optimize for space],
+[case "${enableval}" in
+ yes) target_optspace=yes ;;
+ no) target_optspace=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for target-optspace option) ;;
+ esac], [target_optspace=])dnl
+
+dnl Support --enable-newlib-mb
+AC_ARG_ENABLE(newlib-mb,
+[ --enable-newlib-mb enable multibyte support],
+[case "${enableval}" in
+ yes) newlib_mb=yes ;;
+ no) newlib_mb=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for newlib-mb option) ;;
+ esac], [newlib_mb=no])dnl
+
+dnl We may get other options which we don't document:
+dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
+
+test -z "[$]{with_target_subdir}" && with_target_subdir=.
+
+if test "[$]{srcdir}" = "."; then
+ if test "[$]{with_target_subdir}" != "."; then
+ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
+ else
+ newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
+ fi
+else
+ newlib_basedir="[$]{srcdir}/$1"
+fi
+AC_SUBST(newlib_basedir)
+
+AC_CANONICAL_HOST
+
+AM_INIT_AUTOMAKE(newlib, 1.8.1)
+
+# FIXME: We temporarily define our own version of AC_PROG_CC. This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable. This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ AC_PROG_CC_G
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
+
+# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
+# run it explicitly here, it will be run implicitly before
+# NEWLIB_CONFIGURE, which doesn't work because that means that it will
+# be run before AC_CANONICAL_HOST.
+AC_CANONICAL_BUILD
+
+AC_CHECK_TOOL(AS, as)
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+AC_PROG_INSTALL
+
+AM_MAINTAINER_MODE
+
+# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
+# at least currently, we never actually build a program, so we never
+# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
+# fails, because we are probably configuring with a cross compiler
+# which can't create executables. So we include AC_EXEEXT to keep
+# automake happy, but we don't execute it, since we don't care about
+# the result.
+if false; then
+ AC_EXEEXT
+fi
+
+. [$]{newlib_basedir}/configure.host
+
+case [$]{newlib_basedir} in
+/* | [A-Za-z]:[/\\]*) newlib_flagbasedir=[$]{newlib_basedir} ;;
+*) newlib_flagbasedir='[$](top_builddir)/'[$]{newlib_basedir} ;;
+esac
+
+newlib_cflags="[$]{newlib_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{newlib_flagbasedir}/libc/include"
+case "${host}" in
+ *-*-cygwin*)
+ newlib_cflags="[$]{newlib_cflags} -I[$]{newlib_flagbasedir}/../winsup/cygwin/include -I[$]{newlib_flagbasedir}/../winsup/w32api/include"
+ ;;
+esac
+
+newlib_cflags="[$]{newlib_cflags} -fno-builtin"
+
+NEWLIB_CFLAGS=${newlib_cflags}
+AC_SUBST(NEWLIB_CFLAGS)
+
+AC_SUBST(machine_dir)
+AC_SUBST(sys_dir)
+])
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
diff --git a/newlib/libc/sys/a29khif/alloc.s b/newlib/libc/sys/a29khif/alloc.s
new file mode 100644
index 000000000..cd90022a5
--- /dev/null
+++ b/newlib/libc/sys/a29khif/alloc.s
@@ -0,0 +1,64 @@
+;
+;(#)_alloc.s 1.4 90/10/14 21:57:19, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; 07/06/89 (JS) Replaced call to const tav,HIF_macro
+; and deleted call to reterr macro as a NULL needs to be
+; returned on failure.
+; _alloc.s
+; void *vp = _sysalloc( int size );
+;
+ .file "_alloc.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global __sysalloc
+__sysalloc:
+ const tav,HIF_alloc
+ asneq V_SYSCALL,gr1,gr1
+ jmpti tav, lr0
+ const tpc, _errno
+ consth tpc, _errno
+ store 0, 0, tav, tpc
+ jmpi lr0
+ const v0, 0 ; return NULL on error.
+
+;
+; int errret = _sysfree( void *addr, int size );
+;
+ .global __sysfree
+__sysfree:
+ const tav,HIF_free
+ asneq V_SYSCALL,gr1,gr1
+ jmpti tav,lr0
+ const tpc,_errno
+ consth tpc,_errno
+ store 0,0,tav,tpc
+ jmpi lr0
+ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/clock.s b/newlib/libc/sys/a29khif/clock.s
new file mode 100644
index 000000000..5cb26dff0
--- /dev/null
+++ b/newlib/libc/sys/a29khif/clock.s
@@ -0,0 +1,41 @@
+; @(#)clock.s 1.3 90/10/14 21:57:43, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; clock.s
+; long ticks = clock( );
+;
+ .file "clock.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00020000 ; Debugger tag word
+ .global _clock
+ .global __clock
+
+_clock:
+__clock:
+ const tav,HIF_clock @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/configure b/newlib/libc/sys/a29khif/configure
new file mode 100755
index 000000000..0279884f6
--- /dev/null
+++ b/newlib/libc/sys/a29khif/configure
@@ -0,0 +1,1687 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-multilib build many library versions (default)"
+ac_help="$ac_help
+ --enable-target-optspace optimize for space"
+ac_help="$ac_help
+ --enable-newlib-mb enable multibyte support"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=_alloc.s
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+else
+ CONFIG_SITE="$sitefile"
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ac_aux_dir=
+for ac_dir in ../../../.. $srcdir/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in ../../../.. $srcdir/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:578: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:631: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:688: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test $host != $build; then
+ ac_tool_prefix=${host_alias}-
+else
+ ac_tool_prefix=
+fi
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:721: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 726 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:754: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 759 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+# Check whether --enable-multilib or --disable-multilib was given.
+if test "${enable_multilib+set}" = set; then
+ enableval="$enable_multilib"
+ case "${enableval}" in
+ yes) multilib=yes ;;
+ no) multilib=no ;;
+ *) { echo "configure: error: bad value ${enableval} for multilib option" 1>&2; exit 1; } ;;
+ esac
+else
+ multilib=yes
+fi
+
+# Check whether --enable-target-optspace or --disable-target-optspace was given.
+if test "${enable_target_optspace+set}" = set; then
+ enableval="$enable_target_optspace"
+ case "${enableval}" in
+ yes) target_optspace=yes ;;
+ no) target_optspace=no ;;
+ *) { echo "configure: error: bad value ${enableval} for target-optspace option" 1>&2; exit 1; } ;;
+ esac
+else
+ target_optspace=
+fi
+
+# Check whether --enable-newlib-mb or --disable-newlib-mb was given.
+if test "${enable_newlib_mb+set}" = set; then
+ enableval="$enable_newlib_mb"
+ case "${enableval}" in
+ yes) newlib_mb=yes ;;
+ no) newlib_mb=no ;;
+ *) { echo "configure: error: bad value ${enableval} for newlib-mb option" 1>&2; exit 1; } ;;
+ esac
+else
+ newlib_mb=no
+fi
+
+
+test -z "${with_target_subdir}" && with_target_subdir=.
+
+if test "${srcdir}" = "."; then
+ if test "${with_target_subdir}" != "."; then
+ newlib_basedir="${srcdir}/${with_multisrctop}../../../.."
+ else
+ newlib_basedir="${srcdir}/${with_multisrctop}../../.."
+ fi
+else
+ newlib_basedir="${srcdir}/../../.."
+fi
+
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:840: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
+
+PACKAGE=newlib
+
+VERSION=1.8.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:881: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:894: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:907: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:920: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:933: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+# FIXME: We temporarily define our own version of AC_PROG_CC. This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable. This should really be fixed in autoconf
+# itself.
+
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:958: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:988: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1037: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1061: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+
+
+# AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
+# run it explicitly here, it will be run implicitly before
+# NEWLIB_CONFIGURE, which doesn't work because that means that it will
+# be run before AC_CANONICAL_HOST.
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1094: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+
+# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1115: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
+fi
+fi
+AS="$ac_cv_prog_AS"
+if test -n "$AS"; then
+ echo "$ac_t""$AS" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1147: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+ echo "$ac_t""$AR" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1179: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1211: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ RANLIB=":"
+fi
+fi
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1256: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1310: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
+# at least currently, we never actually build a program, so we never
+# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
+# fails, because we are probably configuring with a cross compiler
+# which can't create executables. So we include AC_EXEEXT to keep
+# automake happy, but we don't execute it, since we don't care about
+# the result.
+if false; then
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1344: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+fi
+
+. ${newlib_basedir}/configure.host
+
+case ${newlib_basedir} in
+/* | A-Za-z:/\\*) newlib_flagbasedir=${newlib_basedir} ;;
+*) newlib_flagbasedir='$(top_builddir)/'${newlib_basedir} ;;
+esac
+
+newlib_cflags="${newlib_cflags} -I"'$(top_builddir)'"/../../../targ-include -I${newlib_flagbasedir}/libc/include"
+case "${host}" in
+ *-*-cygwin*)
+ newlib_cflags="${newlib_cflags} -I${newlib_flagbasedir}/../winsup/cygwin/include -I${newlib_flagbasedir}/../winsup/w32api/include"
+ ;;
+esac
+
+newlib_cflags="${newlib_cflags} -fno-builtin"
+
+NEWLIB_CFLAGS=${newlib_cflags}
+
+
+
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@newlib_basedir@%$newlib_basedir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@AS@%$AS%g
+s%@AR@%$AR%g
+s%@RANLIB@%$RANLIB%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g
+s%@machine_dir@%$machine_dir%g
+s%@sys_dir@%$sys_dir%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/newlib/libc/sys/a29khif/configure.in b/newlib/libc/sys/a29khif/configure.in
new file mode 100644
index 000000000..de247d3d3
--- /dev/null
+++ b/newlib/libc/sys/a29khif/configure.in
@@ -0,0 +1,12 @@
+dnl This is the newlib/libc/sys/a29khif configure.in file.
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(_alloc.s)
+
+dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
+AC_CONFIG_AUX_DIR(../../../..)
+
+NEWLIB_CONFIGURE(../../..)
+
+AC_OUTPUT(Makefile)
diff --git a/newlib/libc/sys/a29khif/crt0.s b/newlib/libc/sys/a29khif/crt0.s
new file mode 100644
index 000000000..8ae79f898
--- /dev/null
+++ b/newlib/libc/sys/a29khif/crt0.s
@@ -0,0 +1,226 @@
+; @(#)crt0.s 2.7 90/10/15 13:17:57, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ .file "crt0.s"
+; crt0.s version 2.1-7
+;
+; This module gets control from the OS.
+; It saves away the Am29027 Mode register settings and
+; then sets up the pointers to the resident spill and fill
+; trap handlers. It then establishes argv and argc for passing
+; to main. It then calls _main. If main returns, it calls _exit.
+;
+; void = start( );
+; NOTE - not C callable (no lead underscore)
+;
+ .include "sys/sysmac.h"
+;
+;
+ .extern V_SPILL, V_FILL
+ .comm __29027Mode, 8 ; A shadow of the mode register
+ .comm __LibInit, 4
+ .comm __environ, 4 ; Environment variables, currently none.
+ .text
+ .extern _main, _exit
+ .extern _memset
+
+ .word 0 ; Terminating tag word
+ .global start
+start:
+ sub gr1, gr1, 6 * 4
+ asgeu V_SPILL, gr1, rab ; better not ever happen
+ add lr1, gr1, 6 * 4
+;
+; Initialize the .bss section to zero by using the memset library function.
+; The .bss initialization section below has been commented out as it breaks
+; XRAY29K that has been released. The operators sizeof and startof create
+; new sections that are not recognized by XRAY29k, but will be implemented
+; in the next release (2.0).
+;
+; const lr4, $sizeof(.bss) ; get size of .bss section to zero out
+; consth lr4, $sizeof(.bss)
+; const lr2, $startof(.bss) ; Get start address of .bss section
+; consth lr2, $startof(.bss)
+; const lr0, _memset ; address of memset function
+; consth lr0, _memset
+; calli lr0, lr0 ; call memset function
+; const lr3, 0
+
+; Save the initial value of the Am29027's Mode register
+; If your const tav,HIF_does @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 not enter crt0 with value for Am29027's Mode register
+; in gr96 and gr97, and also if the coprocessor is active uncomment the
+; next 4 lines.
+; const gr96, 0xfc00820
+; consth gr96, 0xfc00820
+; const gr97, 0x1375
+; store 1, 3, gr96, gr97
+;
+ const gr98, __29027Mode
+ consth gr98, __29027Mode
+ store 0, 0, gr96, gr98
+ add gr98, gr98, 4
+ store 0, 0, gr97, gr98
+;
+; Now call the const tav,HIF_to @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1 setup the spill and fill trap handlers
+;
+ const lr3, spill
+ consth lr3, spill
+ const lr2, V_SPILL
+ const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1
+ const lr3, fill
+ consth lr3, fill
+ const lr2, V_FILL
+ const tav,HIF_setvec @ asneq V_SYSCALL,gr1,gr1
+;
+; Set up dividu handler, since native one don't work?!
+; Set it up by hand (FIXME) since HIF_settrap doesn't work either!
+;
+; const lr3,Edividu
+; consth lr3,Edividu
+;
+; const lr2,35
+; const tav,HIF_settrap @ asneq V_SYSCALL,gr1,gr1
+; asge 0x50,gr121,0 ; check whether it failed
+; const lr2,0x8000008c ; abs addr of dividu trap handler on EB
+; consth lr2,0x8000008c
+; store 0,0,lr3,lr2 ; Clobber vector FIXME
+
+;
+; Get the argv base address and calculate argc.
+;
+ const tav,HIF_getargs @ asneq V_SYSCALL,gr1,gr1
+ add lr3, v0, 0 ; argv
+ add lr4, v0, 0
+ constn lr2, -1
+argcloop: ; scan for NULL terminator
+ load 0, 0, gr97, lr4
+ add lr4, lr4, 4
+ cpeq gr97, gr97, 0
+ jmpf gr97, argcloop
+ add lr2, lr2, 1
+;
+; Now call LibInit, if there is one. To aid runtime libraries
+; that need to do some startup initialization, we have created
+; a bss variable called LibInit. If the library doesn't need
+; any run-time initialization, the variable is still 0. If the
+; library does need run-time initialization, the library will
+; contain a definition like
+; void (*_LibInit)(void) = LibInitFunction;
+; The linker will match up our bss LibInit with this data LibInit
+; and the variable will not be 0.
+;
+ const lr0, __LibInit
+ consth lr0, __LibInit
+ load 0, 0, lr0, lr0
+ cpeq gr96, lr0, 0
+ jmpt gr96, NoLibInit
+ nop
+ calli lr0, lr0
+ nop
+NoLibInit:
+;
+; call main, passing it 2 arguments. main( argc, argv )
+;
+ const lr0, _main
+ consth lr0, _main
+ calli lr0, lr0
+ nop
+;
+; call exit
+;
+ const lr0, _exit
+ consth lr0, _exit
+ calli lr0, lr0
+ add lr2, gr96, 0
+;
+; Should never get here, but just in case
+;
+loop:
+ const tav,HIF_exit @ asneq V_SYSCALL,gr1,gr1
+ jmp loop
+ nop
+ .sbttl "Spill and Fill trap handlers"
+ .eject
+;
+; SPILL, FILL trap handlers
+;
+; Note that these Spill and Fill trap handlers allow the OS to
+; assume that the only registers of use are between gr1 and rfb.
+; Therefore, if the OS desires to, it may simply preserve from
+; lr0 for (rfb-gr1)/4 registers when doing a context save.
+;
+;
+; Here is the spill handler
+;
+; spill registers from [*gr1..*rab)
+; and move rab downto where gr1 points
+;
+; rab must change before rfb for signals to work
+;
+; On entry: rfb - rab = windowsize, gr1 < rab
+; Near the end: rfb - rab > windowsize, gr1 == rab
+; On exit: rfb - rab = windowsize, gr1 == rab
+;
+ .global spill
+spill:
+ sub tav, rab, gr1 ; tav = number of bytes to spill
+ srl tav, tav, 2 ; change byte count to word count
+ sub tav, tav, 1 ; make count zero based
+ mtsr cr, tav ; set Count Remaining register
+ sub tav, rab, gr1
+ sub tav, rfb, tav ; pull down free bound and save it in rab
+ add rab, gr1, 0 ; first pull down allocate bound
+ storem 0, 0, lr0, tav ; store lr0..lr(tav) into rfb
+ jmpi tpc ; return...
+ add rfb, tav, 0
+;
+; Here is the fill handler
+;
+; fill registers from [*rfb..*lr1)
+; and move rfb upto where lr1 points.
+;
+; rab must change before rfb for signals to work
+;
+; On entry: rfb - rab = windowsize, lr1 > rfb
+; Near the end: rfb - rab < windowsize, lr1 == rab + windowsize
+; On exit: rfb - rab = windowsize, lr1 == rfb
+;
+ .global fill
+fill:
+ const tav, 0x80 << 2
+ or tav, tav, rfb ; tav = ((rfb>>2) | 0x80)<<2 == [rfb]<<2
+ mtsr ipa, tav ; ipa = [rfb]<<2 == 1st reg to fill
+ ; gr0 is now the first reg to spill
+ sub tav, lr1, rfb ; tav = number of bytes to spill
+ add rab, rab, tav ; push up allocate bound
+ srl tav, tav, 2 ; change byte count to word count
+ sub tav, tav, 1 ; make count zero based
+ mtsr cr, tav ; set Count Remaining register
+ loadm 0, 0, gr0, rfb ; load registers
+ jmpi tpc ; return...
+ add rfb, lr1, 0 ; ... first pushing up free bound
+
+ .end
diff --git a/newlib/libc/sys/a29khif/getargs.s b/newlib/libc/sys/a29khif/getargs.s
new file mode 100644
index 000000000..aa1f9c442
--- /dev/null
+++ b/newlib/libc/sys/a29khif/getargs.s
@@ -0,0 +1,38 @@
+; @(#)getargs.s 1.2 90/10/14 21:57:44, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _getargs.s
+; void _getargs( void );
+;
+ .file "_getargs.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00020000 ; Debugger tag word
+ .global __getargs
+
+__getargs:
+ const tav,HIF_getargs @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .end
diff --git a/newlib/libc/sys/a29khif/getenv.s b/newlib/libc/sys/a29khif/getenv.s
new file mode 100644
index 000000000..4351849a0
--- /dev/null
+++ b/newlib/libc/sys/a29khif/getenv.s
@@ -0,0 +1,48 @@
+; @(#)getenv.s 1.4 90/10/14 21:57:45, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; getenv.s
+; char *value = getenv( const char *name );
+;
+ .file "getenv.s"
+
+ .include "sys/sysmac.h"
+
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global _getenv
+ .global __getenv
+_getenv:
+__getenv:
+ const tav,HIF_getenv @ asneq V_SYSCALL,gr1,gr1 ; HIF service trap
+ jmpti tav, lr0 ; If tav is true, were finished, return.
+ const tpc, _errno
+ consth tpc, _errno ; Otherwise,
+ store 0, 0, tav, tpc ; store error code in _errno,
+ jmpi lr0 ; then return
+ const v0, 0 ; with a value of 0 (NULL pointer).
+
+ .end
diff --git a/newlib/libc/sys/a29khif/getpid.c b/newlib/libc/sys/a29khif/getpid.c
new file mode 100644
index 000000000..99d88bd39
--- /dev/null
+++ b/newlib/libc/sys/a29khif/getpid.c
@@ -0,0 +1,12 @@
+/* Stub for getpid. */
+
+#include <_ansi.h>
+
+/* This should really return pid_t, but that doesn't seem to be in
+ <sys/types.h>. */
+
+int
+_DEFUN_VOID (_getpid)
+{
+ return 1;
+}
diff --git a/newlib/libc/sys/a29khif/kill.c b/newlib/libc/sys/a29khif/kill.c
new file mode 100644
index 000000000..ff9fe5428
--- /dev/null
+++ b/newlib/libc/sys/a29khif/kill.c
@@ -0,0 +1,21 @@
+/* Stub for kill. */
+
+#include <_ansi.h>
+#include <errno.h>
+
+/* The pid argument should be of type pid_t. */
+
+int
+_DEFUN (_kill, (pid, sig),
+ int pid _AND
+ int sig)
+{
+ if (pid == 1 || pid < 0)
+ {
+ if (sig == 0)
+ return 0;
+ return raise (sig);
+ }
+ errno = EINVAL;
+ return -1;
+}
diff --git a/newlib/libc/sys/a29khif/read.s b/newlib/libc/sys/a29khif/read.s
new file mode 100644
index 000000000..1a5daf301
--- /dev/null
+++ b/newlib/libc/sys/a29khif/read.s
@@ -0,0 +1,54 @@
+; @(#)_read.s 1.4 90/10/14 21:57:32, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _read.s
+; int nread = _read( int fd, char *buf, int count );
+;
+ .file "_read.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00050000 ; Debugger tag word
+ .global __read
+;; syscalls used now -- .global _read
+
+__read:
+;; syscalls used now -- _read:
+ .ifdef _BSD_OS
+; BSD version - uses readv const tav,HIF_call @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ sub msp, msp, 8
+ store 0, 0, lr3, msp
+ add tav, msp, 4
+ add lr3, msp, 0
+ store 0, 0, lr4, tav
+ const lr4, 1
+ const tav,HIF_readv @ asneq V_SYSCALL,gr1,gr1
+ jmpti tav, lr0
+ add msp, msp, 8
+ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .else
+ const tav,HIF_read @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+ .endif
+ .end
diff --git a/newlib/libc/sys/a29khif/remove.s b/newlib/libc/sys/a29khif/remove.s
new file mode 100644
index 000000000..948be04c2
--- /dev/null
+++ b/newlib/libc/sys/a29khif/remove.s
@@ -0,0 +1,43 @@
+; @(#)remove.s 1.3 90/10/14 21:57:53, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; remove.s
+; int cc = remove( char *path );
+;
+ .file "remove.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global _remove
+ .global __remove
+ .global __unlink
+
+_remove:
+__remove:
+__unlink:
+ const tav,HIF_remove @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/rename.s b/newlib/libc/sys/a29khif/rename.s
new file mode 100644
index 000000000..31da614e3
--- /dev/null
+++ b/newlib/libc/sys/a29khif/rename.s
@@ -0,0 +1,41 @@
+; @(#)rename.s 1.3 90/10/14 21:57:54, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; rename.s
+; int cc = rename( char *from, char *to );
+;
+ .file "rename.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00040000 ; Debugger tag word
+ .global _rename
+ .global __rename
+
+_rename:
+__rename:
+ const tav,HIF_rename @ asneq V_SYSCALL,gr1,gr1 @ jmpti tav,lr0 @ const tpc,_errno @ consth tpc,_errno @ store 0,0,tav,tpc @ jmpi lr0 @ constn v0,-1
+
+ .end
diff --git a/newlib/libc/sys/a29khif/signal.s b/newlib/libc/sys/a29khif/signal.s
new file mode 100644
index 000000000..29273a0d3
--- /dev/null
+++ b/newlib/libc/sys/a29khif/signal.s
@@ -0,0 +1,452 @@
+;@(#)signal.s 2.15 90/10/14 21:57:55, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ .file "signal.s"
+
+; SigEntry is the address of an array of C-level user code signal handlers.
+; They must return to the top-level before doing a sigret() return function.
+; Nested signals are supported.
+
+ .extern V_SPILL, V_FILL
+ .extern fill ; In crt0.s
+
+ .align 4
+ .comm WindowSize, 4
+ .data
+SigEntry:
+ .word 0 ; reserved
+ .word 0 ; adds. of #2 SIGINT handler
+ .word 0 ; reserved
+ .word 0 ; reserved
+ .word 0 ; reserved
+ .word 0 ; reserved
+ .word 0 ; reserved
+ .word 0 ; adds. of #8 SIGFPE handler
+
+ .text
+
+ .reg v0, gr96
+ .reg v1, gr97
+ .reg v2, gr98
+ .reg v3, gr99
+
+ .reg tav, gr121
+ .reg tpc, gr122
+ .reg lrp, gr123
+ .reg slp, gr124
+ .reg msp, gr125
+ .reg rab, gr126
+ .reg rfb, gr127
+
+;=================================================================== setjmp()
+; int
+; setjmp(label_t jmpbuf)
+; {
+; *jmpbuf = {gr1, msp, lr0, lr1};
+; return 0;
+; }
+;
+ .global _setjmp
+_setjmp:
+ store 0, 0, gr1, lr2
+ add lr2, lr2, 4
+ store 0, 0, msp, lr2
+ add lr2, lr2, 4
+ store 0, 0, lr0, lr2
+ add lr2, lr2, 4
+ store 0, 0, lr1, lr2
+ jmpi lr0
+ const v0, 0
+;
+;==================================================================== longjmp()
+; int
+; longjmp(label_t jmpbuf, int value)
+; {
+; /* BUG: check for this
+; if (msp > jmpbuf->msp || gr1 > jmpbuf->gr1)
+; longjmperror();
+; */
+;
+; gr1 = jmpbuf->gr1;
+; lr2addr = jmpbuf->gr1 + 8;
+; msp = jmpbuf->msp;
+;
+; /* saved lr1 is invalid if saved lr2addr > rfb */
+; if (lr2addr > rfb) {
+; /*
+; * None of the registers are useful.
+; * Set rfb to lr2addr - 512 & rab to rfb - 512.
+; * the FILL assert will take care of filling
+; */
+; lr1 = jmpbuf->lr1;
+; rab = lr2addr - windowsize;
+; rfb = lr2addr;
+; }
+;
+; lr0 = jmpbuf->lr0;
+; if (rfb < lr1)
+; raise V_FILL;
+; return value;
+; }
+;
+ .global _longjmp
+_longjmp:
+ load 0, 0, tav, lr2 ; copy in gr1
+ add v1, lr2, 4 ; v1 points to msp
+ ; make sure we return a non-zero value
+ cpeq v0, lr3, 0
+ srl v0, v0, 31
+ or v0, lr3, v0
+
+ add gr1, tav, 0 ; now update gr1
+ add tav, tav, 8 ; calculate lr2addr
+ load 0, 0, msp, v1 ; update msp from jmpbuf
+ cpleu v3, tav, rfb ; if (lr2addr > rfb)
+ jmpt v3, $1 ; {
+ add v1, v1, 4 ; v1 points to lr0
+ add v2, v1, 4 ; v2 points to lr1
+ load 0, 0, lr1, v2 ; lr1 = value from jmpbuf
+ sub v3, rfb, rab ;
+ sub rab, tav, v3 ; rab = lr2addr - windowsize
+ add rfb, tav, 0 ; rfb = lr2addr
+$1: ; }
+ load 0, 0, lr0, v1
+ jmpi lr0
+ asgeu V_FILL, rfb, lr1 ; may fill from rfb to lr1
+;
+;================================================================== sigcode
+; About to deliver a signal to a user mode signal handler.
+; msp+(15*4) = signal_number
+; msp+(14*4) = gr1
+; msp+(13*4) = rab
+; msp+(12*4) = PC0
+; msp+(11*4) = PC1
+; msp+(10*4) = PC2
+; msp+( 9*4) = CHA
+; msp+( 8*4) = CHD
+; msp+( 7*4) = CHC
+; msp+( 6*4) = ALU
+; msp+( 5*4) = OPS
+; msp+( 4*4) = gr121
+; msp+( 3*4) = gr99
+; msp+( 2*4) = gr98
+; msp+( 1*4) = gr97
+; msp = gr96
+; The state of all the registers (except for msp, chc and rab)
+; is the same as when the process was interrupted.
+;
+; We must make the stack and window consistent before calling the handler
+; The orignal rab value is on the stack. The interrupt handler placed
+; rfb-Windowsize in rab. This is required to support nested interrupts.
+;
+; Note that the window becomes incosistent only during certain
+; critical sections in spill, fill, longjmp and sigcode.
+; rfb - rab > windowsize => we are in spill
+; rfb - rab < windowsize => we are in fill
+; gr1 + 8 > rfb => we are in long-longjmp case
+; In case of spill, fill and lonjmp; rab is modified first,
+; so if we are in one of these critical sections,
+; we set rab to rfb - WINDOWSIZE.
+;
+ .equ SIGCTX_SIZE, (16)*4
+ .equ SIGCTX_SIGNUMB, (15)*4
+ .equ SIGCTX_GR1_OFFSET, (14)*4
+ .equ SIGCTX_RAB_OFFSET, (13)*4
+ .equ SIGCTX_PC0_OFFSET, (12)*4
+ .equ SIGCTX_PC1_OFFSET, (11)*4
+ .equ SIGCTX_PC2_OFFSET, (10)*4
+ .equ SIGCTX_CHC_OFFSET, (7)*4
+ .equ SIGCTX_OPS_OFFSET, (5)*4
+ .equ SIGCTX_TAV_OFFSET, (4)*4
+ .global sigcode
+sigcode:
+; -------------------------------------------------------- R-Stack fixup
+ const v0, WindowSize ; get register cache size
+ consth v0, WindowSize
+ load 0, 0, v0, v0
+ add v2, msp, SIGCTX_RAB_OFFSET
+ load 0, 0, v2, v2 ; get interrupted rab value
+ sub v1, rfb, v2 ; determine if rfb-rab <= WINDOW_SIZE
+ cpgeu v1, v1, v0 ;
+ jmpt v1, nfill ; jmp if spill or 'normal' interrupt
+ add v1, gr1, 8
+ cpgt v1, v1, rfb ; interrupted longjmp can look like fill
+ jmpf v1, nfill ; test for long-longjmp interruption
+ nop ; jmp if gr1+8 <= rfb
+; Fixup signal stack to re-start interrupted fill
+; backup pc1 -- this is needed for the partial fill case.
+; Clear chc so an interrupted load/store does not restart.
+; Reset rab to a window distance below rfb, rab shall be
+; decremented again on re-starting the interrupted fill.
+; The interrupt handler set rab=rfb-WindowSize.
+;
+ add v0, msp, SIGCTX_RAB_OFFSET
+ store 0, 0, rab, v0 ; re-store (rfb-WindowSize) for rab
+ const v2, fill
+ consth v2, fill
+ add v0, msp, SIGCTX_PC1_OFFSET
+ store 0, 0, v2, v0
+ sub v2, v2, 4 ; determine pc0
+ add v0, msp, SIGCTX_PC0_OFFSET
+ store 0, 0, v2, v0
+ const v2, 0 ; clear chc
+ add v0, msp, SIGCTX_CHC_OFFSET
+ store 0, 0, v2, v0
+
+nfill:
+ cpgt v0, gr1, rfb ; if gr1 > rfb then gr1 = rfb
+ jmpt v0, lower
+ cplt v0, gr1, rab ; if gr1 < rab then gr1 = rab
+ jmpt v0, raise
+ nop
+; -------------------------------------------------------- save_regs
+sig1: sub msp, msp, (4+2+25)*4 ; reserve space for regs
+ mfsr gr96, ipc
+ mfsr gr97, ipa
+ mfsr gr98, ipb
+ mfsr gr99, q
+ mtsrim cr, 4-1
+ storem 0, 0, gr96, msp
+; "push" registers stack support
+ add gr96, lr1, 0
+ add gr97, rfb, 0
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ storem 0, 0, gr96, gr99
+; "push" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ storem 0, 0, gr100, gr96
+;
+; -------------------------------------------------------- Dummy Call
+ .equ RALLOC, 4*4 ; make space for function calls
+ add v0, rfb, 0 ; store original rfb
+ sub gr1, gr1, RALLOC
+ asgeu V_SPILL, gr1, rab
+ add lr1, v0, 0 ; set lr1 = original rfb
+ add v1, msp, (4+2+25)*4 + SIGCTX_SIGNUMB
+ load 0, 0, lr2, v1 ; restore signal number
+ sub v1, lr2, 1 ; get handler index
+ sll v1, v1, 2 ; point to addresses
+;
+; -------------------------------------------------------- call C-level
+; Handler must not use HIF services other than the _sigret() type.
+ const v0, SigEntry
+ consth v0, SigEntry
+ add v0, v0, v1
+ load 0, 0, v0, v0 ; determine if handler registered
+ cpeq v1, v0, 0
+ jmpt v1, NoHandler
+ nop
+ calli lr0, v0 ; call C-level signal handler
+ nop
+;
+; -------------------------------------------------------- default return
+NoHandler:
+ jmp __sigdfl
+ nop
+
+; -------------------------------------------------------- support bits
+lower: sll gr1, rfb, 0
+ jmp sig1
+ nop
+raise: sll gr1, rab, 0
+ jmp sig1
+ nop
+/*
+; -------------------------------------------------------- repair_regs
+ mtsrim cr, 4-1
+ loadm 0, 0, gr96, msp
+ mtsr ipc, gr96
+ mtsr ipa, gr97
+ mtsr ipb, gr98
+ mtsr Q, gr99
+; "pop" registers stack support
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ loadm 0, 0, gr96, gr99
+ add lr1, gr96, 0
+ add rfb, gr97, 0
+; "pop" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ loadm 0, 0, gr100, gr96
+ add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value
+; -------------------------------------------------------- end repair
+*/
+
+; ======================================================== _sigret()
+ .global __sigret
+__sigret:
+; repair_regs
+; -------------------------------------------------------- repair_regs
+ mtsrim cr, 4-1
+ loadm 0, 0, gr96, msp
+ mtsr ipc, gr96
+ mtsr ipa, gr97
+ mtsr ipb, gr98
+ mtsr q, gr99
+; "pop" registers stack support
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ loadm 0, 0, gr96, gr99
+ add lr1, gr96, 0
+ add rfb, gr97, 0
+; "pop" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ loadm 0, 0, gr100, gr96
+ add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value
+; -------------------------------------------------------- end repair
+ const tav, 323 ; HIF _sigret
+ asneq 69, gr1,gr1
+ halt ; commit suicide if returns
+
+; ======================================================== _sigdfl()
+ .global __sigdfl
+__sigdfl:
+; repair_regs
+; -------------------------------------------------------- repair_regs
+ mtsrim cr, 4-1
+ loadm 0, 0, gr96, msp
+ mtsr ipc, gr96
+ mtsr ipa, gr97
+ mtsr ipb, gr98
+ mtsr q, gr99
+; "pop" registers stack support
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ loadm 0, 0, gr96, gr99
+ add lr1, gr96, 0
+ add rfb, gr97, 0
+; "pop" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ loadm 0, 0, gr100, gr96
+ add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value
+; -------------------------------------------------------- end repair
+ const tav, 322 ; HIF _sigdfl
+ asneq 69, gr1,gr1
+ halt ; commit suicide if returns
+
+; ======================================================== _sigrep()
+__sigrep:
+ .global __sigrep
+; repair_regs
+; -------------------------------------------------------- repair_regs
+ mtsrim cr, 4-1
+ loadm 0, 0, gr96, msp
+ mtsr ipc, gr96
+ mtsr ipa, gr97
+ mtsr ipb, gr98
+ mtsr q, gr99
+; "pop" registers stack support
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ loadm 0, 0, gr96, gr99
+ add lr1, gr96, 0
+ add rfb, gr97, 0
+; "pop" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ loadm 0, 0, gr100, gr96
+ add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value
+; -------------------------------------------------------- end repair
+ const tav, 324 ; HIF _sigrep
+ asneq 69, gr1,gr1
+ halt ; commit suicide if returns
+
+; ======================================================== _sigskp()
+ .global __sigskp
+__sigskp:
+; repair_regs
+; -------------------------------------------------------- repair_regs
+ mtsrim cr, 4-1
+ loadm 0, 0, gr96, msp
+ mtsr ipc, gr96
+ mtsr ipa, gr97
+ mtsr ipb, gr98
+ mtsr q, gr99
+; "pop" registers stack support
+ mtsrim cr, 2-1
+ add gr99, msp, 2*4
+ loadm 0, 0, gr96, gr99
+ add lr1, gr96, 0
+ add rfb, gr97, 0
+; "pop" remaining global registers
+ mtsrim cr, 25-1 ; gr100-gr124
+ add gr96, msp, (4+2)*4
+ loadm 0, 0, gr100, gr96
+ add msp, msp, (4+2+25)*4 ; repair msp to save_regs entry value
+; -------------------------------------------------------- end repair
+ const tav, 325 ; HIF _sigskp
+ asneq 69, gr1,gr1
+ halt ; commit suicide if returns
+
+; ======================================================== _sendsig()
+; lr2 = signal number
+ .global _raise
+ .global __sendsig
+_raise:
+__sendsig:
+ const tav, 326 ; HIF sendsig
+ asneq 69, gr1,gr1
+ jmpi lr0
+ nop
+
+;
+; ======================================================== signal()
+; lr2 = signal number
+; lr3 = handler address
+ .global _signal
+_signal:
+; the memory variable WindowSize must be initalised at the
+; start when rfb and rab are a window size apart.
+ const v0, WindowSize ; get register cache size
+ consth v0, WindowSize
+ load 0, 0, v1, v0
+ cpeq v1, v1, 0
+ jmpf v1, WindowSizeOK
+ sub v1, rfb, rab ; rfb-rab = WINDOW_SIZE
+ store 0, 0, v1, v0
+WindowSizeOK:
+ const v1, SigEntry
+ consth v1, SigEntry
+ sub v3, lr2, 1 ; get handler index
+ sll v3, v3, 2 ; pointer to addresses
+ add v1, v1, v3
+ store 0,0, lr3, v1 ; save new handler
+
+ const lr2, sigcode
+ consth lr2, sigcode
+ ;Fall through to __signal
+; ======================================================== _signal()
+ .global __signal
+__signal:
+ const tav, 321 ; HIF signal
+ asneq 69, gr1,gr1
+ jmpi lr0
+ nop
diff --git a/newlib/libc/sys/a29khif/stubs.s b/newlib/libc/sys/a29khif/stubs.s
new file mode 100644
index 000000000..e0b29bc77
--- /dev/null
+++ b/newlib/libc/sys/a29khif/stubs.s
@@ -0,0 +1,135 @@
+;
+;
+; File of stubs so that unix applications can link into a HIF monitor
+;
+; sac@cygnus.com
+
+ .text
+
+ .global _sysalloc
+_sysalloc:
+ const gr121,__sysalloc
+ consth gr121,__sysalloc
+ jmpi gr121
+
+ .global _sysfree
+_sysfree:
+ const gr121,__sysfree
+ consth gr121,__sysfree
+ jmpi gr121
+
+
+ .global _cycles
+_cycles:
+ const gr121,__cycles
+ consth gr121,__cycles
+ jmpi gr121
+
+; .global _exit
+;_exit:
+; const gr121,__exit
+; consth gr121,__exit
+; jmpi gr121
+
+ .global _getpsiz
+_getpsiz:
+ const gr121,__getpsiz
+ consth gr121,__getpsiz
+ jmpi gr121
+
+ .global _gettz
+_gettz:
+ const gr121,__gettz
+ consth gr121,__gettz
+ jmpi gr121
+
+ .global _ioctl
+_ioctl:
+ const gr121,__ioctl
+ consth gr121,__ioctl
+ jmpi gr121
+
+
+ .global _iowait
+_iowait:
+ const gr121,__iowait
+ consth gr121,__iowait
+ jmpi gr121
+
+
+;; syscalls used now -- .global _open
+;; syscalls used now -- _open:
+;; syscalls used now -- const gr121,__open
+;; syscalls used now -- consth gr121,__open
+;; syscalls used now -- jmpi gr121
+
+ .global _query
+_query:
+ const gr121,__query
+ consth gr121,__query
+ jmpi gr121
+
+
+ .global _setim
+_setim:
+ const gr121,__setim
+ consth gr121,__setim
+ jmpi gr121
+
+ .global _settrap
+_settrap:
+ const gr121,__settrap
+ consth gr121,__settrap
+ jmpi gr121
+
+ .global _setvec
+_setvec:
+ const gr121,__setvec
+ consth gr121,__setvec
+ jmpi gr121
+
+ .global _getargs
+_getargs:
+ const gr121,__getargs
+ consth gr121,__getargs
+ jmpi gr121
+
+;; syscalls used now -- .global _unlink
+;; syscalls used now -- _unlink:
+;; syscalls used now -- const gr121,__unlink
+;; syscalls used now -- consth gr121,__unlink
+;; syscalls used now -- jmpi gr121
+
+ .global _sigret
+_sigret:
+ const gr121,__sigret
+ consth gr121,__sigret
+ jmpi gr121
+
+ .global _sigdfl
+_sigdfl:
+ const gr121,__sigdfl
+ consth gr121,__sigdfl
+ jmpi gr121
+
+ .global _sigrep
+_sigrep:
+ const gr121,__sigrep
+ consth gr121,__sigrep
+ jmpi gr121
+
+ .global _sigskp
+_sigskp:
+ const gr121,__sigskp
+ consth gr121,__sigskp
+ jmpi gr121
+
+ .global _sendsig
+_sendsig:
+ const gr121,__sendsig
+ consth gr121,__sendsig
+ jmpi gr121
+
+ ; fill this jmpi delay slot
+ ; the others are not done since they do not matter
+ constn lr0,-1
diff --git a/newlib/libc/sys/a29khif/sys/cpudef.h b/newlib/libc/sys/a29khif/sys/cpudef.h
new file mode 100644
index 000000000..4ec6ed39c
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/cpudef.h
@@ -0,0 +1,270 @@
+; @(#)cpudef.h 2.3 90/10/14 20:55:56, Copyright 1989, 1990 AMD
+;-----------------------------------------------------------------------
+; Useful equates
+;-----------------------------------------------------------------------
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ ; Processor status registers OPS (sr1) and CPS (sr2)
+ .equ CA,0x8000 ; Coprocessor active
+ .equ IP,0x4000 ; Interrupt pending
+ .equ TE,0x2000 ; Trace enable
+ .equ TP,0x1000 ; Trace pending
+ .equ TU,0x0800 ; Trap unaligned access
+ .equ FZ,0x0400 ; Freeze
+ .equ LK,0x0200 ; Lock
+ .equ RE,0x0100 ; ROM enable
+ .equ WM,0x0080 ; Wait mode
+ .equ PD,0x0040 ; No translation for Data
+ .equ PI,0x0020 ; No translation for Instr
+ .equ SM,0x0010 ; Supervisor mode
+ .equ IM,0x000C ; Interrupt mask
+ .equ IM1,0x0100 ; enable INTR0-1
+ .equ IM2,0x1000 ; enable INTR0-2
+ .equ IM3,0x1100 ; enable INTR0-3
+ .equ DI,0x0002 ; Disable ints
+ .equ DA,0x0001 ; Disable ints and traps
+
+ ; Configuration register CFG (sr3)
+ .equ PRL,0xFF000000 ; Processor release level
+ .equ VF,0x10 ; Vector fetch
+ .equ RV,0x08 ; ROM Vector area
+ .equ BO,0x04 ; Byte order
+ .equ CP,0x02 ; Coprocessor present
+ .equ CD,0x01 ; BTC disable
+
+ ; Channel control register CHC (sr6)
+ .equ LS,0x8000 ; Load store
+ .equ ML,0x4000 ; Multiple operation
+ .equ ST,0x2000 ; Set
+ .equ LA,0x1000 ; Lock active
+ .equ TF,0x0400 ; Transaction faulted
+ .equ TR,0x03FC ; Target register
+ .equ NN,0x0002 ; Not needed
+ .equ CV,0x0001 ; Contents valid
+
+ ; Timer reload register TMR (sr9)
+ .equ IE,0x01000000 ; timer int enable
+ .equ IN,0x02000000 ; timer int pending
+ .equ OV,0x04000000 ; timer Overflow
+
+ ; MMU configuration register MMU (sr13)
+ .equ PS,0x300 ; Page size
+ .equ PID,0xFF ; Process identifier
+
+ ; ALU status register ALU (sr132)
+ .equ DF,0x800 ; Divide flag
+ .equ V,0x400 ; Overflow
+ .equ N,0x200 ; Negative
+ .equ Z,0x100 ; Zero
+ .equ C,0x080 ; Carry
+
+ ; TLB entry
+ .equ VTAG,0xFFFF8000 ; Virtual tag
+ .equ VE,0x4000 ; Valid entry
+ .equ SR,0x2000 ; Supervisor read
+ .equ SW,0x1000 ; Supervisor write
+ .equ SE,0x0800 ; Supervisor execute
+ .equ UR,0x0400 ; User read
+ .equ UW,0x0200 ; User write
+ .equ UE,0x0100 ; User execute
+ .equ TID,0x00FF ; Task identifier
+ .equ RPN,0xFFFFFC00 ; Real page number
+ .equ PGM,0x00C0 ; User programmable
+ .equ U,0x0002 ; Usage
+ .equ F,0x0001 ; Flag
+
+;-----------------------------------------------------------------------
+;Global registers
+;-----------------------------------------------------------------------
+
+ .reg rsp, gr1 ; local register stack pointer
+
+ ; System-wide statics
+ .reg s0, gr64
+ .reg spillreg, s0 ; pointer to user spill handler
+ .reg s1, gr65
+ .reg fillreg, s1 ; pointer to user fill handler
+ .reg s2, gr66
+ .reg heapptr, s2 ; pointer to heap area
+ .reg s3, gr67
+ .reg s4, gr68
+ .reg s5, gr69
+ .reg s6, gr70
+ .reg s7, gr71
+ .reg s8, gr72
+ .reg s9, gr73
+ .reg s10, gr74
+ .reg s11, gr75
+ .reg s12, gr76
+ .reg s13, gr77
+ .reg s14, gr78
+ .reg s15, gr79
+
+ ; Interrupt handler temporaries
+ .reg i0, gr80
+ .reg i1, gr81
+ .reg i2, gr82
+ .reg i3, gr83
+ .reg i4, gr84
+ .reg i5, gr85
+ .reg i6, gr86
+ .reg i7, gr87
+ .reg i8, gr88
+ .reg i9, gr89
+ .reg i10, gr90
+ .reg i11, gr91
+ .reg i12, gr92
+ .reg i13, gr93
+ .reg i14, gr94
+ .reg i15, gr95
+
+ ; Subroutine/function temporaries
+ ; also used for function return values
+ .reg t0, gr96
+ .reg rtn, t0
+ .reg t1, gr97
+ .reg t2, gr98
+ .reg t3, gr99
+ .reg t4, gr100
+ .reg t5, gr101
+ .reg t6, gr102
+ .reg t7, gr103
+ .reg t8, gr104
+ .reg t9, gr105
+ .reg t10, gr106
+ .reg t11, gr107
+ .reg t12, gr108
+ .reg t13, gr109
+ .reg t14, gr110
+ .reg t15, gr111
+
+ ; User process statics
+ .reg u0, gr112
+ .reg u1, gr113
+ .reg u2, gr114
+ .reg u3, gr115
+
+ ; More subroutine/function temporaries
+ .reg t16, gr116
+ .reg t17, gr117
+ .reg t18, gr118
+ .reg t19, gr119
+ .reg t20, gr120
+
+ ; Older names for the same registers
+ .reg tmp0, gr116
+ .reg tmp1, gr117
+ .reg tmp2, gr118
+ .reg tmp3, gr119
+ .reg tmp4, gr120
+
+ ; Trap handler temporaries
+ .reg tav, gr121 ; arg/temp
+ .reg tpc, gr122 ; rtn/temp
+
+ ; Linkage pointers
+ .reg lrp, gr123 ; large rtn ptr
+ .reg slp, gr124 ; static link ptr
+ .reg msp, gr125 ; memory stack ptr
+ .reg rab, gr126 ; register allocate bound
+ .reg rfb, gr127 ; register free bound
+
+;-----------------------------------------------------------------------
+;Local compiler registers
+; (only valid if frame has been established)
+;-----------------------------------------------------------------------
+
+ .reg p15, lr17 ; outgoing arg 16
+ .reg p14, lr16 ; outgoing arg 15
+ .reg p13, lr15 ; outgoing arg 14
+ .reg p12, lr14 ; outgoing arg 13
+ .reg p11, lr13 ; outgoing arg 12
+ .reg p10, lr12 ; outgoing arg 11
+ .reg p9, lr11 ; outgoing arg 10
+ .reg p8, lr10 ; outgoing arg 9
+ .reg p7, lr9 ; outgoing arg 8
+ .reg p6, lr8 ; outgoing arg 7
+ .reg p5, lr7 ; outgoing arg 6
+ .reg p4, lr6 ; outgoing arg 5
+ .reg p3, lr5 ; outgoing arg 4
+ .reg p2, lr4 ; outgoing arg 3
+ .reg p1, lr3 ; outgoing arg 2
+ .reg p0, lr2 ; outgoing arg 1
+ .reg fp, lr1 ; frame pointer
+ .reg raddr, lr0 ; return address
+
+;-----------------------------------------------------------------------
+; Vectors
+;-----------------------------------------------------------------------
+
+ .equ V_ILLEG, 0 ; Illegal opcode
+ .equ V_ALIGN, 1 ; Unaligned access
+ .equ V_RANGE, 2 ; Out of range
+ .equ V_COPRE, 3 ; Coprocessor not present
+ .equ V_COEXC, 4 ; Coprocessor exception
+ .equ V_PROT, 5 ; Protection violation
+ .equ V_INSTR, 6 ; Instruction access exception
+ .equ V_DATA, 7 ; Data access exception
+ .equ V_UITLB, 8 ; User-mode instruction TLB miss
+ .equ V_UDTLB, 9 ; User-mode data TLB miss
+ .equ V_SITLB, 10 ; Supervisor-mode instr TLB miss
+ .equ V_SDTLB, 11 ; Supervisor-mode data TLB miss
+ .equ V_ITLB, 12 ; Instruction TLB violation
+ .equ V_DTLB, 13 ; Data TLB violation
+ .equ V_TIMER, 14 ; Timer
+ .equ V_TRACE, 15 ; Trace
+ .equ V_INTR0, 16 ; Interrupt 0
+ .equ V_INTR1, 17 ; Interrupt 1
+ .equ V_INTR2, 18 ; Interrupt 2
+ .equ V_INTR3, 19 ; Interrupt 3
+ .equ V_TRAP0, 20 ; Trap 0
+ .equ V_TRAP1, 21 ; Trap 1
+
+;-----------------------------------------------------------------------
+;constants for LOAD and STORE operations
+;-----------------------------------------------------------------------
+
+; CE operand values
+ .equ CE, 0b1 ;coprocessor enable
+ .equ ME, 0b0 ; memory enable
+
+; CNTL operand values
+ .equ IO, 0b1000000 ;set for I/O
+ .equ PA, 0b0100000 ;force physical addr
+ .equ SB, 0b0010000 ;set for set BP
+ .equ UA, 0b0001000 ;force user mode access
+ .equ ROM, 0b0000100 ;ROM access
+ .equ HWORD, 0b0000010 ;Half word access
+ .equ BYTE, 0b0000001 ;Byte access
+ .equ WORD, 0b0000000 ;Word access
+
+;-----------------------------------------------------------------------
+; stack alignment value
+;-----------------------------------------------------------------------
+ .equ STKALIGN, 8 ; double word align
+
diff --git a/newlib/libc/sys/a29khif/sys/fpsymbol.h b/newlib/libc/sys/a29khif/sys/fpsymbol.h
new file mode 100644
index 000000000..3fc6ac88b
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/fpsymbol.h
@@ -0,0 +1,2970 @@
+; @(#)fpsymbol.h 1.4 90/10/14 20:55:59, Copyright 1989, 1990 AMD
+; start of fpsymbol.h file
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; ______________________________________________________________________
+;|______________________________________________________________________|
+;| |
+;| SYMBOLS FOR DEFINING THE INSTRUCTION WORD |
+;| |
+;|______________________________________________________________________|
+;|______________________________________________________________________|
+;
+;
+; Revision Information:
+;------------------------------------------------------------------------
+; Date: March 31, 1989
+; Author: Roy Carlson per Bob Perlman and Richard Relph
+;
+; The symbols section describing transactions was modified to contain
+; several new symbol values. The reason for the change was to force the
+; CA bit to be set--and remain set--once code accesses the coprocessor.
+;
+; Future operating systems will use the Coprocessor Active (CA) bit in
+; the Old Processor Status Register to determine whether or not to save
+; coprocessor state, etc.. This means that the instruction control field
+; Set Coprocessor Active (SA) bit should be used as follows:
+;
+; (1) any coprocessor STORE must have its SA bit set to 1,
+; so as to set CA,
+;
+; and (2) any coprocessor LOAD must have its SA bit set to 0,
+; so as to prevent clearing CA.
+;------------------------------------------------------------------------
+; Date: 89/01/30 12:32:13; author: jim; lines added/del: 5/4
+; Corrected CP_IEEE_GRADUAL_UFLOW_MODE and CP_RMS_MASK.
+; Added CP_EXCPS_POSITION, the ls bit of the CP_XXX_EXCP ensemble.
+; fixed a few typos in comments.
+;------------------------------------------------------------------------
+; Date: 89/01/23 18:00:26; author: jim; lines added/del: 488/468
+; Richard O. Parker
+; January 5, 1989
+;
+; 1) The _cp_prec_field in the "cp_build_inst", "cp_build_inst_h"
+; and "cp_build_inst_l" macros was not being defined in the case
+; of Am29K-supported floating-point instructions (e.g., FADD, FSUB,
+; DADD, etc.).
+;
+; 2) The multiplexor select codes in the opcode table entries
+; associated with the "cp_build_inst", "cp_build_inst_h" and
+; "cp_build_inst_l" macros, pertaining to the CONVERT_F_TO_D
+; and CONVERT_D_TO_F instructions were incorrect.
+;------------------------------------------------------------------------
+; Date: 88/12/20 14:28:26; author: jim; lines added/del: 1/1
+; Larry Westerman corrected definition of CP_MOVE_P.
+; Version required for Release 1.1 of the Intrinsics shipped 12/12/88.
+;------------------------------------------------------------------------
+; Date: 88/11/18 15:44:45; author: law;
+; Initial revision
+;
+;
+;========================================================================
+;
+; The following mnemonics are used to specify the 14 LSBs of the
+; instruction word (fields SIP, SIQ, SIT, SIF, IF, and CO).
+;
+;========================================================================
+;
+; floating point operation codes.
+;
+ .equ CP_PASS_P, 0x00000000 ; pass P
+ .equ CP_MINUSP, 0x00000040 ; -P
+ .equ CP_ABSP, 0x00000080 ; |P|
+ .equ CP_SIGNT_TIMES_ABSP, 0x00000C00 ; SIGN(T) * |P|
+;
+ .equ CP_P_PLUS_T, 0x00000001 ; P + T
+ .equ CP_P_MINUS_T, 0x00000101 ; P - T
+ .equ CP_MINUSP_PLUS_T, 0x00001001 ; -P + T
+ .equ CP_MINUSP_MINUS_T, 0x00001101 ; -P - T
+ .equ CP_ABS_P_PLUS_T, 0x00000081 ; |P + T|
+ .equ CP_ABS_P_MINUS_T, 0x00000181 ; |P - T|
+ .equ CP_ABSP_PLUS_ABST, 0x00002201 ; |P| + |T|
+ .equ CP_ABSP_MINUS_ABST, 0x00002301 ; |P| - |T|
+ .equ CP_ABS_ABSP_MINUS_ABST, 0x00002381 ; ||P| - |T||
+;
+ .equ CP_P_TIMES_Q, 0x00000002 ; P * Q
+ .equ CP_MINUSP_TIMES_Q, 0x00001002 ; -P * Q
+ .equ CP_ABS_P_TIMES_Q, 0x00000082 ; |P * Q|
+;
+ .equ CP_COMPARE_P_AND_T, 0x00000103 ; compare P and T
+;
+ .equ CP_MAX_P_AND_T, 0x00000104 ; max P,T
+ .equ CP_MAX_ABSP_AND_ABST, 0x00002304 ; max |P|, |T|
+;
+ .equ CP_MIN_P_AND_T, 0x00001005 ; min P,T
+ .equ CP_MIN_ABSP_AND_ABST, 0x00003205 ; min |P|,|T|
+ .equ CP_LIMIT_P_TO_MAGT, 0x00003A05 ; limit P to magnitude of T
+;
+ .equ CP_CONVERT_T_TO_INT, 0x00000006 ; convert T to integer
+;
+ .equ CP_SCALE_T_TO_INT_BY_Q, 0x00000007 ; scale T to integer by Q
+;
+ .equ CP_PQ_PLUS_T, 0x00000008 ; (P * Q) + T
+ .equ CP_MINUSPQ_PLUS_T, 0x00001008 ; (-P * Q) + T
+ .equ CP_PQ_MINUS_T, 0x00000108 ; (P * Q) - T
+ .equ CP_MINUSPQ_MINUS_T, 0x00001108 ; (-P * Q) - T
+ .equ CP_ABSPQ_PLUS_ABST, 0x00002A08 ; |(P * Q)| + T
+ .equ CP_MINUSABSPQ_PLUS_ABST, 0x00003A08 ;-|(P * Q)| + T
+ .equ CP_ABSPQ_MINUS_ABST, 0x00002B08 ; |(P * Q)| - |T|
+;
+ .equ CP_ROUND_T_TO_INT, 0x00000009 ; round T to integral value
+;
+ .equ CP_RECIPROCAL_OF_P, 0x0000000A ; reciprocal of P
+;
+ .equ CP_CONVERT_T_TO_ALT, 0x0000000B ; convert T to alt. f.p. format
+ .equ CP_CONVERT_T_FROM_ALT, 0x0000000C ; convert T to alt. f.p. format
+;
+;
+; integer operation codes.
+;
+ .equ CP_I_PASS_P, 0x00000020 ; integer pass P
+ .equ CP_I_MINUSP, 0x00000060 ; integer -P
+ .equ CP_I_ABSP, 0x000000A0 ; integer |P|
+ .equ CP_I_SIGNT_TIMES_ABSP, 0x00000C20 ; integer SIGN(T) * |P|
+;
+ .equ CP_I_P_PLUS_T, 0x00000021 ; integer P + T
+ .equ CP_I_P_MINUS_T, 0x00000121 ; integer P - T
+ .equ CP_I_MINUSP_PLUS_T, 0x00001021 ; integer -P + T
+ .equ CP_I_ABS_P_PLUS_T, 0x000000A1 ; integer |P + T|
+ .equ CP_I_ABS_P_MINUS_T, 0x000001A1 ; integer |P - T|
+;
+ .equ CP_I_P_TIMES_Q, 0x00000022 ; integer P * Q
+;
+ .equ CP_I_COMPARE_P_AND_T, 0x00000123 ; integer compare P and T
+;
+ .equ CP_I_MAX_P_AND_T, 0x00000124 ; integer max P,T
+;
+ .equ CP_I_MIN_P_AND_T, 0x00001025 ; integer min P,T
+;
+ .equ CP_I_CONVERT_T_TO_FLOAT, 0x00000026 ; integer convert T to f.p.
+;
+ .equ CP_I_SCALE_T_TO_FLOAT_BY_Q, 0x00000027 ; integer scale T to f.p. by Q
+;
+ .equ CP_I_P_OR_T, 0x00000030 ; integer P OR T
+;
+ .equ CP_I_P_AND_T, 0x00000031 ; integer P AND T
+;
+ .equ CP_I_P_XOR_T, 0x00000032 ; integer P XOR T
+;
+ .equ CP_I_NOT_T, 0x00000032 ; integer NOT T
+;
+ .equ CP_I_LSHIFT_P_BY_Q, 0x00000033 ; integer logical shift P by Q
+; places
+;
+ .equ CP_I_ASHIFT_P_BY_Q, 0x00000034 ; integer arith. shift P by Q
+; places
+;
+ .equ CP_I_FSHIFT_PT_BY_Q, 0x00000035 ; integer funnel shift PT by Q
+; places
+;
+;
+; move instruction (f.p. or integer)
+;
+ .equ CP_MOVE_P, 0x00000018 ; move operand P
+;
+;
+;========================================================================
+;
+; precision codes for the the operands in registers R and S, and for
+; the result (instruction word fields IPR, RPR).
+;
+;========================================================================
+;
+;
+ .equ CP_D_S, 0x00008000 ;Double result, single input(s)
+ .equ CP_S_D, 0x00004000 ;Single result, double input(s)
+ .equ CP_D_D, 0x00000000 ;Double result, double input(s)
+ .equ CP_S_S, 0x0000C000 ;Single result, single input(s)
+;
+;========================================================================
+;
+; The following mnemonics are used to specify the 16 LSBs of an Am29027
+; instruction word for floating-point instructions supported by the
+; Am29000 instruction set.
+;
+;========================================================================
+;
+ .equ CP_FADD, 0x0000C001
+ .equ CP_DADD, 0x00000001
+ .equ CP_FSUB, 0x0000C101
+ .equ CP_DSUB, 0x00000101
+ .equ CP_FMUL, 0x0000C002
+ .equ CP_DMUL, 0x00000002
+ .equ CP_FEQ, 0x0000C103
+ .equ CP_DEQ, 0x00000103
+ .equ CP_FGE, 0x0000C103
+ .equ CP_DGE, 0x00000103
+ .equ CP_FGT, 0x0000C103
+ .equ CP_DGT, 0x00000103
+ .equ CP_CONVERT_I_TO_F, 0x0000C026 ; CONVERT (int -> s.p.)
+ .equ CP_CONVERT_I_TO_D, 0x00008026 ; CONVERT (int -> d.p.)
+ .equ CP_CONVERT_F_TO_I, 0x0000C006 ; CONVERT (s.p.-> int)
+ .equ CP_CONVERT_D_TO_I, 0x00004006 ; CONVERT (d.p.-> int)
+ .equ CP_CONVERT_F_TO_D, 0x00008000 ; CONVERT (s.p.-> d.p.)
+ .equ CP_CONVERT_D_TO_F, 0x00004000 ; CONVERT (d.p.-> s.p.)
+;
+;
+;========================================================================
+;
+; operand select codes (instruction word fields PMS, QMS, TMS).
+;
+;========================================================================
+;
+;
+ .equ CP_P_EQ_R, 0x00000000
+ .equ CP_P_EQ_S, 0x01000000
+ .equ CP_P_EQ_0, 0x02000000
+ .equ CP_P_EQ_ONE_HALF, 0x03000000
+ .equ CP_P_EQ_IMINUS1, 0x03000000
+ .equ CP_P_EQ_1, 0x04000000
+ .equ CP_P_EQ_2, 0x05000000
+ .equ CP_P_EQ_3, 0x06000000
+ .equ CP_P_EQ_PI, 0x07000000
+ .equ CP_P_EQ_IMINUSMAX, 0x07000000
+ .equ CP_P_EQ_RF0, 0x08000000
+ .equ CP_P_EQ_RF1, 0x09000000
+ .equ CP_P_EQ_RF2, 0x0A000000
+ .equ CP_P_EQ_RF3, 0x0B000000
+ .equ CP_P_EQ_RF4, 0x0C000000
+ .equ CP_P_EQ_RF5, 0x0D000000
+ .equ CP_P_EQ_RF6, 0x0E000000
+ .equ CP_P_EQ_RF7, 0x0F000000
+;
+ .equ CP_Q_EQ_R, 0x00000000
+ .equ CP_Q_EQ_S, 0x00100000
+ .equ CP_Q_EQ_0, 0x00200000
+ .equ CP_Q_EQ_ONE_HALF, 0x00300000
+ .equ CP_Q_EQ_IMINUS1, 0x00300000
+ .equ CP_Q_EQ_1, 0x00400000
+ .equ CP_Q_EQ_2, 0x00500000
+ .equ CP_Q_EQ_3, 0x00600000
+ .equ CP_Q_EQ_PI, 0x00700000
+ .equ CP_Q_EQ_IMINUSMAX, 0x00700000
+ .equ CP_Q_EQ_RF0, 0x00800000
+ .equ CP_Q_EQ_RF1, 0x00900000
+ .equ CP_Q_EQ_RF2, 0x00A00000
+ .equ CP_Q_EQ_RF3, 0x00B00000
+ .equ CP_Q_EQ_RF4, 0x00C00000
+ .equ CP_Q_EQ_RF5, 0x00D00000
+ .equ CP_Q_EQ_RF6, 0x00E00000
+ .equ CP_Q_EQ_RF7, 0x00F00000
+;
+ .equ CP_T_EQ_R, 0x00000000
+ .equ CP_T_EQ_S, 0x00010000
+ .equ CP_T_EQ_0, 0x00020000
+ .equ CP_T_EQ_ONE_HALF, 0x00030000
+ .equ CP_T_EQ_IMINUS1, 0x00030000
+ .equ CP_T_EQ_1, 0x00040000
+ .equ CP_T_EQ_2, 0x00050000
+ .equ CP_T_EQ_3, 0x00060000
+ .equ CP_T_EQ_PI, 0x00070000
+ .equ CP_T_EQ_IMINUSMAX, 0x00070000
+ .equ CP_T_EQ_RF0, 0x00080000
+ .equ CP_T_EQ_RF1, 0x00090000
+ .equ CP_T_EQ_RF2, 0x000A0000
+ .equ CP_T_EQ_RF3, 0x000B0000
+ .equ CP_T_EQ_RF4, 0x000C0000
+ .equ CP_T_EQ_RF5, 0x000D0000
+ .equ CP_T_EQ_RF6, 0x000E0000
+ .equ CP_T_EQ_RF7, 0x000F0000
+;
+;
+;========================================================================
+;
+; destination select codes (instruction word fields RF, RFS)
+;
+;========================================================================
+;
+;
+ .equ CP_DEST_EQ_GP, 0x00000000
+ .equ CP_DEST_EQ_RF0, 0x80000000
+ .equ CP_DEST_EQ_RF1, 0x90000000
+ .equ CP_DEST_EQ_RF2, 0xA0000000
+ .equ CP_DEST_EQ_RF3, 0xB0000000
+ .equ CP_DEST_EQ_RF4, 0xC0000000
+ .equ CP_DEST_EQ_RF5, 0xD0000000
+ .equ CP_DEST_EQ_RF6, 0xE0000000
+ .equ CP_DEST_EQ_RF7, 0xF0000000
+;
+;
+; ______________________________________________________________________
+;|______________________________________________________________________|
+;| |
+;| SYMBOLS FOR DEFINING THE MODE REGISTER DOUBLE WORD |
+;| |
+;|______________________________________________________________________|
+;|______________________________________________________________________|
+;
+;
+;
+ .equ CP_PFF_MASK, 0x00000003 ; primary f.p. format mask
+ .equ CP_PFF_EQ_IEEE, 0x00000000 ; primary f.p. format = IEEE
+ .equ CP_PFF_EQ_DECD, 0x00000001 ; primary f.p. format = DEC D
+ .equ CP_PFF_EQ_DECG, 0x00000002 ; primary f.p. format = DEC G
+ .equ CP_PFF_EQ_IBM, 0x00000003 ; primary f.p. format = IBM
+ .equ CP_PFF_POSITION, 0
+;
+ .equ CP_AFF_MASK, 0x0000000C ; alternate f.p. format mask
+ .equ CP_AFF_EQ_IEEE, 0x00000000 ; alternate f.p. format = IEEE
+ .equ CP_AFF_EQ_DECD, 0x00000004 ; alternate f.p. format = DEC D
+ .equ CP_AFF_EQ_DECG, 0x00000008 ; alternate f.p. format = DEC G
+ .equ CP_AFF_EQ_IBM, 0x0000000C ; alternate f.p. format = IBM
+ .equ CP_AFF_POSITION, 2
+;
+ .equ CP_SAT_MASK, 0x00000010 ; saturate mode (SAT) mask
+ .equ CP_SATURATE_MODE, 0x00000010 ; enable saturate mode (SAT=1)
+ .equ CP_SAT_POSITION, 4
+;
+ .equ CP_AP_MASK, 0x00000020 ; affine/proj. mode (AP) mask
+ .equ CP_AFFINE_MODE, 0x00000020 ; enable affine mode (AP=1)
+ .equ CP_PROJECTIVE_MODE, 0x00000000 ; enable projective mode (AP=0)
+ .equ CP_AP_POSITION, 5
+;
+ .equ CP_TRP_MASK, 0x00000040 ; IEEE trap mode (TRP) mask
+ .equ CP_IEEE_TRAPS_ENABLED, 0x00000040 ; IEEE trap mode enabled (TRP=1)
+ .equ CP_IEEE_TRAPS_DISABLED, 0x00000000 ; IEEE trap mode disabled (TRP=0)
+ .equ CP_TRP_POSITION, 6
+;
+ .equ CP_SU_MASK, 0x00000080 ; IEEE sud. uflow (SU) mask
+ .equ CP_IEEE_SUDDEN_UFLOW_MODE, 0x00000080 ; IEEE sud. uflow mode (SU=1)
+ .equ CP_IEEE_GRADUAL_UFLOW_MODE,0x00000000 ; IEEE grad uflow mode (SU=0)
+ .equ CP_SU_POSITION, 7
+;
+ .equ CP_BS_MASK, 0x00000100 ; IBM sig. mask (BS)
+ .equ CP_BS_POSITION, 8
+;
+ .equ CP_BU_MASK, 0x00000200 ; IBM underflow mask (BU)
+ .equ CP_BU_POSITION, 9
+;
+ .equ CP_MS_MASK, 0x00000800 ; signed int. mpy (MS) mask
+ .equ CP_SIGNED_INT_MPY_MODE, 0x00000800 ; signed int. mpy mode (MS=1)
+ .equ CP_UNSIGNED_INT_MPY_MODE, 0x00000000 ; unsigned int. mpy mode (MS=0)
+ .equ CP_MS_POSITION, 11
+;
+ .equ CP_MF_MASK, 0x00003000 ; int. mult. fmt. mode (MF) mask
+ .equ CP_MF_EQ_LSBS, 0x00000000 ; int. mult. fmt. = LSBs
+ .equ CP_MF_EQ_LSBSFA, 0x00001000 ; int. mult. fmt. = LSBs,fmt. adj.
+ .equ CP_MF_EQ_MSBS, 0x00002000 ; int. mult. fmt. = MSBs
+ .equ CP_MF_EQ_MSBSFA, 0x00003000 ; int. mult. fmt. = MSBs,fmt. adj.
+ .equ CP_MF_POSITION, 12
+;
+ .equ CP_RMS_MASK, 0x0001C000 ; round mode (RMS) mask
+ .equ CP_RMS_EQ_NEAREST, 0x00000000 ; round mode = to nearest
+ .equ CP_RMS_EQ_MINUS_INF, 0x00004000 ; round mode = toward -oo
+ .equ CP_RMS_EQ_PLUS_INF, 0x00008000 ; round mode = toward +oo
+ .equ CP_RMS_EQ_ZERO, 0x0000C000 ; round mode = toward zero
+ .equ CP_RMS_POSITION, 14
+;
+ .equ CP_PL_MASK, 0x00100000 ; pipeline mode (PL) mask
+ .equ CP_FLOWTHROUGH_MODE, 0x00000000 ; select flow-through mode
+ .equ CP_PIPELINE_MODE, 0x00100000 ; select pipeline mode
+ .equ CP_PL_POSITION, 20
+;
+ .equ CP_INVALID_OP_EXCP_MASK, 0x00400000 ; invalid operation excp. mask(IM)
+ .equ CP_RESERVED_OP_EXCP_MASK,0x00800000 ; reserved operand excp. mask(RM)
+ .equ CP_OVERFLOW_EXCP_MASK, 0x01000000 ; overflow exception mask (VM)
+ .equ CP_UNDERFLOW_EXCP_MASK, 0x02000000 ; underflow exception mask(UM)
+ .equ CP_INEXACT_EXCP_MASK, 0x04000000 ; inexact result excp. mask(XM)
+ .equ CP_ZERO_EXCP_MASK, 0x08000000 ; zero result exception mask (ZM)
+ .equ CP_EXCPS_POSITION, 22
+;
+ .equ CP_PLTC_MASK, 0x0000000F ; pipeline timer count (PLTC) mask
+ .equ CP_PLTC_EQ_2, 0x00000002 ; pipeline timer count = 2
+ .equ CP_PLTC_EQ_3, 0x00000003 ; pipeline timer count = 3
+ .equ CP_PLTC_EQ_4, 0x00000004 ; pipeline timer count = 4
+ .equ CP_PLTC_EQ_5, 0x00000005 ; pipeline timer count = 5
+ .equ CP_PLTC_EQ_6, 0x00000006 ; pipeline timer count = 6
+ .equ CP_PLTC_EQ_7, 0x00000007 ; pipeline timer count = 7
+ .equ CP_PLTC_EQ_8, 0x00000008 ; pipeline timer count = 8
+ .equ CP_PLTC_EQ_9, 0x00000009 ; pipeline timer count = 9
+ .equ CP_PLTC_EQ_10, 0x0000000A ; pipeline timer count = 10
+ .equ CP_PLTC_EQ_11, 0x0000000B ; pipeline timer count = 11
+ .equ CP_PLTC_EQ_12, 0x0000000C ; pipeline timer count = 12
+ .equ CP_PLTC_EQ_13, 0x0000000D ; pipeline timer count = 13
+ .equ CP_PLTC_EQ_14, 0x0000000E ; pipeline timer count = 14
+ .equ CP_PLTC_EQ_15, 0x0000000F ; pipeline timer count = 15
+ .equ CP_PLTC_POSITION, 0
+;
+ .equ CP_MATC_MASK, 0x000000F0 ; mpy-acc timer count (MATC) mask
+ .equ CP_MATC_EQ_2, 0x00000020 ; mpy-acc timer count = 2
+ .equ CP_MATC_EQ_3, 0x00000030 ; mpy-acc timer count = 3
+ .equ CP_MATC_EQ_4, 0x00000040 ; mpy-acc timer count = 4
+ .equ CP_MATC_EQ_5, 0x00000050 ; mpy-acc timer count = 5
+ .equ CP_MATC_EQ_6, 0x00000060 ; mpy-acc timer count = 6
+ .equ CP_MATC_EQ_7, 0x00000070 ; mpy-acc timer count = 7
+ .equ CP_MATC_EQ_8, 0x00000080 ; mpy-acc timer count = 8
+ .equ CP_MATC_EQ_9, 0x00000090 ; mpy-acc timer count = 9
+ .equ CP_MATC_EQ_10, 0x000000A0 ; mpy-acc timer count = 10
+ .equ CP_MATC_EQ_11, 0x000000B0 ; mpy-acc timer count = 11
+ .equ CP_MATC_EQ_12, 0x000000C0 ; mpy-acc timer count = 12
+ .equ CP_MATC_EQ_13, 0x000000D0 ; mpy-acc timer count = 13
+ .equ CP_MATC_EQ_14, 0x000000E0 ; mpy-acc timer count = 14
+ .equ CP_MATC_EQ_15, 0x000000F0 ; mpy-acc timer count = 15
+ .equ CP_MATC_POSITION, 4
+;
+ .equ CP_MVTC_MASK, 0x00000F00 ; MOVE P timer count (MVTC) mask
+ .equ CP_MVTC_EQ_2, 0x00000200 ; MOVE P timer count = 2
+ .equ CP_MVTC_EQ_3, 0x00000300 ; MOVE P timer count = 3
+ .equ CP_MVTC_EQ_4, 0x00000400 ; MOVE P timer count = 4
+ .equ CP_MVTC_EQ_5, 0x00000500 ; MOVE P timer count = 5
+ .equ CP_MVTC_EQ_6, 0x00000600 ; MOVE P timer count = 6
+ .equ CP_MVTC_EQ_7, 0x00000700 ; MOVE P timer count = 7
+ .equ CP_MVTC_EQ_8, 0x00000800 ; MOVE P timer count = 8
+ .equ CP_MVTC_EQ_9, 0x00000900 ; MOVE P timer count = 9
+ .equ CP_MVTC_EQ_10, 0x00000A00 ; MOVE P timer count = 10
+ .equ CP_MVTC_EQ_11, 0x00000B00 ; MOVE P timer count = 11
+ .equ CP_MVTC_EQ_12, 0x00000C00 ; MOVE P timer count = 12
+ .equ CP_MVTC_EQ_13, 0x00000D00 ; MOVE P timer count = 13
+ .equ CP_MVTC_EQ_14, 0x00000E00 ; MOVE P timer count = 14
+ .equ CP_MVTC_EQ_15, 0x00000F00 ; MOVE P timer count = 15
+ .equ CP_MVTC_POSITION, 8
+;
+ .equ CP_AD_MASK, 0x00001000 ;
+ .equ CP_ADVANCE_DRDY_MODE, 0x00001000 ;
+ .equ CP_NORMAL_DRDY_MODE, 0x00000000 ;
+ .equ CP_AD_POSITION, 12
+;
+ .equ CP_HE_MASK, 0x00002000 ; Halt-on-error mask (HE)
+ .equ CP_HALT_ON_ERROR_ENABLED, 0x00002000 ; Halt-on-error enabled (HE=1)
+ .equ CP_HALT_ON_ERROR_DISABLED,0x00000000 ; Halt-on-error disabled (HE=0)
+ .equ CP_HE_POSITION, 13
+;
+ .equ CP_EX_MASK, 0x00004000 ; EXCP enable mask (EX)
+ .equ CP_EXCP_ENABLED, 0x00004000 ; EXCP enabled (EX=1)
+ .equ CP_EXCP_DISABLED, 0x00000000 ; EXCP disabled (EX=0)
+ .equ CP_EX_POSITION, 14
+;
+;
+;
+; ______________________________________________________________________
+;|______________________________________________________________________|
+;| |
+;| SYMBOLS FOR DEFINING THE STATUS REGISTER WORD |
+;| |
+;|______________________________________________________________________|
+;|______________________________________________________________________|
+;
+;
+ .equ CP_INVALID_OP_EXCP, 0x00000001
+ .equ CP_INVALID_OP_EXCP_POSITION, 0
+;
+ .equ CP_RESERVED_OP_EXCP, 0x00000002
+ .equ CP_RESERVED_OP_EXCP_POSITION, 1
+;
+ .equ CP_OVERFLOW_EXCP, 0x00000004
+ .equ CP_OVERFLOW_EXCP_POSITION, 2
+;
+ .equ CP_UNDERFLOW_EXCP, 0x00000008
+ .equ CP_UNDERFLOW_EXCP_POSITION, 3
+;
+ .equ CP_INEXACT_EXCP, 0x00000010
+ .equ CP_INEXACT_EXCP_POSITION, 4
+;
+ .equ CP_ZERO_EXCP, 0x00000020
+ .equ CP_ZERO_EXCP_POSITION, 5
+;
+ .equ CP_EXCP_STATUS_MASK, 0x00000040
+ .equ CP_EXCP_STATUS_FLAG_POSITION, 6
+;
+ .equ CP_R_TEMP_VALID_MASK, 0x00000080
+ .equ R_TEMP_VALID_POSITION, 7
+;
+ .equ CP_S_TEMP_VALID_MASK, 0x00000100
+ .equ CP_S_TEMP_VALID_POSITION, 8
+;
+ .equ CP_I_TEMP_VALID_FLAG, 0x00000200
+ .equ CP_I_TEMP_VALID_POSITION, 9
+;
+ .equ CP_OPERATION_PENDING_MASK, 0x00000400
+ .equ CP_OPERATION_PENDING_POSITION,10
+;
+;
+; ______________________________________________________________________
+;|______________________________________________________________________|
+;| |
+;| SYMBOLS FOR DEFINING THE FLAG REGISTER WORD |
+;| |
+;|______________________________________________________________________|
+;|______________________________________________________________________|
+;
+;
+ .equ CP_INVALID_OP_FLAG, 0x00000001
+ .equ CP_INVALID_OP_FLAG_POSITION, 0
+;
+ .equ CP_CARRY_FLAG, 0x00000001
+ .equ CP_CARRY_FLAG_POSITION, 0
+;
+ .equ CP_RESERVED_OP_FLAG, 0x00000002
+ .equ CP_RESERVED_OP_FLAG_POSITION, 1
+;
+ .equ CP_OVERFLOW_FLAG, 0x00000004
+ .equ CP_OVERFLOW_FLAG_POSITION, 2
+;
+ .equ CP_UNORDERED_FLAG, 0x00000004
+ .equ CP_UNORDERED_FLAG_POSITION, 2
+;
+ .equ CP_UNDERFLOW_FLAG, 0x00000008
+ .equ CP_UNDERFLOW_FLAG_POSITION, 3
+;
+ .equ CP_LESS_THAN_FLAG, 0x00000008
+ .equ CP_LESS_THAN_POSITION, 3
+;
+ .equ CP_WINNER_FLAG, 0x00000008
+ .equ CP_WINNER_FLAG_POSITION, 3
+;
+ .equ CP_INEXACT_FLAG, 0x00000010
+ .equ CP_INEXACT_FLAG_POSITION, 4
+;
+ .equ CP_GREATER_THAN_FLAG, 0x00000010
+ .equ CP_GREATER_THAN_FLAG_POSITION,4
+;
+ .equ CP_ZERO_FLAG, 0x00000020
+ .equ CP_ZERO_FLAG_POSITION, 5
+;
+ .equ CP_EQUAL_FLAG, 0x00000020
+ .equ CP_EQUAL_FLAG_POSITION, 5
+;
+ .equ CP_SIGN_FLAG, 0x00000040
+ .equ CP_SIGN_FLAG_POSITION, 6
+;
+;
+; ______________________________________________________________________
+;|______________________________________________________________________|
+;| |
+;| SYMBOLS FOR TRANSACTION REQUEST TYPES |
+;| |
+;|______________________________________________________________________|
+;|______________________________________________________________________|
+;
+;
+; write requests
+;
+; Note: Each WRITE_* transaction request, plus ADV_TEMPS sets the CA
+; (Coprocessor Active) bit in the 29000 Current Processor Status Register.
+;
+ .equ CP_WRITE_R, 0x20 ;write sing or doub to R register
+ .equ CP_WRITE_S, 0x21 ;write sing or doub to S register
+ .equ CP_WRITE_RS, 0x22 ;write sing operands to R and S
+ .equ CP_WRITE_MODE, 0x23 ;write mode double word to 29027
+ .equ CP_WRITE_STATUS, 0x24 ;write status word to 29027
+ .equ CP_WRITE_PREC, 0x25 ;write reg. file precision word
+ ; to 29027
+ .equ CP_WRITE_INST, 0x26 ;write instruction to 29027
+ .equ CP_ADV_TEMPS, 0x27 ;move R-Temp, S-Temp into R,S
+;
+; read requests
+;
+ .equ CP_READ_MSBS, 0x00 ;read sing result or MSB of doub
+ .equ CP_READ_LSBS, 0x01 ;read LSB of doub result
+ .equ CP_READ_FLAGS, 0x02 ;read 29027 flag register
+ .equ CP_READ_STATUS, 0x03 ;read 29027 status register
+ .equ CP_SAVE_STATE, 0x04 ;read one word of 29027 state
+;
+; "start operation" symbol; this is "OR"ed with a WRITE_R, WRITE_S,
+; WRITE_RS, or WRITE_INST symbol.
+;
+
+ .equ CP_START, 0b1000000 ;bit to start 29027 operation
+;
+; "suppress exceptions reporting" symbol; this is "OR"ed with a ed
+;
+;
+
+ .equ CP_NO_ERR, 0b1000000 ;suppress exception reporting
+; ; during load.
+; cp_write_r - transfers 32- or 64-bit operand to Am29027
+; register R
+; cp_write_s - transfers 32- or 64-bit operand to Am29027
+; register S
+; cp_write_rs - transfers two 32-bit floating-point operands to
+; Am29027 registers R and S
+; cp_write_prec - transfers a word to the Am29027 precision register
+; cp_write_status - transfers a word to the Am29027 status register
+; cp_write_inst - transfers an instruction to the Am29027
+; instruction register
+; cp_advance_temps - transfers the contents of the Am29027 temporary
+; registers to the corresponding working registers
+; cp_write_mode - transfers a mode specification the the Am29027
+; mode register
+; cp_read_dp - read a double-precision floating-point result
+; from the Am29027
+; cp_read_sp - read a single-precision floating-point result
+; from the Am29027
+; cp_read_int - read an integer result from the Am29027
+; cp_read_flags - read the contents of the Am29027 flag register
+; cp_read_status - read the contents of the Am29027 status register
+; cp_read_state_wd - read a single Am29027 state word
+; cp_save_state - save Am29027 state
+; cp_restore_state - restore Am29027 state
+; cp_build_inst - build an Am29027 instruction
+; cp_build_inst_h - build 16 MSBs of an Am29027 instruction
+; cp_build_inst_l - build 16 LSBs of an Am29027 instruction
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_r
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers a 32- or 64-bit operand to Am29027 input register R
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the 32-bit operand to be
+; transferred, or the 32 MSBs of the 64-bit operand to be
+; transferred.
+;
+; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the
+; 64-bit operand to be transferred
+;
+; INT - indicates that the operand to be transferred is a 32-bit
+; integer
+;
+; START - indicates that a new Am29027 operation is to be started
+; once the operand has been transferred
+;
+;
+; USAGE:
+;
+; cp_write_r reg [,LSB_reg] [,START] for floating-point operands
+; or cp_write_r reg, INT [,START] for integer operands
+;
+; Transferring double-precision floating-point operands - Either of
+; two forms is acceptable:
+;
+; cp_write_r reg
+; or cp_write_r reg, LSB_reg
+;
+; If LSB_reg is omitted, the LSBs are taken from the next g.p.
+; register.
+;
+; Ex: cp_write_r lr2 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register R, and the contents of lr3
+; to the least-significant half.
+;
+; cp_write_r lr2,lr5 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register R, and the contents of lr5
+; to the least-significant half.
+;
+;
+; Transferring single-precision floating-point operands - Use the
+; form:
+;
+; cp_write_r reg
+;
+;
+; Ex: cp_write_r lr2 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register R, (the contents of lr3
+; will be transferred to the least-
+; significant half of register R, but
+; these bits are don't cares).
+;
+;
+; Transferring integer operands - Use the form:
+;
+; cp_write_r reg,INT
+;
+;
+; Ex: cp_write_r lr2,INT Transfers the contents of lr2 to
+; the least-significant half of Am29027
+; register R, (the contents of lr2
+; will also be transferred to the most-
+; significant half of register R, but
+; these bits are don't cares).
+;
+;
+; Starting an Am29027 operation - Any of the forms above may be
+; appended with parameter START, e.g.:
+;
+; cp_write_r lr2,START
+;
+; cp_write_r lr2,lr5,START
+;
+; cp_write_r lr2,INT,START
+;
+;
+;============================================================================
+;
+ .macro cp_write_r,p1,p2,p3
+;
+ .if $narg==0
+ .err
+ .print "cp_WRITE_R: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ store 1,CP_WRITE_R,p1,%%((&p1)+1)
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","INT"
+ store 1,CP_WRITE_R,p1,p1
+ .exitm
+ .endif
+;
+ .ifeqs "@p2@","START"
+ store 1,CP_WRITE_R|CP_START,p1,%%((&p1)+1)
+ .exitm
+ .endif
+;
+ store 1,CP_WRITE_R,p1,p2
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg==3
+;
+ .ifeqs "@p2@","START"
+ .ifeqs "@p3@","INT"
+ store 1,CP_WRITE_R|CP_START,p1,p1
+ .else
+ .err
+ .print "cp_write_r: bad parameter list"
+ .endif
+ .exitm
+ .endif
+;
+ .ifeqs "@p2@","INT"
+ .ifeqs "@p3@","START"
+ store 1,CP_WRITE_R|CP_START,p1,p1
+ .else
+ .err
+ .print "cp_write_r: bad parameter list"
+ .endif
+ .exitm
+ .endif
+;
+ .ifeqs "@p3@","START"
+ store 1,CP_WRITE_R|CP_START,p1,p2
+ .else
+ .err
+ .print "cp_write_r: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=4
+ .err
+ .print "cp_write_r: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_s
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers a 32- or 64-bit operand to Am29027 input register S
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the 32-bit operand to be
+; transferred, or the 32 MSBs of the 64-bit operand to be
+; transferred.
+;
+; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the
+; 64-bit operand to be transferred
+;
+; INT - indicates that the operand to be transferred is a 32-bit
+; integer
+;
+; START - indicates that a new Am29027 operation is to be started
+; once the operand has been transferred
+;
+;
+; USAGE:
+;
+; cp_write_s reg [,LSB_reg] [,START] for floating-point operands
+; or cp_write_s reg, INT [,START] for integer operands
+;
+; Transferring double-precision floating-point operands - Either of
+; two forms is acceptable:
+;
+; cp_write_s reg
+; or cp_write_s reg, LSB_reg
+;
+; If LSB_reg is omitted, the LSBs are taken from the next g.p.
+; register.
+;
+; Ex: cp_write_s lr2 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register S, and the contents of lr3
+; to the least-significant half.
+;
+; cp_write_s lr2,lr5 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register S, and the contents of lr5
+; to the least-significant half.
+;
+;
+; Transferring single-precision floating-point operands - Use the
+; form:
+;
+; cp_write_s reg
+;
+;
+; Ex: cp_write_s lr2 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register S, (the contents of lr3
+; will be transferred to the least-
+; significant half of register S, but
+; these bits are don't cares).
+;
+;
+; Transferring integer operands - Use the form:
+;
+; cp_write_s reg,INT
+;
+;
+; Ex: cp_write_s lr2,INT Transfers the contents of lr2 to
+; the least-significant half of Am29027
+; register S, (the contents of lr2
+; will also be transferred to the most-
+; significant half of register S, but
+; these bits are don't cares).
+;
+;
+; Starting an Am29027 operation - Any of the forms above may be
+; appended with parameter START, e.g.:
+;
+; cp_write_s lr2,START
+;
+; cp_write_s lr2,lr5,START
+;
+; cp_write_s lr2,INT,START
+;
+;
+;============================================================================
+;
+ .macro cp_write_s,p1,p2,p3
+;
+ .if $narg==0
+ .err
+ .print "cp_write_s: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ store 1,CP_WRITE_S,p1,%%((&p1)+1)
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","INT"
+ store 1,CP_WRITE_S,p1,p1
+ .exitm
+ .endif
+;
+ .ifeqs "@p2@","START"
+ store 1,CP_WRITE_S|CP_START,p1,%%((&p1)+1)
+ .exitm
+ .endif
+;
+ store 1,CP_WRITE_S,p1,p2
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg==3
+;
+ .ifeqs "@p2@","START"
+ .ifeqs "@p3@","INT"
+ store 1,CP_WRITE_S|CP_START,p1,p1
+ .else
+ .err
+ .print "cp_write_s: bad parameter list"
+ .endif
+ .exitm
+ .endif
+;
+ .ifeqs "@p2@","INT"
+ .ifeqs "@p3@","START"
+ store 1,CP_WRITE_S|CP_START,p1,p1
+ .else
+ .err
+ .print "cp_write_s: bad parameter list"
+ .endif
+ .exitm
+ .endif
+;
+ .ifeqs "@p3@","START"
+ store 1,CP_WRITE_S|CP_START,p1,p2
+ .else
+ .err
+ .print "cp_write_s: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=4
+ .err
+ .print "cp_write_s: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_rs
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers two 32-bit floating-point operands to Am29027
+; input registers R and S
+;
+; PARAMETERS:
+; reg1 - the Am29000 g.p. register containing the 32-bit operand to be
+; transferred to register R
+;
+; reg2 - the Am29000 g.p. register containing the 32-bit operand to be
+; transferred to register S
+;
+; START - indicates that a new Am29027 operation is to be started
+; once the operands have been transferred
+;
+;
+; USAGE:
+;
+; cp_write_rs reg1, reg2 [,START]
+;
+; Ex: cp_write_rs lr2,lr5 Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register R, and the contents of lr5
+; to the most-significant half of Am29027
+; register S.
+;
+; cp_write_rs lr2,lr5,START Transfers the contents of lr2 to
+; the most-significant half of Am29027
+; register R, and the contents of lr5
+; to the most-significant half of Am29027
+; register S; a new operation is started
+; once the transfer is complete.
+;
+;
+;
+;============================================================================
+;
+ .macro cp_write_rs,p1,p2,p3
+;
+;
+ .if $narg<=1
+ .err
+ .print "cp_write_rs: missing parameter(s)"
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+ .ifeqs "@p2@","START"
+ .err
+ .print "cp_write_rs: bad parameter list"
+ .else
+ store 1,CP_WRITE_RS,p1,p2
+ .endif
+ .exitm
+ .endif
+;
+;
+ .if $narg==3
+ .ifeqs "@p3@","START"
+ store 1,CP_WRITE_RS|CP_START,p1,p2
+ .else
+ .err
+ .print "cp_write_rs: bad parameter list"
+ .endif
+ .exitm
+ .endif
+;
+;
+ .if $narg>=4
+ .err
+ .print "cp_write_rs: too many parameters"
+ .exitm
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_prec
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers a word to the Am29027 precision register
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the word to be
+; transferred to the Am29027 precision register
+;
+; USAGE:
+;
+; cp_write_prec reg
+;
+; Ex: cp_write_prec lr2 Transfers the contents of lr2 to
+; the Am29027 precision register.
+;
+;
+;============================================================================
+;
+ .macro cp_write_prec,p1
+;
+;
+ .if $narg!=1
+ .err
+ .print "cp_write_prec: bad parameter list"
+ .else
+ store 1,CP_WRITE_PREC,p1,0
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_status
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers a word to the Am29027 precision register
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the word to be
+; transferred to the Am29027 status register
+;
+; RESTORE - indicates that this is the last step of a state restoration
+; sequence (flow-through mode only)
+;
+; INVALIDATE - indicates that the current contents of the ALU pipeline
+; register are to be invalidated (pipeline mode only)
+;
+; USAGE:
+;
+; cp_write_status reg [,RESTORE|INVALIDATE]
+;
+; Ex: cp_write_status lr2 Transfers the contents of lr2 to
+; the Am29027 status register.
+;
+;
+; cp_write_status lr2,RESTORE Transfers the contents of lr2 to
+; the Am29027 status register, and
+; completes the state restore
+; sequence
+;
+; cp_write_status lr2,INVALIDATE Transfers the contents of lr2 to
+; the Am29027 status register, and
+; invalidates the contents of the
+; ALU pipeline.
+;
+;
+;============================================================================
+;
+ .macro cp_write_status,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_write_status: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ store 1,CP_WRITE_STATUS,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","RESTORE"
+ store 1,CP_WRITE_STATUS|CP_START,p1,0
+ .exitm
+ .endif
+;
+ .ifeqs "@p2@","INVALIDATE"
+ store 1,CP_WRITE_STATUS|CP_START,p1,0
+ .exitm
+ .endif
+;
+ .err
+ .print "cp_write_status: bad parameter list"
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg >=3
+ .err
+ .print "cp_write_status: too many parameters"
+ .exitm
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_inst
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 16, 1988
+;
+; FUNCTION: Transfers an instruction word to the Am29027 instruction
+; register
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the word to be
+; transferred to the Am29027 instruction register
+;
+; START - indicates that a new Am29027 operation is to be started
+; once the instruction word has been transferred
+;
+; USAGE:
+;
+; cp_write_inst reg [,START]
+;
+; Ex: cp_write_inst lr2 Transfers the contents of lr2 to
+; the Am29027 instruction register.
+;
+;
+; cp_write_inst lr2,START Transfers the contents of lr2 to
+; the Am29027 status register; a
+; new operation is started once the
+; transfer is complete.
+;
+;
+;============================================================================
+;
+ .macro cp_write_inst,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_write_inst: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ store 1,CP_WRITE_INST,p1,p1
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","START"
+ store 1,CP_WRITE_INST|CP_START,p1,p1
+ .else
+ .err
+ .print "cp_write_inst: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg >=3
+ .err
+ .print "cp_write_inst: too many parameters"
+ .exitm
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_advance_temps
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers the contents of Am29027 registers R-Temp, S-Temp,
+; and I-Temp to register R, register S, and the instruction
+; register, respectively.
+;
+; PARAMETERS: none
+;
+; USAGE:
+;
+; cp_advance_temps
+;
+;
+;
+;============================================================================
+;
+ .macro cp_advance_temps
+;
+;
+ .if $narg!=0
+ .err
+ .print "cp_advance_temp: takes no parameters"
+ .else
+ store 1,CP_ADV_TEMPS,gr1,0 ; use gr1 because it's never protected
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_write_mode
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers a 64-bit mode specification to the Am29027 mode
+; register
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register containing the 32 MSBs of the
+; 64-bit mode specification to be transferred.
+;
+; LSB_reg - the Am29000 g.p. register containing the 32 LSBs of the
+; 64-bit mode specification to be transferred.
+;
+; USAGE:
+;
+; cp_write_mode reg [,LSB_reg]
+;
+; Either of two forms is acceptable:
+;
+; cp_write_mode reg
+; or cp_write_mode reg, LSB_reg
+;
+; If LSB_reg is omitted, the LSBs are taken from the next g.p.
+; register.
+;
+; Ex: cp_write_mode lr2 Transfers the contents of lr2 to
+; the most-significant half of the Am29027
+; mode register, and the contents of lr3
+; to the least-significant half.
+;
+; cp_write_mode lr2,lr5 Transfers the contents of lr2 to
+; the most-significant half of the Am29027
+; mode register, and the contents of lr5
+; to the least-significant half.
+;
+;
+;
+;============================================================================
+;
+ .macro cp_write_mode,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_write_mode: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ store 1,CP_WRITE_MODE,%%((&p1)+1),p1
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+ store 1,CP_WRITE_MODE,p2,p1
+ .exitm
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_write_mode: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_dp
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers the current Am29027 double-precison floating-point
+; result to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the 32 MSBs of the
+; current Am29027 result are to be written.
+;
+; LSB_reg - the Am29000 g.p. register into which the 32 LSBs of the
+; current Am29027 result are to be written.
+;
+; NO_ERR - indicates that exception reporting is to be suppressed for this
+; transfer.
+;
+; USAGE:
+;
+; cp_read_dp reg [,LSB_reg] [,START]
+;
+; Either of two forms is acceptable:
+;
+; cp_read_dp reg
+; or cp_read_dp reg, LSB_reg
+;
+; If LSB_reg is omitted, the LSBs are written to the next g.p. register.
+;
+; Ex: cp_read_dp lr2 Transfers the 32 MSBs of the current
+; Am29027 result to lr2, and the 32 LSBs
+; to lr3.
+;
+; cp_read_dp lr2,lr5 Transfers the 32 MSBs of the current
+; Am29027 result to lr2, and the 32 LSBs
+; to lr5.
+;
+; Exception reporting can be suppressed by appending NO_ERR to either
+; of the above, e.g.:
+;
+; cp_read_dp lr2,NO_ERR
+; cp_read_dp lr2,lr5,NO_ERR
+;
+;
+;============================================================================
+;
+ .macro cp_read_dp,p1,p2,p3
+;
+ .if $narg==0
+ .err
+ .print "cp_read_dp: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_READ_LSBS,%%((&p1)+1),0
+ load 1,CP_READ_MSBS,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","NO_ERR"
+ load 1,CP_READ_LSBS|CP_NO_ERR,%%((&p1)+1),0
+ load 1,CP_READ_MSBS|CP_NO_ERR,p1,0
+ .exitm
+ .endif
+;
+ load 1,CP_READ_LSBS,p2,0
+ load 1,CP_READ_MSBS,p1,0
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg==3
+;
+ .ifeqs "@p3@","NO_ERR"
+ load 1,CP_READ_LSBS|CP_NO_ERR,p2,0
+ load 1,CP_READ_MSBS|CP_NO_ERR,p1,0
+ .else
+ .err
+ .print "cp_read_dp: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=4
+ .err
+ .print "cp_read_dp: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_sp
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers the current Am29027 single-precison floating-point
+; result to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the current Am29027
+; result is to be written.
+;
+; NO_ERR - indicates that exception reporting is to be suppressed for this
+; transfer.
+;
+; USAGE:
+;
+; cp_read_sp reg [,START]
+;
+; Ex: cp_read_sp lr2 Transfers the current Am29027 result
+; to lr2.
+;
+; cp_read_sp lr2,NO_ERR Transfers the current Am29027 result
+; to lr2, and suppresses exception
+; reporting for this transfer.
+;
+;
+;============================================================================
+;
+ .macro cp_read_sp,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_read_sp: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_READ_MSBS,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","NO_ERR"
+ load 1,CP_READ_MSBS|CP_NO_ERR,p1,0
+ .else
+ .err
+ .print "cp_read_sp: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_read_sp: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_int
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers the current Am29027 integer result to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the current Am29027
+; result is to be written.
+;
+; NO_ERR - indicates that exception reporting is to be suppressed for this
+; transfer.
+;
+; USAGE:
+;
+; cp_read_int reg [,START]
+;
+; Ex: cp_read_int lr2 Transfers the current Am29027 result
+; to lr2.
+;
+; cp_read_int lr2,NO_ERR Transfers the current Am29027 result
+; to lr2, and suppresses exception
+; reporting for this transfer.
+;
+;
+;============================================================================
+;
+ .macro cp_read_int,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_read_int: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_READ_LSBS,p1,0
+ nop ; leave a cycle for the MSBs to come out
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","NO_ERR"
+ load 1,CP_READ_LSBS|CP_NO_ERR,p1,0
+ nop ; leave a cycle for the MSBs to come out
+ .else
+ .err
+ .print "cp_read_int: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_read_int: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_flags
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 17, 1988
+;
+; FUNCTION: Transfers the contents of the Am29027 flag register
+; to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the current Am29027
+; flag register contents are to be written.
+;
+; NO_ERR - indicates that exception reporting is to be suppressed for this
+; transfer.
+;
+; USAGE:
+;
+; cp_read_flags reg [,START]
+;
+; Ex: cp_read_flags lr2 Transfers the Am29027 flag register
+; contents to lr2.
+;
+; cp_read_flags lr2,NO_ERR Transfers the Am29027 flag register
+; contents to lr2, and suppresses
+; exception reporting for this
+; transfer.
+;
+;
+;============================================================================
+;
+ .macro cp_read_flags,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_read_flags: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_READ_FLAGS,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","NO_ERR"
+ load 1,CP_READ_FLAGS|CP_NO_ERR,p1,0
+ .else
+ .err
+ .print "cp_read_flags: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_read_flags: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_status
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 18, 1988
+;
+; FUNCTION: Transfers the contents of the Am29027 status register
+; to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the current Am29027
+; status register contents are to be written.
+;
+; NO_ERR - indicates that exception reporting is to be suppressed for this
+; transfer.
+;
+; USAGE:
+;
+; cp_read_status reg [,START]
+;
+; Ex: cp_read_status lr2 Transfers the Am29027 status register
+; contents to lr2.
+;
+; cp_read_status lr2,NO_ERR Transfers the Am29027 status register
+; contents to lr2, and suppresses
+; exception reporting for this
+; transfer.
+;
+;
+;============================================================================
+;
+ .macro cp_read_status,p1,p2
+;
+ .if $narg==0
+ .err
+ .print "cp_read_status: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_READ_STATUS,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg==2
+;
+ .ifeqs "@p2@","NO_ERR"
+ load 1,CP_READ_STATUS|CP_NO_ERR,p1,0
+ .else
+ .err
+ .print "cp_read_status: bad parameter list"
+ .endif
+ .exitm
+;
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_read_status: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_read_state_wd
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 18, 1988
+;
+; FUNCTION: Transfers the next Am29027 state word to the Am29000
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the next Am29027
+; state word contents are to be written.
+;
+; USAGE:
+;
+; cp_read_state_wd reg
+;
+; Ex: cp_read_state_wd lr2 Transfers the next Am29027 state word
+; to lr2.
+;
+;============================================================================
+;
+ .macro cp_read_state_wd,p1
+;
+ .if $narg==0
+ .err
+ .print "cp_read_state_wd: missing parameter"
+ .endif
+;
+;
+ .if $narg==1
+ load 1,CP_SAVE_STATE,p1,0
+ .exitm
+ .endif
+;
+;
+ .if $narg>=2
+ .err
+ .print "cp_read_state_wd: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_save_state
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 18, 1988
+;
+; FUNCTION: Transfers the current Am29027 state to the Am29000
+;
+; PARAMETERS:
+; reg - the first of 30 Am29000 g.p. registers in which Am29027 state
+; is saved.
+;
+; USAGE:
+;
+; cp_save_state reg
+;
+; This macro transfers the current Am29027 state to a block of 30 Am29000
+; registers. State is stored in the following order:
+;
+; reg instruction register
+; reg+1 I-Temp
+; reg+2 R MSBs
+; reg+3 R LSBs
+; reg+4 S MSBs
+; reg+5 S LSBs
+; reg+6 R-Temp MSBs
+; reg+7 R-Temp LSBs
+; reg+8 S-Temp MSBs
+; reg+9 S-Temp LSBs
+; reg+10 status
+; reg+11 precision
+; reg+12 RF0 MSBs
+; reg+13 RF0 LSBs
+; . .
+; . .
+; . .
+; reg+26 RF7 MSBs
+; reg+27 RF7 LSBs
+; reg+28 mode MSBs
+; reg+29 mode LSBs
+;
+;
+; Ex: cp_save_state lr2 Transfers the current Am29027 state to
+; the Am29000, starting at lr2.
+;
+; NOTES:
+; 1) This macro stores all 64-bit quantities in "big-endian" order,
+; i.e. MSBs first. For example, the 32 MSBs of register R are
+; stored in reg+2, and the 32 LSBs are stored in reg+3. The Am29027
+; transfers these quantites in "little-endian" order; the macro
+; is responsible for swapping MS and LS words.
+;
+;============================================================================
+;
+ .macro cp_save_state,p1
+;
+ .if $narg==0
+ .err
+ .print "cp_save_state: missing parameter"
+ .endif
+;
+;
+ .if $narg==1
+ cp_read_sp p1,NO_ERR
+ ;guarantee that we're at beginning of
+ ; save state sequence
+ cp_read_state_wd %%((&p1)+ 0) ; instruction
+ cp_read_state_wd %%((&p1)+ 1) ; I-Temp
+ cp_read_state_wd %%((&p1)+ 3) ; R MSBs
+ cp_read_state_wd %%((&p1)+ 2) ; R LSBs
+ cp_read_state_wd %%((&p1)+ 5) ; S MSBs
+ cp_read_state_wd %%((&p1)+ 4) ; S LSBs
+ cp_read_state_wd %%((&p1)+ 7) ; R-Temp MSBs
+ cp_read_state_wd %%((&p1)+ 6) ; R-Temp LSBs
+ cp_read_state_wd %%((&p1)+ 9) ; S-Temp MSBs
+ cp_read_state_wd %%((&p1)+ 8) ; S-Temp LSBs
+ cp_read_state_wd %%((&p1)+10) ; status
+ cp_read_state_wd %%((&p1)+11) ; precision
+ cp_read_state_wd %%((&p1)+13) ; RF0 MSBs
+ cp_read_state_wd %%((&p1)+12) ; RF0 LSBs
+ cp_read_state_wd %%((&p1)+15) ; RF1 MSBs
+ cp_read_state_wd %%((&p1)+14) ; RF1 LSBs
+ cp_read_state_wd %%((&p1)+17) ; RF2 MSBs
+ cp_read_state_wd %%((&p1)+16) ; RF2 LSBs
+ cp_read_state_wd %%((&p1)+19) ; RF3 MSBs
+ cp_read_state_wd %%((&p1)+18) ; RF3 LSBs
+ cp_read_state_wd %%((&p1)+21) ; RF4 MSBs
+ cp_read_state_wd %%((&p1)+20) ; RF4 LSBs
+ cp_read_state_wd %%((&p1)+23) ; RF5 MSBs
+ cp_read_state_wd %%((&p1)+22) ; RF5 LSBs
+ cp_read_state_wd %%((&p1)+25) ; RF6 MSBs
+ cp_read_state_wd %%((&p1)+24) ; RF6 LSBs
+ cp_read_state_wd %%((&p1)+27) ; RF7 MSBs
+ cp_read_state_wd %%((&p1)+26) ; RF7 LSBs
+ cp_read_state_wd %%((&p1)+29) ; mode MSBs
+ cp_read_state_wd %%((&p1)+28) ; mode LSBs
+ .exitm
+ .endif
+;
+;
+ .if $narg>=2
+ .err
+ .print "cp_save_state: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_restore_state
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 18, 1988
+;
+; FUNCTION: Restores Am29027 state
+;
+; PARAMETERS:
+; reg - the first of 30 Am29000 g.p. registers containing Am29027
+; state.
+;
+; temp - a scratch register used by cp_restore_state
+;
+; USAGE:
+;
+; cp_restore_state reg,temp
+;
+; This macro restores Am29027 state by transferring 30 words to the
+; Am29027; these words are taken from a block of Am29000 g.p. registers
+; starting at "reg." The words are assumed to be stored in the following
+; order:
+;
+; reg instruction register
+; reg+1 I-Temp
+; reg+2 R MSBs
+; reg+3 R LSBs
+; reg+4 S MSBs
+; reg+5 S LSBs
+; reg+6 R-Temp MSBs
+; reg+7 R-Temp LSBs
+; reg+8 S-Temp MSBs
+; reg+9 S-Temp LSBs
+; reg+10 status
+; reg+11 precision
+; reg+12 RF0 MSBs
+; reg+13 RF0 LSBs
+; . .
+; . .
+; . .
+; reg+26 RF7 MSBs
+; reg+27 RF7 LSBs
+; reg+28 mode MSBs
+; reg+29 mode LSBs
+;
+;
+; Ex: cp_restore_state lr2,gr70 Restores Am29027 state by
+; transferring a block of 30 words
+; that begins at lr2. Register gr70
+; is used as scratch storage by this
+; macro.
+;
+;
+;============================================================================
+;
+ .macro cp_restore_state,p1,p2
+;
+ .if $narg<=1
+ .err
+ .print "cp_restore_state: missing parameter(s)"
+ .endif
+;
+;
+ .if $narg==2
+
+ const p2,0 ;clear the status register
+ cp_write_status p2
+;
+ cp_write_mode %%((&p1)+28) ;restore the mode register
+;
+ const p2,0x80000018 ; restore RF0
+ consth p2,0x80000018
+ cp_write_inst p2
+ cp_write_r %%((&p1)+12),START
+;
+ consth p2,0x90000018 ; restore RF1
+ cp_write_inst p2
+ cp_write_r %%((&p1)+14),START
+;
+ consth p2,0xA0000018 ; restore RF2
+ cp_write_inst p2
+ cp_write_r %%((&p1)+16),START
+;
+ consth p2,0xB0000018 ; restore RF3
+ cp_write_inst p2
+ cp_write_r %%((&p1)+18),START
+;
+ consth p2,0xC0000018 ; restore RF4
+ cp_write_inst p2
+ cp_write_r %%((&p1)+20),START
+;
+ consth p2,0xD0000018 ; restore RF5
+ cp_write_inst p2
+ cp_write_r %%((&p1)+22),START
+;
+ consth p2,0xE0000018 ; restore RF6
+ cp_write_inst p2
+ cp_write_r %%((&p1)+24),START
+;
+ consth p2,0xF0000018 ; restore RF7
+ cp_write_inst p2
+ cp_write_r %%((&p1)+26),START
+;
+ cp_read_sp p2 ; do a dummy read, to guarantee that
+ ; the last operation is complete
+;
+ cp_write_prec %%((&p1)+11) ; restore precision
+;
+ cp_write_r %%((&p1)+2) ; restore R
+ cp_write_s %%((&p1)+4) ; restore S
+ cp_write_inst %%((&p1)+0) ; restore instruction
+ cp_advance_temps ; move R,S, and inst. to working registers
+;
+ cp_write_r %%((&p1)+6) ; restore R-Temp
+ cp_write_s %%((&p1)+8) ; restore S-Temp
+ cp_write_inst %%((&p1)+1) ; restore I-Temp
+;
+; restore the status register, retime last operation
+;
+ cp_write_status %%((&p1)+10),RESTORE
+;
+ .exitm
+ .endif
+;
+;
+ .if $narg>=3
+ .err
+ .print "cp_restore_state: too many parameters"
+ .endif
+;
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_build_inst
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 24, 1988
+; : January 4, 1989 Rich Parker
+;
+; FUNCTION: Builds a 32-bit Am29027 instruction in an Am29000 g.p.
+; register.
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the instruction word
+; is to be written
+;
+; op_code - mnemonic specifying the operation to be performed
+; (e.g. FADD, P_TIMES_Q)
+;
+; precision - precision specification for destination, source operands:
+; D_S - double-prec. result, single-prec. input(s)
+; D_D - double-prec. result, double-prec. input(s)
+; S_S - single-prec. result, single-prec. input(s)
+; S_D - single-prec. result, double-prec. input(s)
+;
+; dest - destination for the operation result:
+; RF0 - store result in Am29027 register file location RF0
+; RF1 - store result in Am29027 register file location RF1
+; RF2 - store result in Am29027 register file location RF2
+; RF3 - store result in Am29027 register file location RF3
+; RF4 - store result in Am29027 register file location RF4
+; RF5 - store result in Am29027 register file location RF5
+; RF6 - store result in Am29027 register file location RF6
+; RF7 - store result in Am29027 register file location RF7
+; GP - result is to be stored in an Am29000 g.p. register
+; with a read_dp, read_sp, or read_int macro.
+;
+; source1,
+; source2,
+; source3 - source operand specifications:
+; R - take source from Am29027 register R
+; S - take source from Am29027 register S
+; RF0 - take source from Am29027 register file location RF0
+; RF1 - take source from Am29027 register file location RF1
+; RF2 - take source from Am29027 register file location RF2
+; RF3 - take source from Am29027 register file location RF3
+; RF4 - take source from Am29027 register file location RF4
+; RF5 - take source from Am29027 register file location RF5
+; RF6 - take source from Am29027 register file location RF6
+; RF7 - take source from Am29027 register file location RF7
+; 0 - source is 0
+; ONE_HALF - source is constant .5 (f.p. operations only)
+; IMINUS1 - source is constant -1 (integer operations only)
+; 1 - source is constant 1
+; 2 - source is constant 2
+; 3 - source is constant 3
+; PI - source is constant pi (f.p. operations only)
+; IMINUSMAX - source is -(2**63) (integer operations only)
+;
+;
+; USAGE:
+;
+; cp_build_inst reg,op_code,[precision,]dest,source1[,source2][,source3]
+;
+; Op-codes fall into two categories: those that correspond to Am29000
+; floating-point op-codes, and for which the precision is implicit (e.g.
+; FADD, DMUL); and those that correspond to Am29027 base operations
+; (e.g. P_PLUS_T, P_TIMES_Q), and which require an explicit precision
+; specification.
+;
+; Every operation specified must have a destination; if the operation
+; does not write a result to the Am29027 register file, destination GP
+; must be specified. The number of source operands specified must agree
+; with the number of source operands required by the operation specified.
+;
+; Ex:
+;
+; cp_build_inst lr2,FADD,RF7,R,S
+; Builds an instruction word to
+; perform the operation:
+; RF7 <- R + S
+; where R, S, and RF7 are single-
+; precision f.p. operands. The
+; instruction word is placed in lr2.
+;
+; cp_build_inst gr119,DMUL,GP,R,ONE_HALF
+; Builds an instruction word to
+; perform the operation:
+; R * .5
+; where R, .5, and the result
+; are double-precision f.p. operands.
+; The result is not written to the
+; Am29027 register file. The
+; instruction word is written to
+; gr119.
+;
+;
+; cp_build_inst lr3,MIN_P_AND_T,S_D,RF7,R,S
+; Builds an instruction word to
+; perform the operation:
+; RF7 <- smaller of(R,S)
+; where R and S are double-precision
+; f.p. operands, and RF7 is a single-
+; precison f.p. operand. The
+; instruction word is written to
+; lr3.
+;
+;
+; cp_build_inst gr97,I_P_TIMES_Q,S_S,GP,R,2
+; Builds an instruction word to
+; perform the operation:
+; R * 2
+; where R, .5, and the result
+; are single-precision integer operands.
+; The result is not written to the
+; Am29027 register file. The
+; instruction word is written to
+; gr97
+;
+;
+; cp_build_inst lr7,ABS_P,D_D,RF6,S
+; Builds an instruction word to
+; perform the operation:
+; RF6 <- |S|
+; where S and RF7 are double-precision
+; f.p. operands. The instruction
+; word is written to gr7.
+;
+;
+; cp_build_inst gr127,PQ_PLUS_T,D_D,RF6,R,S,RF6
+; Builds an instruction word to
+; perform the operation:
+; RF6 <- (R * S) + RF6
+; where R, S and the result are
+; double-precision f.p. operands.
+; The instruction word is written
+; to gr127.
+;
+;
+;
+;============================================================================
+;
+ .macro cp_build_inst,p1,p2,p3,p4,p5,p6,p7
+;
+ .if $narg<=3
+ .err
+ .print "cp_build_inst: missing parameter(s)"
+ .exitm
+ .endif
+;
+; classify operation type
+;
+ .set _cp_op_type,255
+
+ _cp_set_op_params p2,FADD,1,5,4,0,5
+ _cp_set_op_params p2,DADD,1,5,4,0,5
+ _cp_set_op_params p2,FSUB,1,5,4,0,5
+ _cp_set_op_params p2,DSUB,1,5,4,0,5
+ _cp_set_op_params p2,FMUL,1,5,4,5,0
+ _cp_set_op_params p2,DMUL,1,5,4,5,0
+ _cp_set_op_params p2,FEQ,1,5,4,0,5
+ _cp_set_op_params p2,DEQ,1,5,4,0,5
+ _cp_set_op_params p2,FGE,1,5,4,0,5
+ _cp_set_op_params p2,DGE,1,5,4,0,5
+ _cp_set_op_params p2,FGT,1,5,4,0,5
+ _cp_set_op_params p2,DGT,1,5,4,0,5
+ _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4
+;
+; The next two lines were corrected on 1-4-89, Rich Parker
+;
+ _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0
+ _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0
+;
+ _cp_set_op_params p2,PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,ABSP,0,5,5,0,0
+ _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6
+ _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0
+ _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5
+ _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5
+ _cp_set_op_params p2,I_PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,I_MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,I_ABSP,0,5,5,0,0
+ _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5
+ _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_NOT_T,0,5,0,0,5
+ _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6
+ _cp_set_op_params p2,MOVE_P,0,5,5,0,0
+;
+;
+; if we couldn't find the op_code, flag an error
+;
+ .if _cp_op_type>=2
+ .err
+ .print "cp_build_inst: invalid Am29027 instruction mnemonic"
+ .exitm
+ .endif
+;
+; if number of parameters is incorrect, flag error
+;
+ .if $narg!=_cp_no_params
+ .err
+ .print "cp_build_inst: incorrect number of parameters"
+ .exitm
+ .endif
+;
+; find correct value for precision field, if appropriate
+;
+ .set _cp_prec_field,0 ; ** CORRECTION (1/4/89 ROP)
+ .if _cp_op_type==0 ; need to look for precision
+ .set _cp_found_precision,0
+ .ifeqs "@p3@","D_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","D_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .if _cp_found_precision==0
+ .err
+ .print "cp_build_inst: missing precision field"
+ .exitm
+ .endif
+ .endif
+;
+; find value for destination field
+;
+ .if _cp_op_type==0
+ .set _cp_dest_field_val,CP_DEST_EQ_@p4
+ .else
+ .set _cp_dest_field_val,CP_DEST_EQ_@p3
+ .endif
+;
+; find correct value for p select field
+;
+ .if _cp_p_paramno==0
+ .set _cp_p_field_val,0x00000000
+ .endif
+ .if _cp_p_paramno==4
+ .set _cp_p_field_val,CP_P_EQ_@p4
+ .endif
+ .if _cp_p_paramno==5
+ .set _cp_p_field_val,CP_P_EQ_@p5
+ .endif
+ .if _cp_p_paramno==6
+ .set _cp_p_field_val,CP_P_EQ_@p6
+ .endif
+ .if _cp_p_paramno==7
+ .set _cp_p_field_val,CP_P_EQ_@p7
+ .endif
+ .ifeqs "@p2@","I_NOT_T"
+ .set _cp_p_field_val,CP_P_EQ_IMINUS1
+ .endif
+;
+; find correct value for q select field
+;
+ .if _cp_q_paramno==0
+ .set _cp_q_field_val,0x00000000
+ .endif
+ .if _cp_q_paramno==4
+ .set _cp_q_field_val,CP_Q_EQ_@p4
+ .endif
+ .if _cp_q_paramno==5
+ .set _cp_q_field_val,CP_Q_EQ_@p5
+ .endif
+ .if _cp_q_paramno==6
+ .set _cp_q_field_val,CP_Q_EQ_@p6
+ .endif
+ .if _cp_q_paramno==7
+ .set _cp_q_field_val,CP_Q_EQ_@p7
+ .endif
+;
+; find correct value for t select field
+;
+ .if _cp_t_paramno==0
+ .set _cp_t_field_val,0x00000000
+ .endif
+ .if _cp_t_paramno==4
+ .set _cp_t_field_val,CP_T_EQ_@p4
+ .endif
+ .if _cp_t_paramno==5
+ .set _cp_t_field_val,CP_T_EQ_@p5
+ .endif
+ .if _cp_t_paramno==6
+ .set _cp_t_field_val,CP_T_EQ_@p6
+ .endif
+ .if _cp_t_paramno==7
+ .set _cp_t_field_val,CP_T_EQ_@p7
+ .endif
+;
+;
+ .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_p_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_q_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_t_field_val
+
+ const p1,_cp_inst_word
+ consth p1,_cp_inst_word
+;
+ .endm
+;
+;
+;
+ .macro _cp_set_op_params,par1,par2,par3,par4,par5,par6,par7
+ .ifeqs "@par1@","@par2@"
+ .set _cp_op_type,par3
+ .set _cp_no_params,par4
+ .set _cp_p_paramno,par5
+ .set _cp_q_paramno,par6
+ .set _cp_t_paramno,par7
+ .endif
+ .endm
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_build_inst_h
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 24, 1988
+; : January 4, 1989 Rich Parker
+;
+; FUNCTION: Builds a 16 MSBs of a 32-bit Am29027 instruction in an
+; Am29000 g.p. register.
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the instruction word
+; is to be written
+;
+; op_code - mnemonic specifying the operation to be performed
+; (e.g. FADD, P_TIMES_Q)
+;
+; precision - precision specification for destination, source operands:
+; D_S - double-prec. result, single-prec. input(s)
+; D_D - double-prec. result, double-prec. input(s)
+; S_S - single-prec. result, single-prec. input(s)
+; S_D - single-prec. result, double-prec. input(s)
+;
+; dest - destination for the operation result:
+; RF0 - store result in Am29027 register file location RF0
+; RF1 - store result in Am29027 register file location RF1
+; RF2 - store result in Am29027 register file location RF2
+; RF3 - store result in Am29027 register file location RF3
+; RF4 - store result in Am29027 register file location RF4
+; RF5 - store result in Am29027 register file location RF5
+; RF6 - store result in Am29027 register file location RF6
+; RF7 - store result in Am29027 register file location RF7
+; GP - result is to be stored in an Am29000 g.p. register
+; with a read_dp, read_sp, or read_int macro.
+;
+; source1,
+; source2,
+; source3 - source operand specifications:
+; R - take source from Am29027 register R
+; S - take source from Am29027 register S
+; RF0 - take source from Am29027 register file location RF0
+; RF1 - take source from Am29027 register file location RF1
+; RF2 - take source from Am29027 register file location RF2
+; RF3 - take source from Am29027 register file location RF3
+; RF4 - take source from Am29027 register file location RF4
+; RF5 - take source from Am29027 register file location RF5
+; RF6 - take source from Am29027 register file location RF6
+; RF7 - take source from Am29027 register file location RF7
+; 0 - source is 0
+; ONE_HALF - source is constant .5 (f.p. operations only)
+; IMINUS1 - source is constant -1 (integer operations only)
+; 1 - source is constant 1
+; 2 - source is constant 2
+; 3 - source is constant 3
+; PI - source is constant pi (f.p. operations only)
+; IMINUSMAX - source is -(2**63) (integer operations only)
+;
+;
+; USAGE:
+;
+; cp_build_inst_h reg,op_code,[precision,]dest,source1[,source2][,source3]
+;
+; This macro is similar to cp_build_inst, but creates only the 16 MSBs
+; of the 32-bit Am29027 instruction word. This macro is useful in cases
+; where the 16 LSBs of instruction word, which specify the operation
+; to be performed, already exist in an Am29000 g.p. register, but where
+; the 16 MSBs, which specify operand sources and destination, must be
+; changed. In such cases, one Am29000 instruction can be saved by using
+; cp_build_inst_h instead of cp_build_inst.
+;
+; Syntax and usage are identical to that of cp_build_inst.
+;
+; NOTE: This macro references macro _cp_set_op_params, which appears
+; in the assembly listing for macro _cp_build_inst.
+;
+;
+;
+;
+;============================================================================
+;
+ .macro cp_build_inst_h,p1,p2,p3,p4,p5,p6,p7
+;
+ .if $narg<=3
+ .err
+ .print "cp_build_inst_h: missing parameter(s)"
+ .exitm
+ .endif
+;
+; classify operation type
+;
+ .set _cp_op_type,255
+
+ _cp_set_op_params p2,FADD,1,5,4,0,5
+ _cp_set_op_params p2,DADD,1,5,4,0,5
+ _cp_set_op_params p2,FSUB,1,5,4,0,5
+ _cp_set_op_params p2,DSUB,1,5,4,0,5
+ _cp_set_op_params p2,FMUL,1,5,4,5,0
+ _cp_set_op_params p2,DMUL,1,5,4,5,0
+ _cp_set_op_params p2,FEQ,1,5,4,0,5
+ _cp_set_op_params p2,DEQ,1,5,4,0,5
+ _cp_set_op_params p2,FGE,1,5,4,0,5
+ _cp_set_op_params p2,DGE,1,5,4,0,5
+ _cp_set_op_params p2,FGT,1,5,4,0,5
+ _cp_set_op_params p2,DGT,1,5,4,0,5
+ _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4
+;
+; The next two lines were corrected on 1-4-89, Rich Parker
+;
+ _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0
+ _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0
+;
+ _cp_set_op_params p2,PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,ABSP,0,5,5,0,0
+ _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6
+ _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0
+ _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5
+ _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5
+ _cp_set_op_params p2,I_PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,I_MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,I_ABSP,0,5,5,0,0
+ _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5
+ _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_NOT_T,0,5,0,0,5
+ _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6
+ _cp_set_op_params p2,MOVE_P,0,5,5,0,0
+;
+;
+; if we couldn't find the op_code, flag an error
+;
+ .if _cp_op_type>=2
+ .err
+ .print "cp_build_inst_h: invalid Am29027 instruction mnemonic"
+ .exitm
+ .endif
+;
+; if number of parameters is incorrect, flag error
+;
+ .if $narg!=_cp_no_params
+ .err
+ .print "cp_build_inst_h: incorrect number of parameters"
+ .exitm
+ .endif
+;
+; find correct value for precision field, if appropriate
+;
+ .set _cp_prec_field,0 ; ** CORRECTION (1-4-89 Rich Parker)
+ .if _cp_op_type==0 ; need to look for precision
+ .set _cp_found_precision,0
+ .ifeqs "@p3@","D_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","D_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .if _cp_found_precision==0
+ .err
+ .print "cp_build_inst_h: missing precision field"
+ .exitm
+ .endif
+ .endif
+;
+; find value for destination field
+;
+ .if _cp_op_type==0
+ .set _cp_dest_field_val,CP_DEST_EQ_@p4
+ .else
+ .set _cp_dest_field_val,CP_DEST_EQ_@p3
+ .endif
+;
+; find correct value for p select field
+;
+ .if _cp_p_paramno==0
+ .set _cp_p_field_val,0x00000000
+ .endif
+ .if _cp_p_paramno==4
+ .set _cp_p_field_val,CP_P_EQ_@p4
+ .endif
+ .if _cp_p_paramno==5
+ .set _cp_p_field_val,CP_P_EQ_@p5
+ .endif
+ .if _cp_p_paramno==6
+ .set _cp_p_field_val,CP_P_EQ_@p6
+ .endif
+ .if _cp_p_paramno==7
+ .set _cp_p_field_val,CP_P_EQ_@p7
+ .endif
+ .ifeqs "@p2@","I_NOT_T"
+ .set _cp_p_field_val,CP_P_EQ_IMINUS1
+ .endif
+;
+; find correct value for q select field
+;
+ .if _cp_q_paramno==0
+ .set _cp_q_field_val,0x00000000
+ .endif
+ .if _cp_q_paramno==4
+ .set _cp_q_field_val,CP_Q_EQ_@p4
+ .endif
+ .if _cp_q_paramno==5
+ .set _cp_q_field_val,CP_Q_EQ_@p5
+ .endif
+ .if _cp_q_paramno==6
+ .set _cp_q_field_val,CP_Q_EQ_@p6
+ .endif
+ .if _cp_q_paramno==7
+ .set _cp_q_field_val,CP_Q_EQ_@p7
+ .endif
+;
+; find correct value for t select field
+;
+ .if _cp_t_paramno==0
+ .set _cp_t_field_val,0x00000000
+ .endif
+ .if _cp_t_paramno==4
+ .set _cp_t_field_val,CP_T_EQ_@p4
+ .endif
+ .if _cp_t_paramno==5
+ .set _cp_t_field_val,CP_T_EQ_@p5
+ .endif
+ .if _cp_t_paramno==6
+ .set _cp_t_field_val,CP_T_EQ_@p6
+ .endif
+ .if _cp_t_paramno==7
+ .set _cp_t_field_val,CP_T_EQ_@p7
+ .endif
+;
+;
+ .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_p_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_q_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_t_field_val
+;
+ consth p1,_cp_inst_word
+;
+ .endm
+;
+;
+;
+;
+;============================================================================
+; MACRO NAME: cp_build_inst_l
+;
+; WRITTEN BY: Bob Perlman
+;
+; MOST RECENT UPDATE: April 24, 1988
+; : January 4, 1989 Rich Parker
+;
+; FUNCTION: Builds a 16 LSBs of a 32-bit Am29027 instruction in an
+; Am29000 g.p. register; the 16 MSBs of the register are
+; set to 0..
+;
+; PARAMETERS:
+; reg - the Am29000 g.p. register into which the instruction word
+; is to be written
+;
+; op_code - mnemonic specifying the operation to be performed
+; (e.g. FADD, P_TIMES_Q)
+;
+; precision - precision specification for destination, source operands:
+; D_S - double-prec. result, single-prec. input(s)
+; D_D - double-prec. result, double-prec. input(s)
+; S_S - single-prec. result, single-prec. input(s)
+; S_D - single-prec. result, double-prec. input(s)
+;
+; dest - destination for the operation result:
+; RF0 - store result in Am29027 register file location RF0
+; RF1 - store result in Am29027 register file location RF1
+; RF2 - store result in Am29027 register file location RF2
+; RF3 - store result in Am29027 register file location RF3
+; RF4 - store result in Am29027 register file location RF4
+; RF5 - store result in Am29027 register file location RF5
+; RF6 - store result in Am29027 register file location RF6
+; RF7 - store result in Am29027 register file location RF7
+; GP - result is to be stored in an Am29000 g.p. register
+; with a read_dp, read_sp, or read_int macro.
+;
+; source1,
+; source2,
+; source3 - source operand specifications:
+; R - take source from Am29027 register R
+; S - take source from Am29027 register S
+; RF0 - take source from Am29027 register file location RF0
+; RF1 - take source from Am29027 register file location RF1
+; RF2 - take source from Am29027 register file location RF2
+; RF3 - take source from Am29027 register file location RF3
+; RF4 - take source from Am29027 register file location RF4
+; RF5 - take source from Am29027 register file location RF5
+; RF6 - take source from Am29027 register file location RF6
+; RF7 - take source from Am29027 register file location RF7
+; 0 - source is 0
+; ONE_HALF - source is constant .5 (f.p. operations only)
+; IMINUS1 - source is constant -1 (integer operations only)
+; 1 - source is constant 1
+; 2 - source is constant 2
+; 3 - source is constant 3
+; PI - source is constant pi (f.p. operations only)
+; IMINUSMAX - source is -(2**63) (integer operations only)
+;
+;
+; USAGE:
+;
+; cp_build_inst_l reg,op_code,[precision,]dest,source1[,source2][,source3]
+;
+; This macro is similar to cp_build_inst, but creates only the 16 LSBs
+; of the 32-bit Am29027 instruction word; the 16 MSBs of the target
+; register are set to 0. This macro is useful in cases
+; where it is helpful to specify instruction LSBs and MSBs separately,
+; to improve instruction scheduling.
+;
+; Syntax and usage are identical to that of cp_build_inst.
+;
+; NOTE: This macro references macro _cp_set_op_params, which appears
+; in the assembly listing for macro _cp_build_inst.
+;
+;
+;============================================================================
+;
+ .macro cp_build_inst_l,p1,p2,p3,p4,p5,p6,p7
+;
+ .if $narg<=3
+ .err
+ .print "cp_build_inst_h: missing parameter(s)"
+ .exitm
+ .endif
+;
+; classify operation type
+;
+ .set _cp_op_type,255
+
+ _cp_set_op_params p2,FADD,1,5,4,0,5
+ _cp_set_op_params p2,DADD,1,5,4,0,5
+ _cp_set_op_params p2,FSUB,1,5,4,0,5
+ _cp_set_op_params p2,DSUB,1,5,4,0,5
+ _cp_set_op_params p2,FMUL,1,5,4,5,0
+ _cp_set_op_params p2,DMUL,1,5,4,5,0
+ _cp_set_op_params p2,FEQ,1,5,4,0,5
+ _cp_set_op_params p2,DEQ,1,5,4,0,5
+ _cp_set_op_params p2,FGE,1,5,4,0,5
+ _cp_set_op_params p2,DGE,1,5,4,0,5
+ _cp_set_op_params p2,FGT,1,5,4,0,5
+ _cp_set_op_params p2,DGT,1,5,4,0,5
+ _cp_set_op_params p2,CONVERT_I_TO_F,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_I_TO_D,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_F_TO_I,1,4,0,0,4
+ _cp_set_op_params p2,CONVERT_D_TO_I,1,4,0,0,4
+;
+; The next two lines were corrected on 1-4-89, Rich Parker
+;
+ _cp_set_op_params p2,CONVERT_F_TO_D,1,4,4,0,0
+ _cp_set_op_params p2,CONVERT_D_TO_F,1,4,4,0,0
+;
+ _cp_set_op_params p2,PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,ABSP,0,5,5,0,0
+ _cp_set_op_params p2,SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,MINUSP_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_PLUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,ABS_ABSP_MINUS_ABST,0,6,5,0,6
+ _cp_set_op_params p2,P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,MINUSP_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,ABS_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MAX_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,MIN_ABSP_AND_ABST,0,6,5,0,6
+ _cp_set_op_params p2,LIMIT_P_TO_MAGT,0,6,5,0,6
+ _cp_set_op_params p2,CONVERT_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,SCALE_T_TO_INT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,PQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_PLUS_T,0,7,5,6,7
+ _cp_set_op_params p2,PQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,MINUSPQ_MINUS_T,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,MINUSABSPQ_PLUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ABSPQ_MINUS_ABST,0,7,5,6,7
+ _cp_set_op_params p2,ROUND_T_TO_INT,0,5,0,0,5
+ _cp_set_op_params p2,RECIPROCAL_OF_P,0,5,5,0,0
+ _cp_set_op_params p2,CONVERT_T_TO_ALT,0,5,0,0,5
+ _cp_set_op_params p2,CONVERT_T_FROM_ALT,0,5,0,0,5
+ _cp_set_op_params p2,I_PASS_P,0,5,5,0,0
+ _cp_set_op_params p2,I_MINUSP,0,5,5,0,0
+ _cp_set_op_params p2,I_ABSP,0,5,5,0,0
+ _cp_set_op_params p2,I_SIGNT_TIMES_ABSP,0,6,6,0,5
+ _cp_set_op_params p2,I_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MINUSP_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_PLUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_ABS_P_MINUS_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_TIMES_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_COMPARE_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MAX_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_MIN_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_CONVERT_T_TO_FLOAT,0,5,0,0,5
+ _cp_set_op_params p2,I_SCALE_T_TO_FLOAT_BY_Q,0,6,0,6,5
+ _cp_set_op_params p2,I_P_OR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_AND_T,0,6,5,0,6
+ _cp_set_op_params p2,I_P_XOR_T,0,6,5,0,6
+ _cp_set_op_params p2,I_NOT_T,0,5,0,0,5
+ _cp_set_op_params p2,I_LSHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_ASHIFT_P_BY_Q,0,6,5,6,0
+ _cp_set_op_params p2,I_FSHIFT_PT_BY_Q,0,7,5,7,6
+ _cp_set_op_params p2,MOVE_P,0,5,5,0,0
+;
+;
+; if we couldn't find the op_code, flag an error
+;
+ .if _cp_op_type>=2
+ .err
+ .print "cp_build_inst_h: invalid Am29027 instruction mnemonic"
+ .exitm
+ .endif
+;
+; if number of parameters is incorrect, flag error
+;
+ .if $narg!=_cp_no_params
+ .err
+ .print "cp_build_inst_h: incorrect number of parameters"
+ .exitm
+ .endif
+;
+; find correct value for precision field, if appropriate
+;
+ .set _cp_prec_field,0 ; CORRECTION (1-4-89 Rich Parker)
+ .if _cp_op_type==0 ; need to look for precision
+ .set _cp_found_precision,0
+ .ifeqs "@p3@","D_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","D_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_D"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .ifeqs "@p3@","S_S"
+ .set _cp_prec_field,CP_@p3
+ .set _cp_found_precision,1
+ .endif
+ .if _cp_found_precision==0
+ .err
+ .print "cp_build_inst_h: missing precision field"
+ .exitm
+ .endif
+ .endif
+;
+; find value for destination field
+;
+ .if _cp_op_type==0
+ .set _cp_dest_field_val,CP_DEST_EQ_@p4
+ .else
+ .set _cp_dest_field_val,CP_DEST_EQ_@p3
+ .endif
+;
+; find correct value for p select field
+;
+ .if _cp_p_paramno==0
+ .set _cp_p_field_val,0x00000000
+ .endif
+ .if _cp_p_paramno==4
+ .set _cp_p_field_val,CP_P_EQ_@p4
+ .endif
+ .if _cp_p_paramno==5
+ .set _cp_p_field_val,CP_P_EQ_@p5
+ .endif
+ .if _cp_p_paramno==6
+ .set _cp_p_field_val,CP_P_EQ_@p6
+ .endif
+ .if _cp_p_paramno==7
+ .set _cp_p_field_val,CP_P_EQ_@p7
+ .endif
+ .ifeqs "@p2@","I_NOT_T"
+ .set _cp_p_field_val,CP_P_EQ_IMINUS1
+ .endif
+;
+; find correct value for q select field
+;
+ .if _cp_q_paramno==0
+ .set _cp_q_field_val,0x00000000
+ .endif
+ .if _cp_q_paramno==4
+ .set _cp_q_field_val,CP_Q_EQ_@p4
+ .endif
+ .if _cp_q_paramno==5
+ .set _cp_q_field_val,CP_Q_EQ_@p5
+ .endif
+ .if _cp_q_paramno==6
+ .set _cp_q_field_val,CP_Q_EQ_@p6
+ .endif
+ .if _cp_q_paramno==7
+ .set _cp_q_field_val,CP_Q_EQ_@p7
+ .endif
+;
+; find correct value for t select field
+;
+ .if _cp_t_paramno==0
+ .set _cp_t_field_val,0x00000000
+ .endif
+ .if _cp_t_paramno==4
+ .set _cp_t_field_val,CP_T_EQ_@p4
+ .endif
+ .if _cp_t_paramno==5
+ .set _cp_t_field_val,CP_T_EQ_@p5
+ .endif
+ .if _cp_t_paramno==6
+ .set _cp_t_field_val,CP_T_EQ_@p6
+ .endif
+ .if _cp_t_paramno==7
+ .set _cp_t_field_val,CP_T_EQ_@p7
+ .endif
+;
+;
+ .set _cp_inst_word,CP_@p2@|_cp_prec_field|_cp_dest_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_p_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_q_field_val
+ .set _cp_inst_word,_cp_inst_word|_cp_t_field_val
+;
+ const p1,_cp_inst_word
+;
+ .endm
+;
+; end of file fpsymbol.h
diff --git a/newlib/libc/sys/a29khif/sys/intrinsi.h b/newlib/libc/sys/a29khif/sys/intrinsi.h
new file mode 100644
index 000000000..1ae3a8b5c
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/intrinsi.h
@@ -0,0 +1,457 @@
+; @(#)intrinsi.h 1.4 90/10/14 20:56:06, Copyright 1988, 1989, 1990 AMD
+; start of file intrinsi.h
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+ .title "QTC Intrinsics Header file"
+;
+; Floating point library package for AMD 29000 family
+;
+; Copyright 1988 Advanced Micro Devices, Inc.
+;
+; All rights reserved
+;
+; Developed for AMD by Quantitative Technology Corporation
+; 8700 SW Creekside Place Suite D
+; Beaverton OR 97005
+; (503) 626-3081
+;
+; Version information :
+;
+; Revision 1.6 89/06/29 16:08:51 jimh
+; Fixed two bugs regarding compatiblility with the fpsymbol file. The
+; definitions of ROUND_TO_PLUS/MINUS_INFINITY were reversed. Set_Rounding
+; _Mode was fixed to set the local copy (29000 resident) of rounding mode
+; in 29027 mode.
+;
+;
+; Revision 1.5 89/04/17 11:20:49 jim
+; replaced emfsr and emtsr macro calls with mfsr and mtsr instructions.
+;
+; Revision 1.4 89/02/24 15:18:04 jimh
+; Added the definitions of FP_ENV_MODE_1_DEFAULT, FP_ENV_MODE_2_DEFAULT,
+; FP_FLAGS_DEFAULT.
+; Added macro clear_Flags.
+; Changed the operation of set_Invalid_Op_flag, set_Reserved_Op_flag.
+;
+; Revision 1.3 89/02/01 18:30:12 jimh
+; Changed the way set_Rounding_Mode, extract_Rounding_Mode, set_Invalid_Op_flag
+; and set_Reserved_Op_flag are done. Changed save_FP_regs.
+;
+; Revision 1.2 89/01/31 10:01:54 jimh
+; Updated to the new standard. This includes moving in register
+; definitions, changing old symbols to reflect those in fpsymbol.h,
+; and changing the include file to smartmac.h.
+;
+;
+ .include "../traps/fpenv.h" ; RPD 8/21/89
+ .include "sys/smartmac.h"
+
+ .equ DOUBLE_EXP_WIDTH, 11
+ .equ DOUBLE_EXTENDED_WIDTH, 56
+
+ .equ SIGNED, 0
+ .equ UNSIGNED, 1
+
+ .equ ROUND_TO_NEAREST, 0
+ .equ ROUND_TO_MINUS_INFINITY, 1
+ .equ ROUND_TO_PLUS_INFINITY, 2
+ .equ ROUND_TO_ZERO, 3
+ .equ ROUNDING_MODE_POSITION, 14
+
+ .equ FORMAT_INTEGER, 0
+ .equ FORMAT_SINGLE, 1
+ .equ FORMAT_DOUBLE, 2
+
+ .equ DOUBLE_MSB_MASK,0x00080000
+;
+; The following are definitions used in the smart macro package, defining
+; the 29000 shadow registers for the floating-point register file, and
+; some temporary registers used during the library routines
+;
+ .reg FP0, gr96
+ .reg FP1, gr98
+ .reg FP2, gr100
+ .reg FP3, gr102
+ .reg FP4, gr104
+ .reg FP5, gr106
+ .reg FP6, gr108
+ .reg FP7, gr110
+;
+; GR60 through GR6F are used to return the value of a function
+;
+ .reg rtn0, gr96
+ .reg rtn1, gr97
+ .reg rtn2, gr98
+ .reg rtn3, gr99
+ .reg rtn4, gr100
+ .reg rtn5, gr101
+ .reg rtn6, gr102
+ .reg rtn7, gr103
+ .reg rtn8, gr104
+ .reg rtn9, gr105
+ .reg rtn10, gr106
+ .reg rtn11, gr107
+ .reg rtn12, gr108
+ .reg rtn13, gr109
+ .reg rtn14, gr110
+ .reg rtn15, gr111
+;
+; GR74..GR78 (116-120) - temporaries
+;
+ .reg t0, gr116
+ .reg t1, gr117
+ .reg t2, gr118
+ .reg t3, gr119
+ .reg t4, gr120
+;
+; FP_ENV_MODE_1 and FP_ENV_MODE_2 are based on 64-bit 29027 Mode register,
+; and thus the fpsymbol.h CP_ constants may be used directly.
+;
+; FP_ENV_MODE_1 (Bits 0-31)
+;
+; 0-3 - floating-point format select, always 0
+; 4 - Saturate enable
+; 5 - IEEE Affine/Projective mode (ignored by traps code)
+; 6 - IEEE Trap enable
+; 7 - IEEE Sudden underflow / FP Environment Fast Float Select
+; 8-10 - ignored
+; 11 - Integer multiplication signed/unsigned select
+; 12-13 - Integer multiplication format adjust
+; 14-16 - Rounding mode select
+; 17-19 - ignored
+; 20 - Pipeline mode select
+; 21 - ignored
+; 22 - Invalid operation mask bit
+; 23 - Reserved operand mask bit
+; 24 - Overflow mask bit
+; 25 - Underflow mask bit
+; 26 - Inexact result mask bit
+; 27 - Zero mask bit
+; 28-31 - ignored
+;
+; FP_ENV_MODE_2 (Bits 32-63) [Hardware configuration register, rarely modified]
+;
+; 32-35 - Pipeline timer count
+; 36-39 - Timer count for multiply-accumulate operation
+; 40-43 - Timer count for save state transaction request
+; 44-63 - ignored
+;
+; FP_ENV_MODE_1 definitions
+;
+ .set FP_ENV_MODE_1_DEFAULT, CP_PFF_EQ_IEEE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_AFF_EQ_IEEE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_AFFINE_MODE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_IEEE_TRAPS_DISABLED
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_IEEE_GRADUAL_UFLOW_MODE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_UNSIGNED_INT_MPY_MODE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_MF_EQ_LSBS
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_RMS_EQ_NEAREST
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_FLOWTHROUGH_MODE
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_INVALID_OP_EXCP_MASK
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_RESERVED_OP_EXCP_MASK
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_OVERFLOW_EXCP_MASK
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_UNDERFLOW_EXCP_MASK
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_INEXACT_EXCP_MASK
+ .set FP_ENV_MODE_1_DEFAULT,FP_ENV_MODE_1_DEFAULT|CP_ZERO_EXCP_MASK
+;
+; FP_ENV_MODE_2 definitions
+;
+ .set FP_ENV_MODE_2_DEFAULT, CP_PLTC_EQ_6
+ .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_MATC_EQ_9
+ .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_MVTC_EQ_3
+ .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_NORMAL_DRDY_MODE
+ .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_HALT_ON_ERROR_DISABLED
+ .set FP_ENV_MODE_2_DEFAULT,FP_ENV_MODE_2_DEFAULT|CP_EXCP_DISABLED
+;
+; FP_FLAGS_DEFAULT definitions
+;
+ .equ FP_FLAGS_DEFAULT, 0x00000000 ; No flags set
+;
+; The following macros are used by transcendentals to access the environment.
+;
+; MACRO NAME: clear_Flags
+;
+; FUNCTION: to clear the flags on entry to a transcendental routine.
+;
+; INPUT PARAMETERS: reg - temporary working register
+; reg2 - temporary working register
+;
+ .macro clear_Flags,reg,reg2
+ .endm
+;
+; MACRO NAME: set_Invalid_Op_flag
+;
+; FUNCTION: to set the Invalid operation flag in the floating-point status
+; register
+;
+; INPUT PARAMETERS: reg - temporary working register
+; reg2 - 2nd temporary working register
+;
+ .macro set_Invalid_Op_flag,reg,reg2
+ .endm
+
+;
+; MACRO NAME: set_Reserved_Op_flag
+;
+; FUNCTION: to set the Reserved Op flag in the floating-point status register
+;
+; INPUT PARAMETERS: reg - temporary working register
+; reg2 - 2nd temporary working register
+;
+ .macro set_Reserved_Op_flag,reg,reg2
+ .endm
+
+;
+; MACRO NAME: extract_Rounding_Mode
+;
+; FUNCTION: to extract the Rounding Mode portion of the floating-point
+; invironment mode register, shift the value to the range of
+; 0-7, and leave it in a register
+;
+; INPUT PARAMETERS: reg - destination for the mode
+;
+ .macro extract_Rounding_Mode,reg
+ .ifdef _29027_MODE
+ .extern __29027Mode
+ const reg,__29027Mode
+ consth reg,__29027Mode
+ load 0,0,reg,reg
+ srl reg,reg,CP_RMS_POSITION
+ and reg,reg,CP_RMS_MASK >> CP_RMS_POSITION
+ .else
+ mfsr reg,FPE
+ and reg,reg,FPE_FPRND_MASK
+ srl reg,reg,FPE_FPRND_POSITION
+ .endif
+ .endm
+
+;
+; MACRO NAME: set_Rounding_Mode
+;
+; FUNCTION: to set the 29027 Rounding Mode to a given value
+;
+; INPUT PARAMETERS: reg - working register
+; reg2 - second working register
+; rounding_mode - value of the rounding mode
+; 0 - round to nearest
+; 1 - round to minus infinity
+; 2 - round to plus infinity
+; 3 - round to zero
+;
+; NOTES: rounding_mode value is not checked
+; 29027 Mode register is NOT written by this macro
+;
+ .macro set_Rounding_Mode,reg,reg2,mode
+ .ifdef _29027_MODE
+ .extern __29027Mode
+ const reg2,__29027Mode
+ consth reg2,__29027Mode
+ load 0,0,reg,reg2
+ const reg2,CP_RMS_MASK
+ consth reg2,CP_RMS_MASK
+ andn reg,reg,reg2
+ const reg2,mode
+ sll reg2,reg2,CP_RMS_POSITION
+ or reg,reg,reg2
+ const reg2,__29027Mode
+ consth reg2,__29027Mode
+ store 0,0,reg,reg2
+ add reg2,reg2,4
+ load 0,0,reg2,reg2
+ cp_write_mode reg2,reg
+ .else
+ mfsr reg,FPE
+ andn reg,reg,FPE_FPRND_MASK
+ const reg2,mode
+ sll reg2,reg2,FPE_FPRND_POSITION
+ or reg,reg,reg2
+ mtsr FPE,reg
+ .endif
+ .endm
+;
+;
+; NOTE: The 29027 is the floating point coprocessor for the 29000.
+; It contains 8 floating point registers FP0 to FP7. Three of
+; these, FP0, FP1, and FP2, are currently designated as scratch,
+; that is, they will not be preserved across calls. The other
+; five contain values that must be saved whenever they are used
+; in code, and restored before the exit of the routine. The 29027
+; registers are tagged with a single bit indicating the precision
+; of the current value. When numbers are read into the 29027,
+; they are always stored in double precision, so that single
+; precision values are converted on input. Only the MOVE instruction
+; fails to do this automatic widening. If the result from calculations
+; in the 29027 ALU (determined by the result precision bit in the
+; instruction word) is to be single precision and the result saved in
+; an FP reg, the result precision bit from the instruction gets copied
+; into the precision bit for the register. If a single precision
+; SNaN is saved from the 29027, it will be converted to a double
+; precision QNaN. Along the way it will cause an unmasked exception
+; when read off the chip and cause changes to the status register.
+; So the preservation routine will need to modify the mode register to
+; mask off the exceptions, save the state of the status register before
+; saving the FP regs, and restore the status and mode registers to their
+; original settings when the save is complete.
+;
+; REFERENCE: The instructions to drive the Am29027 are described in the
+; Am29027 manual beginning on page 17. Table 4 describes the
+; operation codes and table 3 the multiplexer codes. Communication
+; with the 29000 is described on pages 11 and 12 of the Am29027
+; manual and chapters 6 and 8 of the Am29000 User's Manual
+;
+; MACRO NAME: save_FP_regs
+;
+; FUNCTION: to save the AMD 29027 floating point register values in the
+; 29000 general purpose registers
+;
+; INPUT PARAMETERS: fp_register, one of the 29027 registers FP3 - FP7
+;
+; REGISTER USAGE: the following registers are used in save_FP_regs
+;
+; rtn0 this register is used in setting the mode and status registers
+; rtn1 this register is used in setting the mode and status registers
+; rtn6 this register is used to store the MSW when FP3 is saved
+; rtn7 this register is used to store the LSW when FP3 is saved
+; rtn8 this register is used to store the MSW when FP4 is saved
+; rtn9 this register is used to store the LSW when FP4 is saved
+;
+
+ .macro save_FP_regs,fp_register
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, expand the macro into 29027 code to preserve FP register
+ ;
+ .ifeqs "@fp_register@","FP3"
+ const rtn6,__29027Mode ; Load the address of FP mode
+ consth rtn6,__29027Mode
+ load 0,0,rtn0,rtn6 ; Load MSW of FP mode into rtn0
+ add rtn6,rtn6,4 ; Increment rtn6 + 4
+ load 0,0,rtn1,rtn6 ; Load LSW of FP mode into rtn1
+ const rtn6,CP_RESERVED_OP_EXCP_MASK ; Load mask to disable exception
+ consth rtn6,CP_RESERVED_OP_EXCP_MASK
+ or rtn0,rtn0,rtn6 ; OR in disable of exception mask
+ cp_write_mode rtn1, rtn0 ; Reset mode w/exception disabled
+ cp_read_status rtn0 ; Read status and save in rtn1
+ const rtn6,CP_PASS_P | CP_P_EQ_RF3 ; Instruction is PASS_P from RF3
+ consth rtn6,CP_PASS_P | CP_P_EQ_RF3
+ ; Load & execute the instruction
+ ;
+ store 1,CP_WRITE_INST | CP_START,rtn6,rtn6
+ load 1,CP_READ_MSBS,rtn6,rtn6 ; Read the MSW to first register
+ load 1,CP_READ_LSBS,rtn7,rtn7 ; Read the LSW to second register
+ cp_write_status rtn0 ; Restore the original status
+ const rtn1,__29027Mode ; Load the address of FP mode
+ consth rtn1,__29027Mode
+ load 0,0,rtn0,rtn1 ; Load MSW of FP mode into rtn0
+ add rtn1,rtn1,4 ; Increment rtn6 to __29027Mode+4
+ load 0,0,rtn1,rtn1 ; Load LSW of FP mode into rtn1
+ cp_write_mode rtn1, rtn0 ; Restore the original write mode
+ .endif
+ .ifeqs "@fp_register@","FP4"
+ const rtn8,__29027Mode ; Load the address of FP mode
+ consth rtn8,__29027Mode
+ load 0,0,rtn0,rtn8 ; Load MSW of FP mode into rtn0
+ add rtn8,rtn8,4 ; Increment rtn6 + 4
+ load 0,0,rtn1,rtn8 ; Load LSW of FP mode into rtn1
+ const rtn8,CP_RESERVED_OP_EXCP_MASK ; Load mask to disable exception
+ consth rtn8,CP_RESERVED_OP_EXCP_MASK
+ or rtn0,rtn0,rtn8 ; OR in disable of exception mask
+ cp_write_mode rtn1, rtn0 ; Reset mode w/exception disabled
+ cp_read_status rtn0 ; Read status and save in rtn1
+ const rtn8,CP_PASS_P | CP_P_EQ_RF4 ; Instruction is PASS_P from RF4
+ consth rtn8,CP_PASS_P | CP_P_EQ_RF4
+ ; Load & execute the instruction
+ ;
+ store 1,CP_WRITE_INST | CP_START,rtn8,rtn8
+ load 1,CP_READ_MSBS,rtn8,rtn8 ; Read the MSW to first register
+ load 1,CP_READ_LSBS,rtn9,rtn9 ; Read the LSW to second register
+ cp_write_status rtn0 ; Restore the original status
+ const rtn1,__29027Mode ; Load the address of FP mode
+ consth rtn1,__29027Mode
+ load 0,0,rtn0,rtn1 ; Load MSW of FP mode into rtn0
+ add rtn1,rtn1,4 ; Increment rtn6 + 4
+ load 0,0,rtn1,rtn1 ; Load LSW of FP mode into rtn1
+ cp_write_mode rtn1, rtn0 ; Restore the original write mode
+ .endif
+ .else
+ ;
+ ; For 29000 mode, do nothing
+ ;
+ .endif
+ .endm
+;
+; MACRO NAME: restore_FP_regs
+;
+; FUNCTION: to restore the AMD 29027 floating point register values from the
+; 29000 general purpose registers
+;
+; INPUT PARAMETERS: fp_register, one of the 29027 registers FP3 - FP7
+;
+; REGISTER USAGE: the following registers are used in restore_FP_regs
+;
+; rtn0 this register is used in setting the mode and status registers
+; rtn6 the value in this register is stored as the MSW of FP3
+; rtn7 the value in this register is stored as the LSW of FP3
+; rtn8 the value in this register is stored as the MSW of FP4
+; rtn9 the value in this register is stored as the LSW of FP4
+;
+ .macro restore_FP_regs,fp_register
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, move data from return registers to the correct FP register
+ ;
+ .ifeqs "@fp_register@","FP3"
+ store 1,CP_WRITE_R ,rtn6,rtn7 ; Move the data to the R register
+ ; Then create the instruction
+ ;
+ const rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF3
+ consth rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF3
+ ;
+ ; Perform the write
+ ;
+ store 1,(CP_WRITE_INST | CP_START),rtn0,0
+ .endif
+ .ifeqs "@fp_register@","FP4"
+ store 1,CP_WRITE_R ,rtn8,rtn9 ; Move the data to the R register
+ ; Then create the instruction
+ ;
+ const rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF4
+ consth rtn0,CP_MOVE_P|CP_D_D|CP_P_EQ_R|CP_DEST_EQ_RF4
+ ;
+ ; Perform the write
+ ;
+ store 1,(CP_WRITE_INST | CP_START),rtn0,0
+ .endif
+ .else
+ ;
+ ; For 29000 mode, do nothing.
+ ;
+ .endif
+ .endm
+;
+; end of file intrinsi.h
diff --git a/newlib/libc/sys/a29khif/sys/macros.h b/newlib/libc/sys/a29khif/sys/macros.h
new file mode 100644
index 000000000..3c832f033
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/macros.h
@@ -0,0 +1,37 @@
+; @(#)macros.h 1.3 90/10/14 20:56:10, Copyright 1989, 1990 AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; macros.h
+; Short macros of general utility
+
+ .macro mov, dest,src
+ add dest, src, 0
+ .endm
+
+ .macro not, dest,src
+ nand dest, src, src
+ .endm
diff --git a/newlib/libc/sys/a29khif/sys/proreg.h b/newlib/libc/sys/a29khif/sys/proreg.h
new file mode 100644
index 000000000..ca16b708c
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/proreg.h
@@ -0,0 +1,60 @@
+; @(#)proreg.h 1.3 90/10/14 20:56:11, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; proreg.h
+;
+ ; 16 function value return regs
+ .reg v0, gr96
+ .reg v1, gr97
+ .reg v2, gr98
+ .reg v3, gr99
+ .reg v4, gr100
+ .reg v5, gr101
+ .reg v6, gr102
+ .reg v7, gr103
+ .reg v8, gr104
+ .reg v9, gr105
+ .reg v10, gr106
+ .reg v11, gr107
+ .reg v12, gr108
+ .reg v13, gr109
+ .reg v14, gr110
+ .reg v15, gr111
+;
+ .reg rsp, gr1 ; Register Stack Pointer
+ .reg ret, gr96 ; First word of return value
+ .reg rp0, gr112 ; Reserved for Programmer, #0
+ .reg rp1, gr113 ; Reserved for Programmer, #1
+ .reg rp2, gr114 ; Reserved for Programmer, #2
+ .reg rp3, gr115 ; Reserved for Programmer, #3
+ .reg tav, gr121 ; Temporary, Argument for Trap Handlers
+ .reg tpc, gr122 ; Temporary, Return PC for Trap Handlers
+ .reg lrp, gr123 ; Large Return Pointer
+ .reg slp, gr124 ; Static Link Pointer
+ .reg msp, gr125 ; Memory Stack Pointer
+ .reg rab, gr126 ; Register Allocate Bound
+ .reg rfb, gr127 ; Register Free Bound
diff --git a/newlib/libc/sys/a29khif/sys/romdcl.h b/newlib/libc/sys/a29khif/sys/romdcl.h
new file mode 100644
index 000000000..d52ca0598
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/romdcl.h
@@ -0,0 +1,392 @@
+; @(#)romdcl.h 1.4 90/10/14 20:56:12, Copyright 1988, 1989, 1990 AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ .sbttl "Register, Constant and Macro Declarations - v1.4"
+
+; Copyright 1988, Advanced Micro Devices
+; Written by Gibbons and Associates, Inc.
+
+;v1.4 JG correct FUNCTION macro - fault in register padding to even
+
+;-----------------------------------------------------------------------
+;Global registers
+;-----------------------------------------------------------------------
+ .reg rsp, gr1 ;local reg. var. stack pointer
+
+ .equ SYS_TEMP, 64 ;system temp registers
+
+ .reg st0, gr64
+ .reg st1, gr65
+ .reg st2, gr66
+ .reg st3, gr67
+ .reg st4, gr68
+ .reg st5, gr69
+ .reg st6, gr70
+ .reg st7, gr71
+ .reg st8, gr72
+ .reg st9, gr73
+ .reg st10, gr74
+ .reg st11, gr75
+ .reg st12, gr76
+ .reg st13, gr77
+ .reg st14, gr78
+ .reg st15, gr79
+
+ .equ SYS_STAT, 80 ;system static registers
+
+ .reg ss0, gr80
+ .reg ss1, gr81
+ .reg ss2, gr82
+ .reg ss3, gr83
+ .reg ss4, gr84
+ .reg ss5, gr85
+ .reg ss6, gr86
+ .reg ss7, gr87
+ .reg ss8, gr88
+ .reg ss9, gr89
+ .reg ss10, gr90
+ .reg ss11, gr91
+ .reg ss12, gr92
+ .reg ss13, gr93
+ .reg ss14, gr94
+ .reg ss15, gr95
+
+ .equ RET_VAL, 96 ;return registers
+
+ .reg v0, gr96
+ .reg v1, gr97
+ .reg v2, gr98
+ .reg v3, gr99
+ .reg v4, gr100
+ .reg v5, gr101
+ .reg v6, gr102
+ .reg v7, gr103
+ .reg v8, gr104
+ .reg v9, gr105
+ .reg v10, gr106
+ .reg v11, gr107
+ .reg v12, gr108
+ .reg v13, gr109
+ .reg v14, gr110
+ .reg v15, gr111
+
+ .equ TEMP_REG, 96 ;temp registers
+
+ .reg t0, gr96
+ .reg t1, gr97
+ .reg t2, gr98
+ .reg t3, gr99
+ .reg t4, gr100
+ .reg t5, gr101
+ .reg t6, gr102
+ .reg t7, gr103
+ .reg t8, gr104
+ .reg t9, gr105
+ .reg t10, gr106
+ .reg t11, gr107
+ .reg t12, gr108
+ .reg t13, gr109
+ .reg t14, gr110
+ .reg t15, gr111
+
+ .equ RES_REG, 112 ;reserved (for user)
+
+ .reg r0, gr112
+ .reg r1, gr113
+ .reg r2, gr114
+ .reg r3, gr115
+
+ .equ TEMP_EXT, 116 ;temp extension (and shared)
+
+ .reg x0, gr116
+ .reg x1, gr117
+ .reg x2, gr118
+ .reg x3, gr119
+ .reg x4, gr120
+ .reg x5, gr121
+ .reg x6, gr122
+ .reg x7, gr123
+ .reg x8, gr124
+
+;-----------------------------------------------------------------------
+;Global registers with special calling convention uses
+;-----------------------------------------------------------------------
+
+ .reg tav, gr121 ;trap handler argument (also x6)
+ .reg tpc, gr122 ;trap handler return (also x7)
+ .reg lsrp, gr123 ;large return pointer (also x8)
+ .reg slp, gr124 ;static link pointer (also x9)
+ .reg msp, gr125 ;memory stack pointer
+ .reg rab, gr126 ;register alloc bound
+ .reg rfb, gr127 ;register frame bound
+
+;-----------------------------------------------------------------------
+;Local compiler registers - output parameters, etc.
+; (only valid if frame has been established)
+;-----------------------------------------------------------------------
+
+ .reg p15, lr17 ;parameter registers
+ .reg p14, lr16
+ .reg p13, lr15
+ .reg p12, lr14
+ .reg p11, lr13
+ .reg p10, lr12
+ .reg p9, lr11
+ .reg p8, lr10
+ .reg p7, lr9
+ .reg p6, lr8
+ .reg p5, lr7
+ .reg p4, lr6
+ .reg p3, lr5
+ .reg p2, lr4
+ .reg p1, lr3
+ .reg p0, lr2
+
+
+;-----------------------------------------------------------------------
+;TLB register count
+;-----------------------------------------------------------------------
+
+ .equ TLB_CNT, 128
+
+ .eject
+
+;-----------------------------------------------------------------------
+;constants for general use
+;-----------------------------------------------------------------------
+ .equ WRD_SIZ, 4 ;word size
+ .equ TRUE, 0x80000000 ;logical true -- bit 31
+ .equ FALSE, 0x00000000 ;logical false -- 0
+ .equ CHKPAT_a5, 0xa5a5a5a5 ;check pattern
+
+;-----------------------------------------------------------------------
+;constants for data access control
+;-----------------------------------------------------------------------
+ .equ CE, 0b1 ;coprocessor enable
+ .equ CD, 0b0 ;coprocessor disable
+
+ .equ AS, 0b1000000 ;set for I/O
+ .equ PA, 0b0100000 ;set for physical ad
+ .equ SB, 0b0010000 ;set for set BP
+ .equ UA, 0b0001000 ;set for user access
+
+ .equ ROM_OPT, 0b100 ;OPT values for acc
+ .equ DATA_OPT, 0b000
+ .equ INST_OPT, 0b000
+
+ .equ ROM_CTL, (PA + ROM_OPT) ;control field
+ .equ DATA_CTL, (PA + DATA_OPT)
+ .equ INST_CTL, (PA + INST_OPT)
+ .equ IO_CTL, (AS + PA + DATA_OPT)
+
+
+ .eject
+
+;-----------------------------------------------------------------------
+;defined vectors
+;-----------------------------------------------------------------------
+
+ .equ V_IllegalOp, 0
+ .equ V_Unaligned, 1
+ .equ V_OutOfRange, 2
+ .equ V_NoCoProc, 3
+ .equ V_CoProcExcept, 4
+ .equ V_ProtViol, 5
+ .equ V_InstAccExcept, 6
+ .equ V_DataAccExcept, 7
+ .equ V_UserInstTLB, 8
+ .equ V_UserDataTLB, 9
+ .equ V_SupInstTLB, 10
+ .equ V_SupDataTLB, 11
+ .equ V_InstTLBProt, 12
+ .equ V_DataTLBProt, 13
+ .equ V_Timer, 14
+ .equ V_Trace, 15
+ .equ V_INTR0, 16
+ .equ V_INTR1, 17
+ .equ V_INTR2, 18
+ .equ V_INTR3, 19
+ .equ V_TRAP0, 20
+ .equ V_TRAP1, 21
+
+ ; 22 - 31 reserved
+
+ .equ V_MULTIPLY, 32
+ .equ V_DIVIDE, 33
+ .equ V_MULTIPLU, 34
+ .equ V_DIVIDU, 35
+ .equ V_CONVERT, 36
+
+ ; 37 - 41 reserved
+
+ .equ V_FEQ, 42
+ .equ V_DEQ, 43
+ .equ V_FGT, 44
+ .equ V_DGT, 45
+ .equ V_FGE, 46
+ .equ V_DGE, 47
+ .equ V_FADD, 48
+ .equ V_DADD, 49
+ .equ V_FSUB, 50
+ .equ V_DSUB, 51
+ .equ V_FMUL, 52
+ .equ V_DMUL, 53
+ .equ V_FDIV, 54
+ .equ V_DDIV, 55
+
+ ; 56 - 63 reserved
+
+ .equ V_SPILL, 64
+ .equ V_FILL, 65
+ .equ V_BSDCALL, 66
+ .equ V_SYSVCALL, 67
+ .equ V_BRKPNT, 68
+ .equ V_EPI_OS, 69
+
+ .eject
+
+ .macro R_LEFT,REGVAR
+
+ ;Rotate left
+ ;
+ ; Parameters: REGVAR register to rotate
+
+ add REGVAR, REGVAR, REGVAR ;shift left by 1 bit, C = MSB
+ addc REGVAR, REGVAR, 0 ;add C to LSB
+
+ .endm
+;----------------------------------------------------------------------
+
+
+ .macro FUNCTION,NAME,INCNT,LOCCNT,OUTCNT
+
+ ;Introduces a non-leaf routine.
+ ;
+ ;This macro defines the standard tag word before the function,
+ ;then establishes the statement label with the function's name
+ ;and finally allocates a register stack frame. It may not be used
+ ;if a memory stack frame is required.
+ ;
+ ;Note also that the size of the register stack frame is limited.
+ ;Neither this nor the lack of a memory frame is considered to be
+ ;a severe restriction in an assembly language environment. The
+ ;assembler will report errors if the requested frame is too large
+ ;for this macro.
+ ;
+ ;It may be good practice to allocate an even number of both output
+ ;registers and local registers. This will help in maintaining
+ ;double word alignment within these groups. The macro will assure
+ ;double word alignment of the stack frame as a whole as required
+ ;for correct linkage.
+ ;
+ ; Paramters: NAME the function name
+ ; INCNT input parameter count
+ ; LOCCNT local register count
+ ; OUTCNT output parameter count
+
+ .set ALLOC_CNT, ((2 + OUTCNT + LOCCNT) << 2)
+ .set PAD_CNT, (ALLOC_CNT & 4)
+ .set ALLOC_CNT, (ALLOC_CNT + PAD_CNT)
+ .set REG_PAD, (PAD_CNT >> 2)
+ .if (INCNT)
+ .set IN_PRM, (4 + OUTCNT + REG_PAD + LOCCNT + 0x80)
+ .endif
+ .if (LOCCNT)
+ .set LOC_REG, (2 + OUTCNT + REG_PAD + 0x80)
+ .endif
+ .if (OUTCNT)
+ .set OUT_PRM, (2 + 0x80)
+ .endif
+
+ .word ((2 + OUTCNT + LOCCNT) << 16)
+NAME:
+ sub rsp, rsp, ALLOC_CNT
+ asgeu V_SPILL, rsp, rab
+ add lr1, rsp, ((4 + OUTCNT + LOCCNT + REG_PAD + INCNT) << 2)
+
+ .endm
+;----------------------------------------------------------------------
+
+
+ .macro LEAF,NAME,INCNT
+
+ ;Introduces a leaf routine
+ ;
+ ;This macro defines the standard tag word before the function,
+ ;then establishes the statement label with the function's name.
+ ;
+ ; Paramters: NAME the function name
+ ; INCNT input parameter count
+
+ .if (INCNT)
+ .set IN_PRM, (2 + 0x80)
+ .endif
+ .set ALLOC_CNT, 0
+
+ .word 0
+NAME:
+
+ .endm
+;----------------------------------------------------------------------
+
+
+ .macro EPILOGUE
+
+ ;De-allocates register stack frame (only and only if necessary).
+
+ .if (ALLOC_CNT)
+
+ add rsp, rsp, ALLOC_CNT
+ nop
+ jmpi lr0
+ asleu V_FILL, lr1, rfb
+
+ .else
+
+ jmpi lr0
+ nop
+
+ .endif
+
+ .set IN_PRM, (1024) ;illegal, to cause err on ref
+ .set LOC_REG, (1024) ;illegal, to cause err on ref
+ .set OUT_PRM, (1024) ;illegal, to cause err on ref
+ .set ALLOC_CNT, (1024) ;illegal, to cause err on ref
+
+ .endm
+;----------------------------------------------------------------------
+
+
+;Initial values for macro set variables to guard against misuse
+
+ .set IN_PRM, (1024) ;illegal, to cause err on ref
+ .set LOC_REG, (1024) ;illegal, to cause err on ref
+ .set OUT_PRM, (1024) ;illegal, to cause err on ref
+ .set ALLOC_CNT, (1024) ;illegal, to cause err on ref
+
+;......................................................................
+; end of romdcl.h
diff --git a/newlib/libc/sys/a29khif/sys/smartmac.h b/newlib/libc/sys/a29khif/sys/smartmac.h
new file mode 100644
index 000000000..2c870fa2a
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/smartmac.h
@@ -0,0 +1,1491 @@
+; @(#)smartmac.h 1.2 90/10/14 20:56:14, AMD
+; start of smartmac.h file
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;
+ .title "AM29000 Smart Macro Package"
+;
+; Floating point package for AMD 29000 family
+;
+; Copyright 1988 Advanced Micro Devices, Inc.
+;
+; All rights reserved
+;
+; Developed for AMD by Quantitative Technology Corporation
+; 8700 SW Creekside Place Suite D
+; Beaverton OR 97005
+; (503) 626-3081
+;
+; Version information :
+;
+; Version 1.0 - 1 June 1988 - Larry Westerman (smart_macros.h)
+;
+; Revision 1.4 89/02/01 18:26:03 jimh
+; Changed to relect the new symbols from Bob Perlman, and the new include file.s
+;
+; Revision 1.3 89/01/31 10:13:34 jimh
+; Updated to use symbols from Bob Perlmans fpsymbol.h file. This is
+; an extensive change.
+;
+; Revision 1.2 89/01/26 09:23:50 jimh
+; This version checked in previous to substituting Bob Perlman's floating
+; point symbols.
+;
+; Revision 1.1 89/01/24 13:23:29 jim
+; Initial revision
+; Replaces smart_macros.h ver 1.11.
+;
+;
+;
+;
+; NOTES:
+;
+; This package makes the following assumptions about the use of these
+; smart macros:
+;
+; 1. These macros will be after the entry code for a transcendental
+; routine. This entry code will move the original function arguments
+; (by value, if the target language is FORTRAN) into the global
+; registers t0/t1 and t2/t3 (t0 and t2 for single precision
+; routines).
+; 2. The sources of all operands will be one register from the
+; following list:
+; t0 or t2 - the source is one of the original input operands
+; rtn0 - the source is rtn0, which should be used as the
+; source for all constant values to be sent to the
+; AM29027 (when used)
+; FP0 - FP7 - the source is one of the fp registers
+; 3. The destination of all operations will be a register from the
+; following list:
+; rtn0 - the destination is the function return value
+; FP0 - FP7 - the destination is one of the fp registers
+; 4. The additional registers available for temporary use are
+; t4, lrp, and slp.
+;
+; These register definitions are all taken from the file "proregs.a"
+; which was supplied by AMD. NOTE that the FP0-FP7 registers, for the
+; Am29000 version of the file, overlap with the rtn0-rtn15 registers, so
+; that FP0 corresponds to rtn0/rtn1, FP1 to rtn2/rtn3, and so forth.
+;
+ .equ ERROR,0
+ .equ NO_ERROR,1
+
+ .equ DOUBLE_FUNCTION,0
+ .equ SINGLE_FUNCTION,1
+
+ .equ T_OPERATION,0
+ .equ Q_OPERATION,1
+
+ .equ R_SOURCE_29000,0
+ .equ R_SOURCE_29027,1
+
+ .equ S_SOURCE_29000,0
+ .equ S_SOURCE_29027,1
+
+ .equ DESTINATION_29000, 0
+ .equ DESTINATION_29027, 1
+
+;
+; SMART MACRO : mfadd
+;
+; FUNCTION : single-precision floating point addition
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mfadd,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mfadd: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_P_PLUS_T
+ .set OPERATION_TYPE, T_OPERATION
+ perform_single_operation destination,operand1,operand2
+ read_single_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ fadd destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfadd macro definition
+
+;
+; SMART MACRO : mfsub
+;
+; FUNCTION : single-precision floating point subtraction
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mfsub,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mfsub: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_P_MINUS_T
+ .set OPERATION_TYPE, T_OPERATION
+ perform_single_operation destination,operand1,operand2
+ read_single_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ fsub destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfsub macro definition
+
+;
+; SMART MACRO : mfmul
+;
+; FUNCTION : single-precision floating point multiplication
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mfmul,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mfmul: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_P_TIMES_Q
+ .set OPERATION_TYPE, Q_OPERATION
+ perform_single_operation destination,operand1,operand2
+ read_single_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ fmul destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfmul macro definition
+
+;
+; SMART MACRO : mfdiv
+;
+; FUNCTION : single-precision floating point divide
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mfdiv,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mfdiv: missing parameter(s)"
+ .exitm
+ .endif
+
+ ;
+ ; Generate the trap instruction in all cases
+ ;
+ fdiv destination, operand1, operand2
+
+ .endm ; end of mfdiv macro definition
+
+
+;
+; SMART MACRO : mdadd
+;
+; FUNCTION : double-precision floating point addition
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mdadd,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mdadd: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_P_PLUS_T
+ .set OPERATION_TYPE, T_OPERATION
+ perform_double_operation destination,operand1,operand2
+ read_double_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ dadd destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdadd macro definition
+
+;
+; SMART MACRO : mdsub
+;
+; FUNCTION : double-precision floating point subtraction
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mdsub,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mdsub: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_P_MINUS_T
+ .set OPERATION_TYPE, T_OPERATION
+ perform_double_operation destination,operand1,operand2
+ read_double_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ dsub destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdsub macro definition
+
+;
+; SMART MACRO : mdmul
+;
+; FUNCTION : double-precision floating point multiplication
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mdmul,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mdmul: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; For 29027 mode, perform full suite of checking
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_P_TIMES_Q
+ .set OPERATION_TYPE, Q_OPERATION
+ perform_double_operation destination,operand1,operand2
+ read_double_result destination
+ ;
+ ; Save the instruction for the next macro invocation
+ ;
+ .set PREVIOUS_INSTRUCTION, CURRENT_INSTRUCTION
+
+ .else
+ ;
+ ; For 29000 mode, simply produce equivalent trap-inducing instruction
+ ;
+ dmul destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdmul macro definition
+
+;
+; SMART MACRO : mddiv
+;
+; FUNCTION : double-precision floating point divide
+;
+; Required arguments : destination - one of possible destinations
+; operand1 - one of possible sources
+; operand2 - one of possible sources
+;
+ .macro mddiv,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "mddiv: missing parameter(s)"
+ .exitm
+ .endif
+
+ ;
+ ; Generate the trap instruction in all cases
+ ;
+ ddiv destination, operand1, operand2
+
+ .endm ; end of mfdiv macro definition
+
+;
+; SMART MACRO: mconvert
+;
+; FUNCTION: Floating point/integer conversion
+;
+; PARAMETERS: destination - one of the possible destinations
+; source - one of the possible sources
+; sign_flag - one of SIGNED or UNSIGNED
+; rounding_mode - one of ROUND_TO_NEAREST, ROUND_TO_PLUS,
+; ROUND_TO_MINUS, ROUND_TO_ZERO
+; destination_precision - one of FORMAT_INTEGER, FORMAT_DOUBLE,
+; or FORMAT_SINGLE
+; source_precision - one of FORMAT_INTEGER, FORMAT_DOUBLE,
+; or FORMAT_SINGLE
+;
+ .macro mconvert, destination, source, sign_flag, rounding_mode, destination_precision, source_precision
+
+ .if $narg!=6
+ .err
+ .print "mconvert: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .if ( destination_precision == FORMAT_INTEGER )
+ .set CURRENT_INSTRUCTION, CP_CONVERT_T_TO_INT
+ select_T_operand source
+ .if ( source_precision == FORMAT_DOUBLE )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_S_D
+ .else
+ .if ( source_precision == FORMAT_SINGLE )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_S_S
+ .else
+ .err
+ .print "mconvert: invalid source type"
+ .exitm
+ .endif
+ .endif
+ .else
+ .if ( destination_precision == FORMAT_DOUBLE )
+ .if ( source_precision == FORMAT_SINGLE )
+ .set CURRENT_INSTRUCTION, CP_PASS_P | CP_P_EQ_R | CP_D_S
+ select_P_operand source
+ .else
+ .if ( source_precision == FORMAT_INTEGER )
+ .set CURRENT_INSTRUCTION, CP_I_CONVERT_T_TO_FLOAT | CP_D_S
+ select_T_operand source
+ .else
+ .err
+ .print "mconvert: invalid source type"
+ .exitm
+ .endif
+ .endif
+ .else
+ .if ( destination_precision == FORMAT_SINGLE )
+ .if ( source_precision == FORMAT_DOUBLE )
+ .set CURRENT_INSTRUCTION, CP_PASS_P | CP_P_EQ_R | CP_S_D
+ select_P_operand source
+ .else
+ .if ( source_precision == FORMAT_INTEGER )
+ .set CURRENT_INSTRUCTION, CP_I_CONVERT_T_TO_FLOAT | CP_S_S
+ select_T_operand source
+ .else
+ .err
+ .print "mconvert: invalid source type"
+ .exitm
+ .endif
+ .endif
+ .else
+ .err
+ .print "mconvert: invalid destination type "
+ .exitm
+ .endif
+ .endif
+ .endif
+ ;
+ ; Perform the operation, using a 29027 dummy register as the second
+ ; source operand, to avoid writing any data inappropriately to the
+ ; 29027
+ ;
+ select_destination destination
+ .set S_SOURCE, S_SOURCE_29027
+ .if ( source_precision == FORMAT_DOUBLE )
+ write_and_execute_double_operation source, FP0
+ .else
+ write_and_execute_single_operation source, FP0
+ .endif
+ .if ( destination_precision == FORMAT_DOUBLE )
+ read_double_result destination
+ .else
+ .if ( destination_precision == FORMAT_SINGLE )
+ read_single_result destination
+ .else
+ read_integer_result destination
+ .endif
+ .endif
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ convert destination,source,sign_flag,rounding_mode,destination_precision,source_precision
+
+ .endif
+
+ .endm ; end of mfeq macro definition
+
+;
+; SMART MACRO: mfeq
+;
+; FUNCTION: Single precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mfeq, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mfeq: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compares - @destination@"
+ .exitm
+ .else
+ perform_single_operation destination, operand1, operand2
+ cp_read_flags destination
+ srl destination, destination, CP_EQUAL_FLAG_POSITION
+ sll destination, destination, 31
+ .endif
+
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ feq destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfeq macro definition
+
+;
+; SMART MACRO: mfge
+;
+; FUNCTION: Single precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mfge, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mfge: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compares - @destination@"
+ .exitm
+ .else
+ perform_single_operation destination, operand1, operand2
+ cp_read_flags destination
+ and destination, destination, CP_EQUAL_FLAG | CP_GREATER_THAN_FLAG
+ cpneq destination, destination, 0x0
+ .endif
+
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ fge destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfge macro definition
+
+;
+; SMART MACRO: mfgt
+;
+; FUNCTION: Single precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mfgt, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mfgt: missing parameter(s)"
+ .exitm
+ .endif
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_S_S | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compares - @destination@"
+ .exitm
+ .else
+ perform_single_operation destination, operand1, operand2
+ cp_read_flags destination
+ srl destination, destination, CP_GREATER_THAN_FLAG_POSITION
+ sll destination, destination, 31
+ .endif
+
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ fgt destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mfgt macro definition
+
+;
+; SMART MACRO: mdeq
+;
+; FUNCTION: Double precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mdeq, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mdeq: missing parameter(s)"
+ .exitm
+ .endif
+
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compare - @destination@"
+ .exitm
+ .else
+ perform_double_operation destination, operand1, operand2
+ cp_read_flags destination
+ srl destination, destination, CP_EQUAL_FLAG_POSITION
+ sll destination, destination, 31
+ .endif
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ deq destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdeq macro definition
+
+;
+; SMART MACRO: mdge
+;
+; FUNCTION: Double precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mdge, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mdge: missing parameter(s)"
+ .exitm
+ .endif
+
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compare - @destination@"
+ .exitm
+ .else
+ perform_double_operation destination, operand1, operand2
+ cp_read_flags destination
+ and destination, destination, CP_EQUAL_FLAG | CP_GREATER_THAN_FLAG
+ cpneq destination, destination, 0x0
+ .endif
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ dge destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdge macro definition
+
+;
+; SMART MACRO: mdgt
+;
+; FUNCTION: Double precision, floating point compare
+;
+; PARAMETERS: destination - one of the possible destinations
+; operand1 - one of the possible sources
+; operand2 - one of the possible sources
+;
+ .macro mdgt, destination, operand1, operand2
+
+ .if $narg!=3
+ .err
+ .print "mdgt: missing parameter(s)"
+ .exitm
+ .endif
+
+
+ .ifdef _29027_MODE
+ ;
+ ; Generate in line 29027 code
+ ;
+ initialize_previous_instruction
+ .set CURRENT_INSTRUCTION, CP_D_D | CP_COMPARE_P_AND_T
+ .set OPERATION_TYPE, T_OPERATION
+ select_destination destination
+ ;
+ ; 29027 registers are not valid destinations for compare operations
+ ; If the destination is a 29000 register, write the appropriate
+ ; Boolean value to that register.
+ ;
+ .if ( DESTINATION == DESTINATION_29027 )
+ .err
+ .print "29027 destinations invalid for compare - @destination@"
+ .exitm
+ .else
+ perform_double_operation destination, operand1, operand2
+ cp_read_flags destination
+ srl destination, destination, CP_GREATER_THAN_FLAG_POSITION
+ sll destination, destination, 31
+ .endif
+ .else
+ ;
+ ; For 29000 mode (the default) just invoke the trap-inducing instruction
+ ;
+ dgt destination,operand1,operand2
+
+ .endif
+
+ .endm ; end of mdgt macro definition
+
+;
+; MACRO NAME : perform_double_operation
+;
+; FUNCTION : After the instruction base is set up, do the appropriate checking
+; to send the instruction if necessary, send the double-precision
+; operands if necessary, and start the operation
+;
+; PARAMETERS : destination - one of possible destination operands
+; operand1 - one of possible source operands
+; operand2 - one of possible source operands
+;
+ .macro perform_double_operation,destination,operand1,operand2
+
+ .if $narg!=3
+ .err
+ .print "perform_double_operation: missing parameter(s)"
+ .exitm
+ .endif
+
+ ;
+ ; Start defining the instruction
+ ;
+ select_destination destination
+ select_P_operand operand1
+ select_S_operand operand2
+
+ write_and_execute_double_operation operand1, operand2
+
+ .endm ; End of perform_double_operation macro definition
+
+;
+; MACRO NAME : perform_single_operation
+;
+; FUNCTION : After the instruction base is set up, do the appropriate checking
+; to send the instruction if necessary, send the single-precision
+; operands if necessary and start the operation
+;
+; PARAMETERS : destination - one of possible destination operands
+; operand1 - one of possible source operands
+; operand2 - one of possible source operands
+;
+ .macro perform_single_operation,destination,operand1,operand2
+
+ ;
+ ; Start defining the instruction
+ ;
+ select_destination destination
+ select_P_operand operand1
+ select_S_operand operand2
+ write_and_execute_single_operation operand1,operand2
+
+ .endm ; End of perform_single_operation macro definition
+
+;
+; MACRO NAME : write_and_execute_double_operation
+;
+; FUNCTION : Write the instruction and operands for a double-precision
+; operation, and start the operation
+;
+; PARAMETER : operand1 - first operand of double-precision operation
+; operand2 - second operand of operation
+;
+ .macro write_and_execute_double_operation,operand1,operand2
+ .if ( ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29027 ) )
+ ;
+ ; If both sources are within the 29027, write the instruction
+ ; and start the operation
+ ;
+ const t4, CURRENT_INSTRUCTION
+ consth t4, CURRENT_INSTRUCTION
+ cp_write_inst t4, START
+ .else
+ ;
+ ; One or both of the sources must be written first, so check the
+ ; previous instruction
+ ;
+ const t4, CURRENT_INSTRUCTION
+ consth t4, CURRENT_INSTRUCTION
+ cp_write_inst t4
+ .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29027 )
+ .ifeqs "@operand1@","t0"
+ cp_write_r t0, t1, START
+ .else
+ .ifeqs "@operand1@","t2"
+ cp_write_r t2, t3, START
+ .else
+ .ifeqs "@operand1@","rtn0"
+ cp_write_r rtn0, rtn1, START
+ .else
+ .err
+ .print "Invalid source for double operation - @operand1@"
+ .exitm
+ .endif
+ .endif
+ .endif
+ .endif
+ .if ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29000 )
+ .ifeqs "@operand2@","t0"
+ cp_write_s t0, t1, START
+ .else
+ .ifeqs "@operand2@","t2"
+ cp_write_s t2, t3, START
+ .else
+ .ifeqs "@operand2@","rtn0"
+ cp_write_s rtn0, rtn1, START
+ .else
+ .err
+ .print "Invalid source for double operation - @operand1@"
+ .exitm
+ .endif
+ .endif
+ .endif
+ .endif
+ .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29000 )
+ .ifeqs "@operand1@","t0"
+ cp_write_r t0, t1
+ .else
+ .ifeqs "@operand1@","t2"
+ cp_write_r t2, t3
+ .else
+ .ifeqs "@operand1@","rtn0"
+ cp_write_r rtn0, rtn1
+ .else
+ .err
+ .print "Invalid source for double operation - @operand1@"
+ .exitm
+ .endif
+ .endif
+ .endif
+ .ifeqs "@operand2@","t0"
+ cp_write_s t0, t1, START
+ .else
+ .ifeqs "@operand2@","t2"
+ cp_write_s t2, t3, START
+ .else
+ .ifeqs "@operand2@","rtn0"
+ cp_write_s rtn0, rtn1, START
+ .else
+ .err
+ .print "Invalid source for double operation - @operand1@"
+ .exitm
+ .endif
+ .endif
+ .endif
+ .endif
+ .endif
+
+ .endm ; end of write_and_execute_double_operation macro definition
+
+;
+; MACRO NAME : write_and_execute_single_operation
+;
+; FUNCTION : If necessary, read the result from the 29027 into a
+; register on the 29000
+;
+; PARAMETER : operand1 - first source for single-precision operation
+; operand2 - second source for operation
+;
+ .macro write_and_execute_single_operation,operand1,operand2
+
+ .if ( ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29027 ) )
+ ;
+ ; If both sources are within the 29027, write the instruction
+ ; and start the operation
+ ;
+ const t4, CURRENT_INSTRUCTION
+ consth t4, CURRENT_INSTRUCTION
+ cp_write_inst t4, START
+ .else
+ ;
+ ; One or both of the sources must be written first, so check the
+ ; previous instruction
+ ;
+ const t4,CURRENT_INSTRUCTION
+ consth t4,CURRENT_INSTRUCTION
+ cp_write_inst t4, START
+ .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29027 )
+ cp_write_r operand1, operand1, START
+ .endif
+ .if ( R_SOURCE == R_SOURCE_29027 ) && ( S_SOURCE == S_SOURCE_29000 )
+ cp_write_s operand2, operand2, START
+ .endif
+ .if ( R_SOURCE == R_SOURCE_29000 ) && ( S_SOURCE == S_SOURCE_29000 )
+ cp_write_rs operand1, operand2, START
+ .endif
+ .endif
+
+ .endm ; End of write_and_execute_single_operation macro definition
+
+;
+; MACRO NAME : read_double_result
+;
+; FUNCTION : If necessary, read the result from the 29027 into a
+; register on the 29000
+;
+; PARAMETER : destination - one of the possible destination registers
+;
+ .macro read_double_result,destination
+ .if ( DESTINATION == DESTINATION_29000 )
+ ;
+ ; If the destination is not within the 29027 register file, read
+ ; the result and store it into the correct register in the 29000
+ ;
+ .ifeqs "@destination@","rtn0"
+ cp_read_dp rtn0, rtn1
+ .else
+ .err
+ .print "Invalid destination for double result - @destination@"
+ .exitm
+ .endif
+ .endif
+
+ .endm ; End of read_double_result macro definition
+
+;
+; MACRO NAME : read_single_result
+;
+; FUNCTION : If necessary, read the result from the 29027 into a
+; register on the 29000
+;
+; PARAMETER : destination
+;
+ .macro read_single_result,destination
+
+ .if ( DESTINATION == DESTINATION_29000 )
+ ;
+ ; If the destination is not within the 29027 register file, read
+ ; the result and store it into the correct register in the 29000
+ ;
+ .ifeqs "@destination@","rtn0"
+ cp_read_sp rtn0
+ .else
+ .err
+ .print "Invalid destination for single result - @destination@"
+ .exitm
+ .endif
+ .endif
+
+ .endm ; End of read_single_result macro definition
+
+;
+; MACRO NAME : read_integer_result
+;
+; FUNCTION : If necessary, read the result from the 29027 into a
+; register on the 29000
+;
+; PARAMETER : destination
+;
+ .macro read_integer_result,destination
+
+ .if ( DESTINATION == DESTINATION_29000 )
+ ;
+ ; If the destination is not within the 29027 register file, read
+ ; the result and store it into the correct register in the 29000
+ ;
+ .ifeqs "@destination@","rtn0"
+ cp_read_int rtn0
+ .else
+ .err
+ .print "Invalid destination for single result - @destination@"
+ .exitm
+ .endif
+ .endif
+
+ .endm ; End of read_integer_result macro definition
+
+;
+; MACRO NAME : select_P_operand
+;
+; FUNCTION : Given an operand, determine if the operand is from the
+; register file, and if so, set the appropriate bits in
+; the current instruction word. In addition, set the
+; variable R_SOURCE to 0 for local register file, or 1 for
+; floating-point register file.
+;
+; PARAMETER : operand1 - one of the possible source operands
+;
+ .macro select_P_operand,operand1
+ .ifeqs "@operand1@","t0"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","t2"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","rtn0"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP0"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF0
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP1"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF1
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP2"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF2
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP3"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF3
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP4"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF4
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP5"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF5
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP6"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF6
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP7"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_P_EQ_RF7
+ .exitm
+ .endif
+ .err
+ .print "@operand1@ - Invalid operand"
+
+ .endm ; end of select_P_operand macro definition
+
+;
+; MACRO NAME : select_S_operand
+;
+; FUNCTION : Given an operand, determine if the operand is from the
+; register file, and if so, set the appropriate bits in
+; the current instruction word. In addition, set the
+; variable S_SOURCE to S_SOURCE_29000 or S_SOURCE_29027
+; as appropriate
+;
+; PARAMETER : operand2 - one of the possible source operands
+;
+ .macro select_S_operand,operand2
+ .ifeqs "@operand2@","t0"
+ .set S_SOURCE,S_SOURCE_29000
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","t2"
+ .set S_SOURCE,S_SOURCE_29000
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","rtn0"
+ .set S_SOURCE,S_SOURCE_29000
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_S
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_S
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP0"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF0
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF0
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP1"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF1
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF1
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP2"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF2
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF2
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP3"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF3
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF3
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP4"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF4
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF4
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP5"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF5
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF5
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP6"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF6
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF6
+ .endif
+ .exitm
+ .endif
+ .ifeqs "@operand2@","FP7"
+ .set S_SOURCE,S_SOURCE_29027
+ .if ( OPERATION_TYPE == T_OPERATION )
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF7
+ .else
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_Q_EQ_RF7
+ .endif
+ .exitm
+ .endif
+ .err
+ .print "@operand2@ - Invalid operand"
+
+ .endm ; end of select_S_operand macro definition
+
+;
+; MACRO NAME : select_T_operand
+;
+; FUNCTION : Given an operand, determine if the operand is from the
+; register file, and if so, set the appropriate bits in
+; the current instruction word, to read the corresponding
+; source into the T operand. In addition, set the
+; variable R_SOURCE to 0 for local register file, or 1 for
+; floating-point register file.
+;
+; PARAMETER : operand1 - one of the possible source operands
+;
+ .macro select_T_operand,operand1
+ .ifeqs "@operand1@","t0"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","t2"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","rtn0"
+ .set R_SOURCE,R_SOURCE_29000
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_R
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP0"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF0
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP1"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF1
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP2"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF2
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP3"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF3
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP4"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF4
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP5"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF5
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP6"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF6
+ .exitm
+ .endif
+ .ifeqs "@operand1@","FP7"
+ .set R_SOURCE,R_SOURCE_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_T_EQ_RF7
+ .exitm
+ .endif
+ .err
+ .print "@operand1@ - Invalid operand"
+
+ .endm ; end of select_T_operand macro definition
+
+;
+; MACRO NAME : select_destination
+;
+; FUNCTION : Given a destination, determine if the operand is from the
+; register file, and if so, set the appropriate bits in
+; the current instruction word. In addition, set the
+; variable DESTINATION to DESTINATION_29000 or
+; DESTINATION_29027 as appropriate
+;
+; PARAMETER : destination - one of the possible destination operands
+;
+ .macro select_destination,destination
+ .ifeqs "@destination@","rtn0"
+ .set DESTINATION,DESTINATION_29000
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP0"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF0
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP1"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF1
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP2"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF2
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP3"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF3
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP4"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF4
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP5"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF5
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP6"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF6
+ .exitm
+ .endif
+ .ifeqs "@destination@","FP7"
+ .set DESTINATION,DESTINATION_29027
+ .set CURRENT_INSTRUCTION, CURRENT_INSTRUCTION | CP_DEST_EQ_RF7
+ .exitm
+ .endif
+ .err
+ .print "@destination@ - Invalid operand"
+
+ .endm ; end of select_destination macro definition
+
+; MACRO NAME : initialize_previous_instruction
+;
+; FUNCTION : Make sure the previous instruction is defined and set to zero
+;
+ .macro initialize_previous_instruction
+
+ .ifndef PREVIOUS_INSTRUCTION
+ ;
+ ; Make sure that the previous instruction variable is initialized
+ ;
+ .set PREVIOUS_INSTRUCTION,0
+ .endif
+
+ .endm ; end of initialize_previous_instruction macro definition
+
+
+; MACRO NAME : prepare_function_parameters
+;
+; FUNCTION : To place the input parameters into the correct position for
+; use by the function body. When the target language is
+; FORTRAN, the values of the input arguments are read from the
+; supplied addresses and moved to the t0-t3 temporary area.
+; When the target language is C or Pascal, the values of the
+; input arguments are simply moved to the t0-t3 temporary area.
+;
+ .macro prepare_function_parameters,arg1,arg2
+
+ .if $narg==0
+ .err
+ .print "Missing function argument(s)"
+ .exitm
+ .endif
+
+ .if $narg>2
+ .err
+ .print "Too many function arguments
+ .exitm
+ .endif
+
+ .if $narg>=1
+ .if $isreg(@arg1)
+ .ifdef FORTRAN
+ load 0,0,t0,arg1
+ .if ( FUNCTION_TYPE == DOUBLE_FUNCTION )
+ add t1,arg1,4
+ load 0,0,t1,t1
+ .endif
+ .else
+ add t0,arg1,0
+ .if ( FUNCTION_TYPE == DOUBLE_FUNCTION )
+ add t1,%%(&arg1+1),0
+ .endif
+ .endif
+ .else
+ .err
+ .print "Function argument not register - @arg1@"
+ .endif
+ .endif
+ .if $narg==2
+ .if $isreg (@arg2)
+ .ifdef FORTRAN
+ load 0,0,t2,arg2
+ .if ( FUNCTION_TYPE == DOUBLE_FUNCTION )
+ add t3,arg2,4
+ load 0,0,t3,t3
+ .endif
+ .else
+ add t2,arg2,0
+ .if ( FUNCTION_TYPE == DOUBLE_FUNCTION )
+ add t3,%%(&arg2+1),0
+ .endif
+ .endif
+ .else
+ .err
+ .print "Function argument not register - @arg2@"
+ .endif
+ .endif
+
+ .endm ; end of prepare_function_parameters macro definition
+
+; end of smartmac.h file
diff --git a/newlib/libc/sys/a29khif/sys/sysmac.h b/newlib/libc/sys/a29khif/sys/sysmac.h
new file mode 100644
index 000000000..01ff9eec2
--- /dev/null
+++ b/newlib/libc/sys/a29khif/sys/sysmac.h
@@ -0,0 +1,165 @@
+; @(#)sysmac.h 1.7 90/10/14 20:56:17, Copyright 1988, 1989, 1990 AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1988, 1989, 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; sysmac.h
+;
+ .include "sys/proreg.h"
+
+; Supported system call function numbers - BSD emulation
+
+ .equ BSD_exit, 1
+ .equ BSD_open, 5
+ .equ BSD_close, 6
+ .equ BSD_remove, 10
+ .equ BSD_lseek, 19
+ .equ BSD_sbrk, 69
+ .equ BSD_readv, 120
+ .equ BSD_writev, 121
+ .equ BSD_rename, 128
+; Functions above 0x100 are handled by Am29000 code
+ .equ BSD_alloc, 0x101
+ .equ BSD_free, 0x102
+ .equ BSD_getpagesize, 0x103
+
+ .equ BSD_clock, 0x111
+
+; Supported system call function numbers - HIF version 2.0
+
+ .equ HIF_exit, 0x01
+
+ .equ HIF_open, 0x11
+ .equ HIF_close, 0x12
+ .equ HIF_read, 0x13
+ .equ HIF_write, 0x14
+ .equ HIF_lseek, 0x15
+ .equ HIF_remove, 0x16
+ .equ HIF_rename, 0x17
+ .equ HIF_ioctl, 0x18
+ .equ HIF_iowait, 0x19
+ .equ HIF_iostat, 0x1a
+
+ .equ HIF_tmpnam, 0x21
+
+ .equ HIF_time, 0x31
+
+ .equ HIF_getenv, 0x41
+ .equ HIF_gettz, 0x43
+
+ .equ HIF_sysalloc, 0x101
+ .equ HIF_alloc, HIF_sysalloc ;Synonym.
+ .equ HIF_sysfree, 0x102
+ .equ HIF_free, HIF_sysfree ;Synonym.
+ .equ HIF_getpsize, 0x103
+ .equ HIF_getpagesize,HIF_getpsize ;Synonym.
+ .equ HIF_getargs, 0x104
+
+ .equ HIF_clock, 0x111
+ .equ HIF_cycles, 0x112
+
+ .equ HIF_setvec, 0x121
+ .equ HIF_settrap, 0x122
+ .equ HIF_setim, 0x123
+
+ .equ HIF_query, 0x131
+
+ .equ HIF_signal, 0x141
+ .equ HIF_sigdfl, 0x142
+ .equ HIF_sigret, 0x143
+ .equ HIF_sigrep, 0x144
+ .equ HIF_sigskp, 0x145
+ .equ HIF_sendsig, 0x146
+
+;Maintain compatibility with HIF 1.0 code.
+
+ .equ EPI_exit, HIF_exit
+
+ .equ EPI_open, HIF_open
+ .equ EPI_close, HIF_close
+ .equ EPI_read, HIF_read
+ .equ EPI_write, HIF_write
+ .equ EPI_lseek, HIF_lseek
+ .equ EPI_remove, HIF_remove
+ .equ EPI_rename, HIF_rename
+
+ .equ EPI_tmpnam, HIF_tmpnam
+
+ .equ EPI_time, HIF_time
+
+ .equ EPI_getenv, HIF_getenv
+ .equ EPI_gettz, HIF_gettz
+ .equ EPI_alloc, HIF_sysalloc
+ .equ EPI_free, HIF_sysfree
+ .equ EPI_getpagesize, HIF_getpsize
+ .equ EPI_getargs, HIF_getargs
+
+ .equ EPI_clock, HIF_clock
+ .equ EPI_cycles, HIF_cycles
+
+ .equ EPI_setvec, HIF_setvec
+
+ .equ V_SYSCALL, 69
+
+; System call macros
+/* Now that source files have been sed'd to avoid these macros, they
+ are just commented out. -- gnu@cygnus.com Oct 90
+
+ .ifdef _BSD_OS
+ .equ V_SYSCALL, 66
+ .else
+ .equ V_SYSCALL, 69
+ .endif
+
+ .macro syscall, name
+ .ifdef _BSD_OS
+ const tav, SYS_@name
+ .else
+ const tav, HIF_@name
+ .endif
+ asneq V_SYSCALL, gr1, gr1
+ .endm
+
+; error return
+; set errno to the error value in tav.
+; return -1
+;
+ .macro returnerr
+;; .extern _errno ; rather have undef'd sym than multiple def's
+ const tpc, _errno
+ consth tpc, _errno
+ store 0, 0, tav, tpc
+ jmpi lr0
+ constn v0, -1
+ .endm
+
+; package the most common case in one macro
+;
+ .macro system, name
+ syscall name
+ jmpti tav, lr0
+ returnerr
+ .endm
+ */
diff --git a/newlib/libc/sys/a29khif/systime.s b/newlib/libc/sys/a29khif/systime.s
new file mode 100644
index 000000000..95b193360
--- /dev/null
+++ b/newlib/libc/sys/a29khif/systime.s
@@ -0,0 +1,44 @@
+; @(#)systime.s 1.2 90/10/14 21:57:59, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; _time.s
+; time_t secs = time( time_t *secs );
+;
+; NOTE - Will not work on BSD (no time sys call)
+;
+ .file "systime.s"
+ .include "sys/sysmac.h"
+ .text
+ .word 0x00030000 ; Debugger tag word
+ .global _time
+_time:
+ const tav,HIF_time @ asneq V_SYSCALL,gr1,gr1
+ cpeq gr97, lr2, 0
+ jmpti gr97, lr0
+ nop
+ jmpi lr0
+ store 0, 0, gr96, lr2
+ .end
diff --git a/newlib/libc/sys/a29khif/vec.s b/newlib/libc/sys/a29khif/vec.s
new file mode 100644
index 000000000..5a7083a3c
--- /dev/null
+++ b/newlib/libc/sys/a29khif/vec.s
@@ -0,0 +1,35 @@
+; @(#)vec.s 1.2 90/10/14 21:58:01, AMD
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 1990 Advanced Micro Devices, Inc.
+;
+; This software is the property of Advanced Micro Devices, Inc (AMD) which
+; specifically grants the user the right to modify, use and distribute this
+; software provided this notice is not removed or altered. All other rights
+; are reserved by AMD.
+;
+; AMD MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS
+; SOFTWARE. IN NO EVENT SHALL AMD BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL
+; DAMAGES IN CONNECTION WITH OR ARISING FROM THE FURNISHING, PERFORMANCE, OR
+; USE OF THIS SOFTWARE.
+;
+; So that all may benefit from your experience, please report any problems
+; or suggestions about this software to the 29K Technical Support Center at
+; 800-29-29-AMD (800-292-9263) in the USA, or 0800-89-1131 in the UK, or
+; 0031-11-1129 in Japan, toll free. The direct dial number is 512-462-4118.
+;
+; Advanced Micro Devices, Inc.
+; 29K Support Products
+; Mail Stop 573
+; 5900 E. Ben White Blvd.
+; Austin, TX 78741
+; 800-292-9263
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ .global V_SPILL, V_FILL
+ .global V_EPI_OS, V_BSD_OS
+
+ .equ V_SPILL, 64
+ .equ V_FILL, 65
+
+ .equ V_BSD_OS, 66
+ .equ V_EPI_OS, 69
+ .end