Copy code from target sh to sh3eb
This commit is contained in:
parent
b64c66c8b6
commit
ff76b3b326
|
@ -0,0 +1,28 @@
|
|||
## Process this file with automake to generate Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
|
||||
AM_CCASFLAGS = $(INCLUDES)
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
|
||||
if SH64
|
||||
lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strlen.S strcmp.S strncpy.S
|
||||
else
|
||||
lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strlen.S strcmp.S
|
||||
endif
|
||||
|
||||
lib_a_CCASFLAGS=$(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS=$(AM_CFLAGS)
|
||||
|
||||
$(lpfx)memcpy.o: asm.h
|
||||
$(lpfx)memset.o: asm.h
|
||||
$(lpfx)setjmp.o: asm.h
|
||||
$(lpfx)strcpy.o: asm.h
|
||||
$(lpfx)strcmp.o: asm.h
|
||||
$(lpfx)strncpy.o: asm.h
|
||||
|
||||
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
|
||||
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
|
|
@ -0,0 +1,498 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(srcdir)/../../../../mkinstalldirs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
lib_a_AR = $(AR) $(ARFLAGS)
|
||||
lib_a_LIBADD =
|
||||
@SH64_FALSE@am_lib_a_OBJECTS = lib_a-memcpy.$(OBJEXT) \
|
||||
@SH64_FALSE@ lib_a-memset.$(OBJEXT) lib_a-setjmp.$(OBJEXT) \
|
||||
@SH64_FALSE@ lib_a-strcpy.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
|
||||
@SH64_FALSE@ lib_a-strcmp.$(OBJEXT)
|
||||
@SH64_TRUE@am_lib_a_OBJECTS = lib_a-memcpy.$(OBJEXT) \
|
||||
@SH64_TRUE@ lib_a-memset.$(OBJEXT) lib_a-setjmp.$(OBJEXT) \
|
||||
@SH64_TRUE@ lib_a-strcpy.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
|
||||
@SH64_TRUE@ lib_a-strcmp.$(OBJEXT) lib_a-strncpy.$(OBJEXT)
|
||||
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(lib_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
|
||||
NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
READELF = @READELF@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
aext = @aext@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libm_machine_dir = @libm_machine_dir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lpfx = @lpfx@
|
||||
machine_dir = @machine_dir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
newlib_basedir = @newlib_basedir@
|
||||
oext = @oext@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sys_dir = @sys_dir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
AM_CCASFLAGS = $(INCLUDES)
|
||||
noinst_LIBRARIES = lib.a
|
||||
@SH64_FALSE@lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strlen.S strcmp.S
|
||||
@SH64_TRUE@lib_a_SOURCES = memcpy.S memset.S setjmp.S strcpy.S strlen.S strcmp.S strncpy.S
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
|
||||
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .o .obj
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --cygnus Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
|
||||
-rm -f lib.a
|
||||
$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
|
||||
$(RANLIB) lib.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
.S.o:
|
||||
$(CPPASCOMPILE) -c -o $@ $<
|
||||
|
||||
.S.obj:
|
||||
$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
lib_a-memcpy.o: memcpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.o `test -f 'memcpy.S' || echo '$(srcdir)/'`memcpy.S
|
||||
|
||||
lib_a-memcpy.obj: memcpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.S'; then $(CYGPATH_W) 'memcpy.S'; else $(CYGPATH_W) '$(srcdir)/memcpy.S'; fi`
|
||||
|
||||
lib_a-memset.o: memset.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.o `test -f 'memset.S' || echo '$(srcdir)/'`memset.S
|
||||
|
||||
lib_a-memset.obj: memset.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.S'; then $(CYGPATH_W) 'memset.S'; else $(CYGPATH_W) '$(srcdir)/memset.S'; fi`
|
||||
|
||||
lib_a-setjmp.o: setjmp.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '$(srcdir)/'`setjmp.S
|
||||
|
||||
lib_a-setjmp.obj: setjmp.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
|
||||
|
||||
lib_a-strcpy.o: strcpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcpy.o `test -f 'strcpy.S' || echo '$(srcdir)/'`strcpy.S
|
||||
|
||||
lib_a-strcpy.obj: strcpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcpy.obj `if test -f 'strcpy.S'; then $(CYGPATH_W) 'strcpy.S'; else $(CYGPATH_W) '$(srcdir)/strcpy.S'; fi`
|
||||
|
||||
lib_a-strlen.o: strlen.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.o `test -f 'strlen.S' || echo '$(srcdir)/'`strlen.S
|
||||
|
||||
lib_a-strlen.obj: strlen.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.obj `if test -f 'strlen.S'; then $(CYGPATH_W) 'strlen.S'; else $(CYGPATH_W) '$(srcdir)/strlen.S'; fi`
|
||||
|
||||
lib_a-strcmp.o: strcmp.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.o `test -f 'strcmp.S' || echo '$(srcdir)/'`strcmp.S
|
||||
|
||||
lib_a-strcmp.obj: strcmp.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.obj `if test -f 'strcmp.S'; then $(CYGPATH_W) 'strcmp.S'; else $(CYGPATH_W) '$(srcdir)/strcmp.S'; fi`
|
||||
|
||||
lib_a-strncpy.o: strncpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strncpy.o `test -f 'strncpy.S' || echo '$(srcdir)/'`strncpy.S
|
||||
|
||||
lib_a-strncpy.obj: strncpy.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strncpy.obj `if test -f 'strncpy.S'; then $(CYGPATH_W) 'strncpy.S'; else $(CYGPATH_W) '$(srcdir)/strncpy.S'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
check-am:
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
|
||||
clean-generic clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-tags dvi dvi-am \
|
||||
html html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
$(lpfx)memcpy.o: asm.h
|
||||
$(lpfx)memset.o: asm.h
|
||||
$(lpfx)setjmp.o: asm.h
|
||||
$(lpfx)strcpy.o: asm.h
|
||||
$(lpfx)strcmp.o: asm.h
|
||||
$(lpfx)strncpy.o: asm.h
|
||||
|
||||
# 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:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,42 @@
|
|||
#ifdef __STDC__
|
||||
# define _C_LABEL(x) _ ## x
|
||||
#else
|
||||
# define _C_LABEL(x) _/**/x
|
||||
#endif
|
||||
#define _ASM_LABEL(x) x
|
||||
|
||||
#if __SH5__
|
||||
# if __SH5__ == 32 && __SHMEDIA__
|
||||
# define TEXT .section .text..SHmedia32, "ax"
|
||||
# else
|
||||
# define TEXT .text
|
||||
# endif
|
||||
|
||||
# define _ENTRY(name) \
|
||||
TEXT; .balign 8; .globl name; name:
|
||||
#else
|
||||
#define _ENTRY(name) \
|
||||
.text; .align 2; .globl name; name:
|
||||
#endif /* __SH5__ */
|
||||
|
||||
#define ENTRY(name) \
|
||||
_ENTRY(_C_LABEL(name))
|
||||
|
||||
#if (defined (__sh2__) || defined (__SH2E__) || defined (__sh3__) || defined (__SH3E__) \
|
||||
|| defined (__SH4_SINGLE__) || defined (__SH4__)) \
|
||||
|| defined (__SH4_SINGLE_ONLY__) || defined (__SH5__) || defined (__SH2A__)
|
||||
#define DELAYED_BRANCHES
|
||||
#define SL(branch, dest, in_slot, in_slot_arg2) \
|
||||
branch##.s dest; in_slot, in_slot_arg2
|
||||
#else
|
||||
#define SL(branch, dest, in_slot, in_slot_arg2) \
|
||||
in_slot, in_slot_arg2; branch dest
|
||||
#endif
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define SHHI shlld
|
||||
#define SHLO shlrd
|
||||
#else
|
||||
#define SHHI shlrd
|
||||
#define SHLO shlld
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,23 @@
|
|||
dnl This is the newlib/libc/machine/sh configure.in file.
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([newlib],[NEWLIB_VERSION])
|
||||
AC_CONFIG_SRCDIR([asm.h])
|
||||
|
||||
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
|
||||
AC_CONFIG_AUX_DIR(../../../..)
|
||||
|
||||
AC_NO_EXECUTABLES
|
||||
|
||||
NEWLIB_CONFIGURE(../../..)
|
||||
|
||||
AC_EGREP_CPP([sh5], [
|
||||
#if __SH5__
|
||||
sh5
|
||||
#endif
|
||||
], [have_sh64=yes], [have_sh64=no])
|
||||
AM_CONDITIONAL(SH64, [test $have_sh64 = yes])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
|
@ -0,0 +1,395 @@
|
|||
!
|
||||
! Fast SH memcpy
|
||||
!
|
||||
! by Toshiyasu Morita (tm@netcom.com)
|
||||
! hacked by J"orn Rernnecke (joern.rennecke@superh.com) ("o for o-umlaut)
|
||||
! SH5 code Copyright 2002 SuperH Ltd.
|
||||
!
|
||||
! Entry: ARG0: destination pointer
|
||||
! ARG1: source pointer
|
||||
! ARG3: byte count
|
||||
!
|
||||
! Exit: RESULT: destination pointer
|
||||
! any other registers in the range r0-r7: trashed
|
||||
!
|
||||
! Notes: Usually one wants to do small reads and write a longword, but
|
||||
! unfortunately it is difficult in some cases to concatanate bytes
|
||||
! into a longword on the SH, so this does a longword read and small
|
||||
! writes.
|
||||
!
|
||||
! This implementation makes two assumptions about how it is called:
|
||||
!
|
||||
! 1.: If the byte count is nonzero, the address of the last byte to be
|
||||
! copied is unsigned greater than the address of the first byte to
|
||||
! be copied. This could be easily swapped for a signed comparison,
|
||||
! but the algorithm used needs some comparison.
|
||||
!
|
||||
! 2.: When there are two or three bytes in the last word of an 11-or-more
|
||||
! bytes memory chunk to b copied, the rest of the word can be read
|
||||
! without side effects.
|
||||
! This could be easily changed by increasing the minumum size of
|
||||
! a fast memcpy and the amount subtracted from r7 before L_2l_loop be 2,
|
||||
! however, this would cost a few extra cyles on average.
|
||||
! For SHmedia, the assumption is that any quadword can be read in its
|
||||
! enirety if at least one byte is included in the copy.
|
||||
!
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(memcpy)
|
||||
|
||||
#if __SHMEDIA__
|
||||
|
||||
#define LDUAQ(P,O,D0,D1) ldlo.q P,O,D0; ldhi.q P,O+7,D1
|
||||
#define STUAQ(P,O,D0,D1) stlo.q P,O,D0; sthi.q P,O+7,D1
|
||||
#define LDUAL(P,O,D0,D1) ldlo.l P,O,D0; ldhi.l P,O+3,D1
|
||||
#define STUAL(P,O,D0,D1) stlo.l P,O,D0; sthi.l P,O+3,D1
|
||||
|
||||
ld.b r3,0,r63
|
||||
pta/l Large,tr0
|
||||
movi 25,r0
|
||||
bgeu/u r4,r0,tr0
|
||||
nsb r4,r0
|
||||
shlli r0,5,r0
|
||||
movi (L1-L0+63*32 + 1) & 0xffff,r1
|
||||
sub r1, r0, r0
|
||||
L0: ptrel r0,tr0
|
||||
add r2,r4,r5
|
||||
ptabs r18,tr1
|
||||
add r3,r4,r6
|
||||
blink tr0,r63
|
||||
|
||||
.balign 8
|
||||
L1:
|
||||
/* 0 byte memcpy */
|
||||
blink tr1,r63
|
||||
|
||||
L4_7: /* 4..7 byte memcpy cntd. */
|
||||
stlo.l r2, 0, r0
|
||||
or r6, r7, r6
|
||||
sthi.l r5, -1, r6
|
||||
stlo.l r5, -4, r6
|
||||
blink tr1,r63
|
||||
|
||||
L2_3: /* 2 or 3 byte memcpy cntd. */
|
||||
st.b r5,-1,r6
|
||||
blink tr1,r63
|
||||
|
||||
/* 1 byte memcpy */
|
||||
ld.b r3,0,r0
|
||||
st.b r2,0,r0
|
||||
blink tr1,r63
|
||||
|
||||
L8_15: /* 8..15 byte memcpy cntd. */
|
||||
stlo.q r2, 0, r0
|
||||
or r6, r7, r6
|
||||
sthi.q r5, -1, r6
|
||||
stlo.q r5, -8, r6
|
||||
blink tr1,r63
|
||||
|
||||
/* 2 or 3 byte memcpy */
|
||||
ld.b r3,0,r0
|
||||
ld.b r2,0,r63
|
||||
ld.b r3,1,r1
|
||||
st.b r2,0,r0
|
||||
pta/l L2_3,tr0
|
||||
ld.b r6,-1,r6
|
||||
st.b r2,1,r1
|
||||
blink tr0, r63
|
||||
|
||||
/* 4 .. 7 byte memcpy */
|
||||
LDUAL (r3, 0, r0, r1)
|
||||
pta L4_7, tr0
|
||||
ldlo.l r6, -4, r7
|
||||
or r0, r1, r0
|
||||
sthi.l r2, 3, r0
|
||||
ldhi.l r6, -1, r6
|
||||
blink tr0, r63
|
||||
|
||||
/* 8 .. 15 byte memcpy */
|
||||
LDUAQ (r3, 0, r0, r1)
|
||||
pta L8_15, tr0
|
||||
ldlo.q r6, -8, r7
|
||||
or r0, r1, r0
|
||||
sthi.q r2, 7, r0
|
||||
ldhi.q r6, -1, r6
|
||||
blink tr0, r63
|
||||
|
||||
/* 16 .. 24 byte memcpy */
|
||||
LDUAQ (r3, 0, r0, r1)
|
||||
LDUAQ (r3, 8, r8, r9)
|
||||
or r0, r1, r0
|
||||
sthi.q r2, 7, r0
|
||||
or r8, r9, r8
|
||||
sthi.q r2, 15, r8
|
||||
ldlo.q r6, -8, r7
|
||||
ldhi.q r6, -1, r6
|
||||
stlo.q r2, 8, r8
|
||||
stlo.q r2, 0, r0
|
||||
or r6, r7, r6
|
||||
sthi.q r5, -1, r6
|
||||
stlo.q r5, -8, r6
|
||||
blink tr1,r63
|
||||
|
||||
Large:
|
||||
ld.b r2, 0, r63
|
||||
pta/l Loop_ua, tr1
|
||||
ori r3, -8, r7
|
||||
sub r2, r7, r22
|
||||
sub r3, r2, r6
|
||||
add r2, r4, r5
|
||||
ldlo.q r3, 0, r0
|
||||
addi r5, -16, r5
|
||||
movi 64+8, r27 // could subtract r7 from that.
|
||||
stlo.q r2, 0, r0
|
||||
sthi.q r2, 7, r0
|
||||
ldx.q r22, r6, r0
|
||||
bgtu/l r27, r4, tr1
|
||||
|
||||
addi r5, -48, r27
|
||||
pta/l Loop_line, tr0
|
||||
addi r6, 64, r36
|
||||
addi r6, -24, r19
|
||||
addi r6, -16, r20
|
||||
addi r6, -8, r21
|
||||
|
||||
Loop_line:
|
||||
ldx.q r22, r36, r63
|
||||
alloco r22, 32
|
||||
addi r22, 32, r22
|
||||
ldx.q r22, r19, r23
|
||||
sthi.q r22, -25, r0
|
||||
ldx.q r22, r20, r24
|
||||
ldx.q r22, r21, r25
|
||||
stlo.q r22, -32, r0
|
||||
ldx.q r22, r6, r0
|
||||
sthi.q r22, -17, r23
|
||||
sthi.q r22, -9, r24
|
||||
sthi.q r22, -1, r25
|
||||
stlo.q r22, -24, r23
|
||||
stlo.q r22, -16, r24
|
||||
stlo.q r22, -8, r25
|
||||
bgeu r27, r22, tr0
|
||||
|
||||
Loop_ua:
|
||||
addi r22, 8, r22
|
||||
sthi.q r22, -1, r0
|
||||
stlo.q r22, -8, r0
|
||||
ldx.q r22, r6, r0
|
||||
bgtu/l r5, r22, tr1
|
||||
|
||||
add r3, r4, r7
|
||||
ldlo.q r7, -8, r1
|
||||
sthi.q r22, 7, r0
|
||||
ldhi.q r7, -1, r7
|
||||
ptabs r18,tr1
|
||||
stlo.q r22, 0, r0
|
||||
or r1, r7, r1
|
||||
sthi.q r5, 15, r1
|
||||
stlo.q r5, 8, r1
|
||||
blink tr1, r63
|
||||
|
||||
#else /* ! SHMEDIA, i.e. SH1 .. SH4 / SHcompact */
|
||||
|
||||
#ifdef __SH5__
|
||||
#define DST r2
|
||||
#define SRC r3
|
||||
#define COUNT r4
|
||||
#define TMP0 r5
|
||||
#define TMP1 r6
|
||||
#define RESULT r2
|
||||
#else
|
||||
#define DST r4
|
||||
#define SRC r5
|
||||
#define COUNT r6
|
||||
#define TMP0 r2
|
||||
#define TMP1 r3
|
||||
#define RESULT r0
|
||||
#endif
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
! Little endian version copies with increasing addresses.
|
||||
mov DST,TMP1 ! Save return value
|
||||
mov #11,r0 ! Check if small number of bytes
|
||||
cmp/hs r0,COUNT
|
||||
! COUNT becomes src end address
|
||||
SL(bf, L_small, add SRC,COUNT)
|
||||
mov #1,r1
|
||||
tst r1,SRC ! check if source even
|
||||
SL(bt, L_even, mov COUNT,r7)
|
||||
mov.b @SRC+,r0 ! no, make it even.
|
||||
mov.b r0,@DST
|
||||
add #1,DST
|
||||
L_even: tst r1,DST ! check if destination is even
|
||||
add #-3,r7
|
||||
SL(bf, L_odddst, mov #2,r1)
|
||||
tst r1,DST ! check if destination is 4-byte aligned
|
||||
mov DST,r0
|
||||
SL(bt, L_al4dst, sub SRC,r0)
|
||||
mov.w @SRC+,TMP0
|
||||
mov.w TMP0,@DST
|
||||
! add #2,DST DST is dead here.
|
||||
L_al4dst:
|
||||
tst r1,SRC
|
||||
bt L_al4both
|
||||
mov.w @SRC+,r1
|
||||
swap.w r1,r1
|
||||
add #-6,r0
|
||||
add #-6,r7 ! r7 := src end address minus 9.
|
||||
.align 2
|
||||
L_2l_loop:
|
||||
mov.l @SRC+,TMP0 ! Read & write two longwords per iteration
|
||||
xtrct TMP0,r1
|
||||
mov.l r1,@(r0,SRC)
|
||||
cmp/hs r7,SRC
|
||||
mov.l @SRC+,r1
|
||||
xtrct r1,TMP0
|
||||
mov.l TMP0,@(r0,SRC)
|
||||
bf L_2l_loop
|
||||
add #-2,SRC
|
||||
bra L_cleanup
|
||||
add #5,r0
|
||||
L_al4both:
|
||||
add #-4,r0
|
||||
.align 2
|
||||
L_al4both_loop:
|
||||
mov.l @SRC+,DST ! Read longword, write longword per iteration
|
||||
cmp/hs r7,SRC
|
||||
SL(bf, L_al4both_loop, mov.l DST,@(r0,SRC))
|
||||
|
||||
bra L_cleanup
|
||||
add #3,r0
|
||||
|
||||
L_odddst:
|
||||
tst r1,SRC
|
||||
SL(bt, L_al4src, add #-1,DST)
|
||||
mov.w @SRC+,r0
|
||||
mov.b r0,@(1,DST)
|
||||
shlr8 r0
|
||||
mov.b r0,@(2,DST)
|
||||
add #2,DST
|
||||
L_al4src:
|
||||
.align 2
|
||||
L_odd_loop:
|
||||
mov.l @SRC+,r0 ! Read longword, write byte, word, byte per iteration
|
||||
cmp/hs r7,SRC
|
||||
mov.b r0,@(1,DST)
|
||||
shlr8 r0
|
||||
mov.w r0,@(2,DST)
|
||||
shlr16 r0
|
||||
mov.b r0,@(4,DST)
|
||||
SL(bf, L_odd_loop, add #4,DST)
|
||||
.align 2 ! avoid nop in more frequently executed code.
|
||||
L_cleanup2:
|
||||
mov DST,r0
|
||||
sub SRC,r0
|
||||
L_cleanup:
|
||||
cmp/eq COUNT,SRC
|
||||
bt L_ready
|
||||
.align 2
|
||||
L_cleanup_loop:
|
||||
mov.b @SRC+,r1
|
||||
cmp/eq COUNT,SRC
|
||||
mov.b r1,@(r0,SRC)
|
||||
bf L_cleanup_loop
|
||||
L_ready:
|
||||
rts
|
||||
mov TMP1,RESULT
|
||||
L_small:
|
||||
bra L_cleanup2
|
||||
add #-1,DST
|
||||
#else /* ! __LITTLE_ENDIAN__ */
|
||||
! Big endian version copies with decreasing addresses.
|
||||
mov DST,r0
|
||||
add COUNT,r0
|
||||
sub DST,SRC
|
||||
mov #11,r1
|
||||
cmp/hs r1,COUNT
|
||||
SL(bf, L_small, add #-1,SRC)
|
||||
mov SRC,TMP1
|
||||
add r0,TMP1
|
||||
shlr TMP1
|
||||
SL(bt, L_even,
|
||||
mov DST,r7)
|
||||
mov.b @(r0,SRC),TMP0
|
||||
add #-1,TMP1
|
||||
mov.b TMP0,@-r0
|
||||
L_even:
|
||||
tst #1,r0
|
||||
add #-1,SRC
|
||||
SL(bf, L_odddst, add #8,r7)
|
||||
tst #2,r0
|
||||
bt L_al4dst
|
||||
add #-1,TMP1
|
||||
mov.w @(r0,SRC),r1
|
||||
mov.w r1,@-r0
|
||||
L_al4dst:
|
||||
shlr TMP1
|
||||
bt L_al4both
|
||||
mov.w @(r0,SRC),r1
|
||||
swap.w r1,r1
|
||||
add #4,r7
|
||||
add #-4,SRC
|
||||
.align 2
|
||||
L_2l_loop:
|
||||
mov.l @(r0,SRC),TMP0
|
||||
xtrct TMP0,r1
|
||||
mov.l r1,@-r0
|
||||
cmp/hs r7,r0
|
||||
mov.l @(r0,SRC),r1
|
||||
xtrct r1,TMP0
|
||||
mov.l TMP0,@-r0
|
||||
bt L_2l_loop
|
||||
bra L_cleanup
|
||||
add #5,SRC
|
||||
|
||||
nop ! avoid nop in executed code.
|
||||
L_al4both:
|
||||
add #-2,SRC
|
||||
.align 2
|
||||
L_al4both_loop:
|
||||
mov.l @(r0,SRC),r1
|
||||
cmp/hs r7,r0
|
||||
SL(bt, L_al4both_loop,
|
||||
mov.l r1,@-r0)
|
||||
bra L_cleanup
|
||||
add #3,SRC
|
||||
|
||||
nop ! avoid nop in executed code.
|
||||
L_odddst:
|
||||
shlr TMP1
|
||||
bt L_al4src
|
||||
mov.w @(r0,SRC),r1
|
||||
mov.b r1,@-r0
|
||||
shlr8 r1
|
||||
mov.b r1,@-r0
|
||||
L_al4src:
|
||||
add #-2,SRC
|
||||
.align 2
|
||||
L_odd_loop:
|
||||
mov.l @(r0,SRC),TMP0
|
||||
cmp/hs r7,r0
|
||||
mov.b TMP0,@-r0
|
||||
shlr8 TMP0
|
||||
mov.w TMP0,@-r0
|
||||
shlr16 TMP0
|
||||
mov.b TMP0,@-r0
|
||||
bt L_odd_loop
|
||||
|
||||
add #3,SRC
|
||||
L_cleanup:
|
||||
L_small:
|
||||
cmp/eq DST,r0
|
||||
bt L_ready
|
||||
add #1,DST
|
||||
.align 2
|
||||
L_cleanup_loop:
|
||||
mov.b @(r0,SRC),TMP0
|
||||
cmp/eq DST,r0
|
||||
mov.b TMP0,@-r0
|
||||
bf L_cleanup_loop
|
||||
L_ready:
|
||||
rts
|
||||
mov r0,RESULT
|
||||
#endif /* ! __LITTLE_ENDIAN__ */
|
||||
#endif /* ! SHMEDIA */
|
|
@ -0,0 +1,164 @@
|
|||
!
|
||||
! Fast SH memset
|
||||
!
|
||||
! by Toshiyasu Morita (tm@netcom.com)
|
||||
!
|
||||
! SH5 code by J"orn Rennecke (joern.rennecke@superh.com)
|
||||
! Copyright 2002 SuperH Ltd.
|
||||
!
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(memset)
|
||||
#if __SHMEDIA__
|
||||
pta/l multiquad, tr0
|
||||
ptabs r18, tr2
|
||||
|
||||
andi r2, -8, r25
|
||||
add r2, r4, r5
|
||||
addi r5, -1, r20 // calculate end address.
|
||||
andi r20, -8, r20
|
||||
cmveq r4, r25, r20
|
||||
bne/u r25, r20, tr0 // multiquad
|
||||
|
||||
! This sequence could clobber volatile objects that are in the same
|
||||
! quadword as a very short char array.
|
||||
! ldlo.q r2, 0, r7
|
||||
! shlli r4, 2, r4
|
||||
! movi -1, r8
|
||||
! SHHI r8, r4, r8
|
||||
! SHHI r8, r4, r8
|
||||
! mcmv r7, r8, r3
|
||||
! stlo.q r2, 0, r3
|
||||
|
||||
pta/l setlongs, tr0
|
||||
movi 4, r8
|
||||
bgeu/u r4, r8, tr0
|
||||
pta/l endset, tr0
|
||||
beqi/u r4, 0, tr0
|
||||
st.b r2, 0, r3
|
||||
beqi/u r4, 1, tr0
|
||||
nop
|
||||
st.b r2, 1, r3
|
||||
beqi/l r4, 2, tr0
|
||||
st.b r2,2,r3
|
||||
endset: blink tr2, r63
|
||||
setlongs:
|
||||
mshflo.b r3, r3, r3
|
||||
mperm.w r3, r63, r3 // Fill pattern now in every byte of r3
|
||||
stlo.l r2, 0, r3
|
||||
nop
|
||||
nop
|
||||
sthi.l r5, -1, r3
|
||||
blink tr2, r63
|
||||
|
||||
multiquad:
|
||||
mshflo.b r3, r3, r3
|
||||
mperm.w r3, r63, r3 // Fill pattern now in every byte of r3
|
||||
pta/l lastquad, tr0
|
||||
stlo.q r2, 0, r3
|
||||
sub r20, r25, r24
|
||||
movi 64, r9
|
||||
beqi/u r24, 8, tr0 // lastquad
|
||||
pta/l loop, tr1
|
||||
addi r20, -7*8, r8 // loop end address; This might overflow, so we need
|
||||
// to use a different test before we start the loop
|
||||
bgeu/u r24, r9, tr1// loop
|
||||
st.q r25, 8, r3
|
||||
shlri r24, 4, r24
|
||||
st.q r20, -8, r3
|
||||
beqi/u r24, 1, tr0 // lastquad
|
||||
st.q r25, 16, r3
|
||||
st.q r20, -16, r3
|
||||
beqi/u r24, 2, tr0 // lastquad
|
||||
st.q r25, 24, r3
|
||||
st.q r20, -24, r3
|
||||
lastquad:
|
||||
sthi.q r5, -1, r3
|
||||
blink tr2,r63
|
||||
|
||||
loop:
|
||||
alloco r25, 32
|
||||
st.q r25, 8, r3
|
||||
st.q r25, 16, r3
|
||||
st.q r25, 24, r3
|
||||
st.q r25, 32, r3
|
||||
addi r25, 32, r25
|
||||
bgeu/l r8, r25, tr1 // loop
|
||||
|
||||
st.q r20, -40, r3
|
||||
st.q r20, -32, r3
|
||||
st.q r20, -24, r3
|
||||
st.q r20, -16, r3
|
||||
st.q r20, -8, r3
|
||||
sthi.q r5, -1, r3
|
||||
blink tr2,r63
|
||||
#else /* ! SHMEDIA, i.e. SH1 .. SH4 / SHcompact */
|
||||
! Entry: r4: destination pointer
|
||||
! r5: fill value
|
||||
! r6: byte count
|
||||
!
|
||||
! Exit: r0-r3: trashed
|
||||
!
|
||||
|
||||
! This assumes that the first four bytes of the address space (0..3) are
|
||||
! reserved - usually by the linker script. Otherwise, we would had to check
|
||||
! for the case of objects of the size 12..15 at address 0..3 .
|
||||
|
||||
#ifdef __SH5__
|
||||
#define DST r2
|
||||
#define VAL r3
|
||||
#define CNT r4
|
||||
#define TMP r5
|
||||
#else
|
||||
#define DST r4
|
||||
#define VAL r5
|
||||
#define CNT r6
|
||||
#define TMP r2
|
||||
#endif
|
||||
|
||||
mov #12,r0 ! Check for small number of bytes
|
||||
cmp/gt CNT,r0
|
||||
mov DST,r0
|
||||
SL(bt, L_store_byte_loop_check0, add DST,CNT)
|
||||
|
||||
tst #3,r0 ! Align destination
|
||||
SL(bt, L_dup_bytes, extu.b r5,r5)
|
||||
.balignw 4,0x0009
|
||||
L_align_loop:
|
||||
mov.b VAL,@r0
|
||||
add #1,r0
|
||||
tst #3,r0
|
||||
bf L_align_loop
|
||||
|
||||
L_dup_bytes:
|
||||
swap.b VAL,TMP ! Duplicate bytes across longword
|
||||
or TMP,VAL
|
||||
swap.w VAL,TMP
|
||||
or TMP,VAL
|
||||
|
||||
add #-16,CNT
|
||||
|
||||
.balignw 4,0x0009
|
||||
L_store_long_loop:
|
||||
mov.l VAL,@r0 ! Store double longs to memory
|
||||
cmp/hs CNT,r0
|
||||
mov.l VAL,@(4,r0)
|
||||
SL(bf, L_store_long_loop, add #8,r0)
|
||||
|
||||
add #16,CNT
|
||||
|
||||
L_store_byte_loop_check0:
|
||||
cmp/eq CNT,r0
|
||||
bt L_exit
|
||||
.balignw 4,0x0009
|
||||
L_store_byte_loop:
|
||||
mov.b VAL,@r0 ! Store bytes to memory
|
||||
add #1,r0
|
||||
cmp/eq CNT,r0
|
||||
bf L_store_byte_loop
|
||||
|
||||
L_exit:
|
||||
rts
|
||||
mov r4,r0
|
||||
#endif /* ! SHMEDIA */
|
|
@ -0,0 +1,191 @@
|
|||
/* We want to pretend we're in SHmedia mode, even when assembling for
|
||||
SHcompact. */
|
||||
#if __SH5__ == 32 && ! __SHMEDIA__
|
||||
# undef __SHMEDIA__
|
||||
# define __SHMEDIA__ 1
|
||||
#endif
|
||||
|
||||
#if __SHMEDIA__
|
||||
.mode SHmedia
|
||||
#endif
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(setjmp)
|
||||
#if __SH5__
|
||||
ptabs r18, tr0
|
||||
gettr tr5, r5
|
||||
gettr tr6, r6
|
||||
gettr tr7, r7
|
||||
st.q r2, 0*8, r18
|
||||
st.q r2, 1*8, r10
|
||||
st.q r2, 2*8, r11
|
||||
st.q r2, 3*8, r12
|
||||
st.q r2, 4*8, r13
|
||||
st.q r2, 5*8, r14
|
||||
st.q r2, 6*8, r15
|
||||
st.q r2, 7*8, r28
|
||||
st.q r2, 8*8, r29
|
||||
st.q r2, 9*8, r30
|
||||
st.q r2, 10*8, r31
|
||||
st.q r2, 11*8, r32
|
||||
st.q r2, 12*8, r33
|
||||
st.q r2, 13*8, r34
|
||||
st.q r2, 14*8, r35
|
||||
st.q r2, 15*8, r44
|
||||
st.q r2, 16*8, r45
|
||||
st.q r2, 17*8, r46
|
||||
st.q r2, 18*8, r47
|
||||
st.q r2, 19*8, r48
|
||||
st.q r2, 20*8, r49
|
||||
st.q r2, 21*8, r50
|
||||
st.q r2, 22*8, r51
|
||||
st.q r2, 23*8, r52
|
||||
st.q r2, 24*8, r53
|
||||
st.q r2, 25*8, r54
|
||||
st.q r2, 26*8, r55
|
||||
st.q r2, 27*8, r56
|
||||
st.q r2, 28*8, r57
|
||||
st.q r2, 29*8, r58
|
||||
st.q r2, 30*8, r59
|
||||
st.q r2, 31*8, r5
|
||||
st.q r2, 32*8, r6
|
||||
st.q r2, 33*8, r7
|
||||
#if ! __SH4_NOFPU__
|
||||
fst.d r2, 34*8, dr12
|
||||
fst.d r2, 35*8, dr14
|
||||
fst.d r2, 36*8, dr36
|
||||
fst.d r2, 37*8, dr38
|
||||
fst.d r2, 38*8, dr40
|
||||
fst.d r2, 39*8, dr42
|
||||
fst.d r2, 40*8, dr44
|
||||
fst.d r2, 41*8, dr46
|
||||
fst.d r2, 42*8, dr48
|
||||
fst.d r2, 43*8, dr50
|
||||
fst.d r2, 44*8, dr52
|
||||
fst.d r2, 45*8, dr54
|
||||
fst.d r2, 46*8, dr56
|
||||
fst.d r2, 47*8, dr58
|
||||
fst.d r2, 48*8, dr60
|
||||
fst.d r2, 49*8, dr62
|
||||
#endif
|
||||
movi 0, r2
|
||||
blink tr0, r63
|
||||
#else
|
||||
#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
|
||||
add #(13*4),r4
|
||||
#else
|
||||
add #(9*4),r4
|
||||
#endif
|
||||
|
||||
sts.l pr,@-r4
|
||||
|
||||
#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
|
||||
fmov.s fr15,@-r4 ! call saved floating point registers
|
||||
fmov.s fr14,@-r4
|
||||
fmov.s fr13,@-r4
|
||||
fmov.s fr12,@-r4
|
||||
#endif
|
||||
|
||||
mov.l r15,@-r4 ! call saved integer registers
|
||||
mov.l r14,@-r4
|
||||
mov.l r13,@-r4
|
||||
mov.l r12,@-r4
|
||||
|
||||
mov.l r11,@-r4
|
||||
mov.l r10,@-r4
|
||||
mov.l r9,@-r4
|
||||
mov.l r8,@-r4
|
||||
|
||||
rts
|
||||
mov #0,r0
|
||||
#endif /* __SH5__ */
|
||||
|
||||
ENTRY(longjmp)
|
||||
#if __SH5__
|
||||
ld.q r2, 0*8, r18
|
||||
ptabs r18, tr0
|
||||
ld.q r2, 1*8, r10
|
||||
ld.q r2, 2*8, r11
|
||||
ld.q r2, 3*8, r12
|
||||
ld.q r2, 4*8, r13
|
||||
ld.q r2, 5*8, r14
|
||||
ld.q r2, 6*8, r15
|
||||
ld.q r2, 7*8, r28
|
||||
ld.q r2, 8*8, r29
|
||||
ld.q r2, 9*8, r30
|
||||
ld.q r2, 10*8, r31
|
||||
ld.q r2, 11*8, r32
|
||||
ld.q r2, 12*8, r33
|
||||
ld.q r2, 13*8, r34
|
||||
ld.q r2, 14*8, r35
|
||||
ld.q r2, 15*8, r44
|
||||
ld.q r2, 16*8, r45
|
||||
ld.q r2, 17*8, r46
|
||||
ld.q r2, 18*8, r47
|
||||
ld.q r2, 19*8, r48
|
||||
ld.q r2, 20*8, r49
|
||||
ld.q r2, 21*8, r50
|
||||
ld.q r2, 22*8, r51
|
||||
ld.q r2, 23*8, r52
|
||||
ld.q r2, 24*8, r53
|
||||
ld.q r2, 25*8, r54
|
||||
ld.q r2, 26*8, r55
|
||||
ld.q r2, 27*8, r56
|
||||
ld.q r2, 28*8, r57
|
||||
ld.q r2, 29*8, r58
|
||||
ld.q r2, 30*8, r59
|
||||
ld.q r2, 31*8, r5
|
||||
ld.q r2, 32*8, r6
|
||||
ld.q r2, 33*8, r7
|
||||
ptabs r5, tr5
|
||||
ptabs r6, tr6
|
||||
ptabs r7, tr7
|
||||
#if ! __SH4_NOFPU__
|
||||
fld.d r2, 34*8, dr12
|
||||
fld.d r2, 35*8, dr14
|
||||
fld.d r2, 36*8, dr36
|
||||
fld.d r2, 37*8, dr38
|
||||
fld.d r2, 38*8, dr40
|
||||
fld.d r2, 39*8, dr42
|
||||
fld.d r2, 40*8, dr44
|
||||
fld.d r2, 41*8, dr46
|
||||
fld.d r2, 42*8, dr48
|
||||
fld.d r2, 43*8, dr50
|
||||
fld.d r2, 44*8, dr52
|
||||
fld.d r2, 45*8, dr54
|
||||
fld.d r2, 46*8, dr56
|
||||
fld.d r2, 47*8, dr58
|
||||
fld.d r2, 48*8, dr60
|
||||
fld.d r2, 49*8, dr62
|
||||
#endif
|
||||
movi 1, r2
|
||||
cmvne r3, r3, r2
|
||||
blink tr0, r63
|
||||
#else
|
||||
mov.l @r4+,r8
|
||||
mov.l @r4+,r9
|
||||
mov.l @r4+,r10
|
||||
mov.l @r4+,r11
|
||||
|
||||
mov.l @r4+,r12
|
||||
mov.l @r4+,r13
|
||||
mov.l @r4+,r14
|
||||
mov.l @r4+,r15
|
||||
|
||||
#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
|
||||
fmov.s @r4+,fr12 ! call saved floating point registers
|
||||
fmov.s @r4+,fr13
|
||||
fmov.s @r4+,fr14
|
||||
fmov.s @r4+,fr15
|
||||
#endif
|
||||
|
||||
lds.l @r4+,pr
|
||||
|
||||
mov r5,r0
|
||||
tst r0,r0
|
||||
bf retr4
|
||||
movt r0
|
||||
retr4: rts
|
||||
nop
|
||||
#endif /* __SH5__ */
|
|
@ -0,0 +1,225 @@
|
|||
! SH5 code Copyright 2002 SuperH Ltd.
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(strcmp)
|
||||
|
||||
#if __SHMEDIA__
|
||||
ld.ub r2,0,r4
|
||||
pt/l quickret0,tr0
|
||||
ld.ub r3,0,r5
|
||||
ptabs r18,tr2
|
||||
beqi/u r4,0,tr0
|
||||
ld.ub r2,1,r6
|
||||
bne/u r4,r5,tr0
|
||||
pt/l quickret1,tr1
|
||||
ld.ub r3,1,r7
|
||||
beqi/u r6,0,tr1
|
||||
ld.ub r2,2,r4
|
||||
bne/u r6,r7,tr1
|
||||
ld.ub r3,2,r5
|
||||
beqi/u r4,0,tr0
|
||||
ld.ub r2,3,r6
|
||||
bne/u r4,r5,tr0
|
||||
ld.ub r3,3,r7
|
||||
beqi/u r6,0,tr1
|
||||
ld.ub r2,4,r4
|
||||
bne/u r6,r7,tr1
|
||||
ld.ub r3,4,r5
|
||||
beqi/u r4,0,tr0
|
||||
ld.ub r2,5,r6
|
||||
bne/u r4,r5,tr0
|
||||
ld.ub r3,5,r7
|
||||
beqi/u r6,0,tr1
|
||||
ld.ub r2,6,r4
|
||||
bne/u r6,r7,tr1
|
||||
ld.ub r3,6,r5
|
||||
beqi/u r4,0,tr0
|
||||
ld.ub r2,7,r6
|
||||
bne/u r4,r5,tr0
|
||||
ld.ub r3,7,r7
|
||||
beqi/u r6,0,tr1
|
||||
sub r3,r2,r3
|
||||
bne/u r6,r7,tr1
|
||||
|
||||
andi r2,-8,r2
|
||||
add r3,r2,r3
|
||||
ldlo.q r3,8,r23
|
||||
pt r23_zero,tr0
|
||||
shlli r3,3,r22
|
||||
sub r63,r22,r20
|
||||
movi 0x101,r6
|
||||
mperm.w r6,r63,r6
|
||||
SHLO r6,r22,r7
|
||||
msubs.ub r7,r23,r8
|
||||
pt loop,tr1
|
||||
bnei/u r8,0,tr0 // r23_zero
|
||||
pt found_zero,tr0
|
||||
addi r3,15,r3
|
||||
andi r3,-8,r3
|
||||
sub r3,r2,r3
|
||||
bne/l r7,r6,tr1 // loop
|
||||
/* The strings are aligned to each other. */
|
||||
/* It is possible to have a loop with six cycles / iteration
|
||||
by re-ordering the exit conditions, but then it needs extra
|
||||
time and/or code to sort out the r4 != r5 case. */
|
||||
pt al_loop,tr1
|
||||
pt al_found_zero,tr0
|
||||
al_loop:
|
||||
ld.q r2,8,r4
|
||||
ldx.q r2,r3,r5
|
||||
addi r2,8,r2
|
||||
mcmpeq.b r63,r4,r8
|
||||
pt cmp_quad,tr3
|
||||
bnei/u r8,0,tr0 // al_found_zero
|
||||
beq/l r4,r5,tr1 // al_loop
|
||||
blink tr3,r63 // cmp_quad
|
||||
|
||||
.balign 8
|
||||
quickret0:
|
||||
sub r4,r5,r2
|
||||
blink tr2,r63
|
||||
quickret1:
|
||||
sub r6,r7,r2
|
||||
blink tr2,r63
|
||||
|
||||
loop:
|
||||
ld.q r2,8,r4
|
||||
ldx.q r2,r3,r19
|
||||
addi r2,8,r2
|
||||
msubs.ub r6,r4,r8
|
||||
mcmpeq.b r63,r19,r9
|
||||
SHHI r19,r20,r21
|
||||
or r21,r23,r5
|
||||
SHLO r19,r22,r23
|
||||
bne/u r8,r9,tr0 // found_zero
|
||||
beq/l r4,r5,tr1 // loop
|
||||
cmp_quad:
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
byterev r4,r4
|
||||
byterev r5,r5
|
||||
#endif
|
||||
cmpgtu r4,r5,r6
|
||||
cmpgtu r5,r4,r7
|
||||
sub r6,r7,r2
|
||||
blink tr2,r63
|
||||
found_zero:
|
||||
pt zero_now,tr0
|
||||
pt cmp_quad,tr1
|
||||
SHHI r9,r20,r7
|
||||
bne/u r8,r7,tr0 // zero_now
|
||||
bne/u r4,r5,tr1 // cmp_quad
|
||||
SHLO r9,r22,r8
|
||||
r23_zero:
|
||||
ld.q r2,8,r4
|
||||
add r23,r63,r5
|
||||
zero_now:
|
||||
al_found_zero:
|
||||
/* We konw that one of the values has at lest one zero, and r8 holds
|
||||
an 0x01 or 0xff mask for every zero found in one of the operands.
|
||||
If both operands have the first zero in the same place, this mask
|
||||
allows us to truncate the comparison to the valid bytes in the
|
||||
strings. If the first zero is in different places, it doesn't
|
||||
matter if some invalid bytes are included, since the comparison
|
||||
of the zero with the non-zero will determine the outcome. */
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
shlli r8,8,r8
|
||||
addi r8,-1,r9
|
||||
andc r9,r8,r8
|
||||
and r8,r4,r4
|
||||
and r8,r5,r5
|
||||
#else
|
||||
shlri r8,1,r8
|
||||
nsb r8,r8
|
||||
addi r8,8,r8
|
||||
andi r8,56,r8
|
||||
sub r63,r8,r8
|
||||
shlrd r4,r8,r4
|
||||
shlrd r5,r8,r5
|
||||
#endif
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
byterev r4,r4
|
||||
byterev r5,r5
|
||||
#endif
|
||||
cmpgtu r4,r5,r6
|
||||
cmpgtu r5,r4,r7
|
||||
sub r6,r7,r2
|
||||
blink tr2,r63
|
||||
|
||||
#else /* ! __SHMEDIA__, i.e. SH 1..4 / SHcompact */
|
||||
|
||||
#ifdef __SH5__
|
||||
#define STR1 r2
|
||||
#define STR2 r3
|
||||
#define RESULT r2
|
||||
#define TMP r4
|
||||
#else
|
||||
! Entry: r4: string1
|
||||
! r5: string2
|
||||
! Exit: r0: result
|
||||
! r1-r2,r4-r5: clobbered
|
||||
#define STR1 r4
|
||||
#define STR2 r5
|
||||
#define RESULT r0
|
||||
#define TMP r2
|
||||
#endif /* __SH5__ */
|
||||
|
||||
mov STR1,r0
|
||||
or STR2,r0
|
||||
tst #3,r0
|
||||
bf L_setup_char_loop
|
||||
mov #0,r0
|
||||
#ifdef DELAYED_BRANCHES
|
||||
mov.l @STR1+,r1
|
||||
.align 2
|
||||
Longword_loop:
|
||||
mov.l @STR2+,TMP
|
||||
cmp/str r0,r1
|
||||
bt Longword_loop_end
|
||||
cmp/eq r1,TMP
|
||||
bt.s Longword_loop
|
||||
mov.l @STR1+,r1
|
||||
add #-4, STR1
|
||||
Longword_loop_end:
|
||||
add #-4, STR1
|
||||
add #-4, STR2
|
||||
L_setup_char_loop:
|
||||
mov.b @STR1+,r0
|
||||
.align 2
|
||||
L_char_loop:
|
||||
mov.b @STR2+,r1
|
||||
tst r0,r0
|
||||
bt L_return
|
||||
cmp/eq r0,r1
|
||||
bt.s L_char_loop
|
||||
mov.b @STR1+,r0
|
||||
add #-2,STR1
|
||||
mov.b @STR1,r0
|
||||
#else /* ! DELAYED_BRANCHES */
|
||||
.align 2
|
||||
Longword_loop:
|
||||
mov.l @r4+,r1
|
||||
mov.l @r5+,r2
|
||||
cmp/str r0,r1
|
||||
bt Longword_loop_end
|
||||
cmp/eq r1,r2
|
||||
bt Longword_loop
|
||||
Longword_loop_end:
|
||||
add #-4, r4
|
||||
add #-4, r5
|
||||
.align 2
|
||||
L_setup_char_loop:
|
||||
L_char_loop:
|
||||
mov.b @r4+,r0
|
||||
mov.b @r5+,r1
|
||||
tst r0,r0
|
||||
bt L_return
|
||||
cmp/eq r0,r1
|
||||
bt L_char_loop
|
||||
#endif
|
||||
L_return:
|
||||
extu.b r0,RESULT
|
||||
extu.b r1,r1
|
||||
rts
|
||||
sub r1,RESULT
|
||||
#endif /* ! __SHMEDIA__ */
|
|
@ -0,0 +1,134 @@
|
|||
! Entry: arg0: destination
|
||||
! arg1: source
|
||||
! Exit: result: destination
|
||||
!
|
||||
! SH5 code Copyright 2002 SuperH Ltd.
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(strcpy)
|
||||
|
||||
#if __SHMEDIA__
|
||||
|
||||
pta/l shortstring,tr1
|
||||
ldlo.q r3,0,r4
|
||||
ptabs r18,tr4
|
||||
shlli r3,3,r7
|
||||
addi r2, 8, r0
|
||||
mcmpeq.b r4,r63,r6
|
||||
SHHI r6,r7,r6
|
||||
bnei/u r6,0,tr1 // shortstring
|
||||
pta/l no_lddst, tr2
|
||||
ori r3,-8,r23
|
||||
sub r2, r23, r0
|
||||
sub r3, r2, r21
|
||||
addi r21, 8, r20
|
||||
ldx.q r0, r21, r5
|
||||
pta/l loop, tr0
|
||||
ori r2,-8,r22
|
||||
mcmpeq.b r5, r63, r6
|
||||
bgt/u r22, r23, tr2 // no_lddst
|
||||
|
||||
// r22 < r23 : Need to do a load from the destination.
|
||||
// r22 == r23 : Doesn't actually need to load from destination,
|
||||
// but still can be handled here.
|
||||
ldlo.q r2, 0, r9
|
||||
movi -1, r8
|
||||
SHLO r8, r7, r8
|
||||
mcmv r4, r8, r9
|
||||
stlo.q r2, 0, r9
|
||||
beqi/l r6, 0, tr0 // loop
|
||||
|
||||
add r5, r63, r4
|
||||
addi r0, 8, r0
|
||||
blink tr1, r63 // shortstring
|
||||
no_lddst:
|
||||
// r22 > r23: note that for r22 == r23 the sthi.q would clobber
|
||||
// bytes before the destination region.
|
||||
stlo.q r2, 0, r4
|
||||
SHHI r4, r7, r4
|
||||
sthi.q r0, -1, r4
|
||||
beqi/l r6, 0, tr0 // loop
|
||||
|
||||
add r5, r63, r4
|
||||
addi r0, 8, r0
|
||||
shortstring:
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
pta/l shortstring2,tr1
|
||||
byterev r4,r4
|
||||
#endif
|
||||
shortstring2:
|
||||
st.b r0,-8,r4
|
||||
andi r4,0xff,r5
|
||||
shlri r4,8,r4
|
||||
addi r0,1,r0
|
||||
bnei/l r5,0,tr1
|
||||
blink tr4,r63 // return
|
||||
|
||||
.balign 8
|
||||
loop:
|
||||
stlo.q r0, 0, r5
|
||||
ldx.q r0, r20, r4
|
||||
addi r0, 16, r0
|
||||
sthi.q r0, -9, r5
|
||||
mcmpeq.b r4, r63, r6
|
||||
bnei/u r6, 0, tr1 // shortstring
|
||||
ldx.q r0, r21, r5
|
||||
stlo.q r0, -8, r4
|
||||
sthi.q r0, -1, r4
|
||||
mcmpeq.b r5, r63, r6
|
||||
beqi/l r6, 0, tr0 // loop
|
||||
|
||||
add r5, r63, r4
|
||||
addi r0, 8, r0
|
||||
blink tr1, r63 // shortstring
|
||||
|
||||
#else /* ! __SHMEDIA__, i.e. SH 1..4 / SHcompact */
|
||||
|
||||
#ifdef __SH5__
|
||||
#define DST r2
|
||||
#define SRC r3
|
||||
#define TMP r4
|
||||
#define RESULT R2
|
||||
! r0,r1,r3,r4: clobbered
|
||||
#else
|
||||
#define DST r4
|
||||
#define SRC r5
|
||||
#define TMP r2
|
||||
#define RESULT r0
|
||||
! r1-r2,r5: clobbered
|
||||
#endif
|
||||
mov DST,r0
|
||||
or SRC,r0
|
||||
tst #3,r0
|
||||
SL(bf, L_setup_char_loop, mov DST,r0)
|
||||
mov.l @SRC+,r1
|
||||
mov #0,TMP
|
||||
cmp/str TMP,r1
|
||||
SL(bt, Longword_loop_end, sub SRC,r0)
|
||||
.align 2
|
||||
Longword_loop:
|
||||
mov.l r1,@(r0,SRC)
|
||||
mov.l @SRC+,r1
|
||||
cmp/str TMP,r1
|
||||
bt Longword_loop_end
|
||||
mov.l r1,@(r0,SRC)
|
||||
mov.l @SRC+,r1
|
||||
cmp/str TMP,r1
|
||||
bf Longword_loop
|
||||
Longword_loop_end:
|
||||
add #-4,SRC
|
||||
add #3,r0
|
||||
.align 2
|
||||
L_char_loop:
|
||||
mov.b @SRC+,r1
|
||||
L_char_loop_start:
|
||||
tst r1,r1
|
||||
SL(bf, L_char_loop, mov.b r1,@(r0,SRC))
|
||||
rts
|
||||
mov DST,RESULT
|
||||
L_setup_char_loop:
|
||||
mov.b @SRC+,r1
|
||||
bra L_char_loop_start
|
||||
sub SRC,r0
|
||||
#endif /* ! __SHMEDIA__ */
|
|
@ -0,0 +1,87 @@
|
|||
! Entry: arg0: string start address
|
||||
! Exit: result: length
|
||||
!
|
||||
! Copyright 2002 SuperH Ltd.
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
ENTRY(strlen)
|
||||
|
||||
#if __SHMEDIA__
|
||||
|
||||
ldlo.q r2,0,r3
|
||||
ptabs/l r18,tr0
|
||||
pta/l loop,tr1
|
||||
andi r2,-8,r0
|
||||
shlli r2,3,r1
|
||||
mcmpeq.b r3,r63,r3
|
||||
SHHI r3,r1,r4
|
||||
beqi/u r4,0,tr1 // loop
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
movi -1,r2
|
||||
addi r3,-1,r4
|
||||
msad.ubq r3,r4,r2
|
||||
#else
|
||||
shlri r3,1,r3
|
||||
nsb r3,r3
|
||||
shlri r3,3,r2
|
||||
#endif
|
||||
blink tr0,r63
|
||||
|
||||
loop:
|
||||
ldlo.q r0,8,r3
|
||||
addi r0,8,r0
|
||||
ldlo.q r0,8,r63
|
||||
mcmpeq.b r3,r63,r3
|
||||
beqi/l r3,0,tr1 // loop
|
||||
sub r0,r2,r2
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
addi r3,-1,r4
|
||||
addi r2,-1,r2
|
||||
msad.ubq r3,r4,r2
|
||||
#else
|
||||
shlri r3,1,r3
|
||||
nsb r3,r3
|
||||
shlri r3,3,r3
|
||||
add r2,r3,r2
|
||||
#endif
|
||||
blink tr0,r63
|
||||
|
||||
#else /* ! __SHMEDIA__, i.e. SH 1..4 / SHcompact */
|
||||
|
||||
#ifdef __SH5__
|
||||
#define STR_INIT r2
|
||||
#define STR_ORIG r0
|
||||
#define STR_COPY STR_ORIG
|
||||
#define MASK r1
|
||||
#define TMP r3
|
||||
#define RESULT r2
|
||||
! r0,r1,r3: clobbered
|
||||
#else
|
||||
#define STR_INIT r4
|
||||
#define STR_ORIG STR_INIT
|
||||
#define STR_COPY STR
|
||||
#define MASK r1
|
||||
#define TMP r3
|
||||
#define RESULT r0
|
||||
! r1,r3: clobbered
|
||||
#endif
|
||||
#define STR RESULT
|
||||
|
||||
mov #3,MASK
|
||||
and STR_INIT,MASK
|
||||
tst MASK,MASK
|
||||
SL(bf, L_char_loop, mov STR_INIT, STR_COPY)
|
||||
L_word_loop:
|
||||
mov.l @STR+,TMP
|
||||
cmp/str MASK,TMP
|
||||
bf L_word_loop
|
||||
add #-4,STR
|
||||
L_char_loop:
|
||||
mov.b @STR+,TMP
|
||||
tst TMP,TMP
|
||||
bf L_char_loop
|
||||
add #-1,STR
|
||||
rts
|
||||
sub STR_ORIG,STR
|
||||
#endif /* ! __SHMEDIA__ */
|
|
@ -0,0 +1,209 @@
|
|||
/* Copyright 2003 SuperH Ltd. */
|
||||
|
||||
#include "asm.h"
|
||||
|
||||
#ifdef __SH5__
|
||||
#if __SHMEDIA__
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define ZPAD_MASK(src, dst) addi src, -1, dst
|
||||
#else
|
||||
#define ZPAD_MASK(src, dst) \
|
||||
byterev src, dst; addi dst, -1, dst; byterev dst, dst
|
||||
#endif
|
||||
|
||||
|
||||
/* We assume that the destination is not in the first 16 bytes of memory.
|
||||
A typical linker script will put the text section first, and as
|
||||
this code is longer that 16 bytes, you have to get out of your way
|
||||
to put data there. */
|
||||
ENTRY(strncpy)
|
||||
pt L_small, tr2
|
||||
ldlo.q r3, 0, r0
|
||||
shlli r3, 3, r19
|
||||
mcmpeq.b r0, r63, r1
|
||||
SHHI r1, r19, r7
|
||||
add r2, r4, r20
|
||||
addi r20, -8, r5
|
||||
/* If the size is greater than 8, we know we can read beyond the first
|
||||
(possibly partial) quadword, and write out a full first and last
|
||||
(possibly unaligned and/or overlapping) quadword. */
|
||||
bge/u r2, r5, tr2 // L_small
|
||||
pt L_found0, tr0
|
||||
addi r2, 8, r22
|
||||
bnei/u r7, 0, tr0 // L_found0
|
||||
ori r3, -8, r38
|
||||
pt L_end_early, tr1
|
||||
sub r2, r38, r22
|
||||
stlo.q r2, 0, r0
|
||||
sthi.q r2, 7, r0
|
||||
sub r3, r2, r6
|
||||
ldx.q r22, r6, r0
|
||||
/* Before each iteration, check that we can store in full the next quad we
|
||||
are about to fetch. */
|
||||
addi r5, -8, r36
|
||||
bgtu/u r22, r36, tr1 // L_end_early
|
||||
pt L_scan0, tr1
|
||||
L_scan0:
|
||||
addi r22, 8, r22
|
||||
mcmpeq.b r0, r63, r1
|
||||
stlo.q r22, -8, r0
|
||||
bnei/u r1, 0, tr0 // L_found0
|
||||
sthi.q r22, -1, r0
|
||||
ldx.q r22, r6, r0
|
||||
bgeu/l r36, r22, tr1 // L_scan0
|
||||
L_end:
|
||||
// At end; we might re-read a few bytes when we fetch the last quad.
|
||||
// branch mispredict, so load is ready now.
|
||||
mcmpeq.b r0, r63, r1
|
||||
addi r22, 8, r22
|
||||
bnei/u r1, 0, tr0 // L_found0
|
||||
add r3, r4, r7
|
||||
ldlo.q r7, -8, r1
|
||||
ldhi.q r7, -1, r7
|
||||
ptabs r18, tr0
|
||||
stlo.q r22, -8, r0
|
||||
or r1, r7, r1
|
||||
mcmpeq.b r1, r63, r7
|
||||
sthi.q r22, -1, r0
|
||||
ZPAD_MASK (r7, r7)
|
||||
and r1, r7, r1 // mask out non-zero bytes after first zero byte
|
||||
stlo.q r20, -8, r1
|
||||
sthi.q r20, -1, r1
|
||||
blink tr0, r63
|
||||
|
||||
L_end_early:
|
||||
/* Check if we can store the current quad in full. */
|
||||
pt L_end, tr1
|
||||
add r3, r4, r7
|
||||
bgtu/u r5, r22, tr1 // L_end // Not really unlikely, but gap is short.
|
||||
/* If not, that means we can just proceed to process the last quad.
|
||||
Two pipeline stalls are unavoidable, as we don't have enough ILP. */
|
||||
ldlo.q r7, -8, r1
|
||||
ldhi.q r7, -1, r7
|
||||
ptabs r18, tr0
|
||||
or r1, r7, r1
|
||||
mcmpeq.b r1, r63, r7
|
||||
ZPAD_MASK (r7, r7)
|
||||
and r1, r7, r1 // mask out non-zero bytes after first zero byte
|
||||
stlo.q r20, -8, r1
|
||||
sthi.q r20, -1, r1
|
||||
blink tr0, r63
|
||||
|
||||
L_found0:
|
||||
// r0: string to store, not yet zero-padding normalized.
|
||||
// r1: result of mcmpeq.b r0, r63, r1.
|
||||
// r22: store address plus 8. I.e. address where zero padding beyond the
|
||||
// string in r0 goes.
|
||||
// r20: store end address.
|
||||
// r5: store end address minus 8.
|
||||
pt L_write0_multiquad, tr0
|
||||
ZPAD_MASK (r1, r1)
|
||||
and r0, r1, r0 // mask out non-zero bytes after first zero byte
|
||||
stlo.q r22, -8, r0
|
||||
sthi.q r22, -1, r0
|
||||
andi r22, -8, r1 // Check if zeros to write fit in one quad word.
|
||||
bgtu/l r5, r1, tr0 // L_write0_multiquad
|
||||
ptabs r18, tr1
|
||||
sub r20, r22, r1
|
||||
shlli r1, 2, r1 // Do shift in two steps so that 64 bit case is
|
||||
SHLO r0, r1, r0 // handled correctly.
|
||||
SHLO r0, r1, r0
|
||||
sthi.q r20, -1, r0
|
||||
blink tr1, r63
|
||||
|
||||
L_write0_multiquad:
|
||||
pt L_write0_loop, tr0
|
||||
ptabs r18, tr1
|
||||
stlo.q r22, 0, r63
|
||||
sthi.q r20, -1, r63
|
||||
addi r1, 8, r1
|
||||
bgeu/l r5, r1, tr0 // L_write0_loop
|
||||
blink tr1, r63
|
||||
|
||||
L_write0_loop:
|
||||
st.q r1, 0 ,r63
|
||||
addi r1, 8, r1
|
||||
bgeu/l r5, r1, tr0 // L_write0_loop
|
||||
blink tr1, r63
|
||||
|
||||
L_small:
|
||||
// r0: string to store, not yet zero-padding normalized.
|
||||
// r1: result of mcmpeq.b r0, r63, r1.
|
||||
// r7: nonzero indicates relevant zero found r0.
|
||||
// r2: store address.
|
||||
// r3: read address.
|
||||
// r4: size, max 8
|
||||
// r20: store end address.
|
||||
// r5: store end address minus 8.
|
||||
pt L_nohi, tr0
|
||||
pt L_small_storelong, tr1
|
||||
ptabs r18, tr2
|
||||
sub r63, r4, r23
|
||||
bnei/u r7, 0, tr0 // L_nohi
|
||||
ori r3, -8, r7
|
||||
bge/l r23, r7, tr0 // L_nohi
|
||||
ldhi.q r3, 7, r1
|
||||
or r0, r1, r0
|
||||
mcmpeq.b r0, r63, r1
|
||||
L_nohi:
|
||||
ZPAD_MASK (r1, r1)
|
||||
and r0, r1, r0
|
||||
movi 4, r19
|
||||
bge/u r4, r19, tr1 // L_small_storelong
|
||||
|
||||
pt L_small_end, tr0
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
byterev r0, r0
|
||||
#endif
|
||||
beqi/u r4, 0, tr0 // L_small_end
|
||||
st.b r2, 0, r0
|
||||
beqi/u r4, 1, tr0 // L_small_end
|
||||
shlri r0, 8, r0
|
||||
st.b r2, 1, r0
|
||||
beqi/u r4, 2, tr0 // L_small_end
|
||||
shlri r0, 8, r0
|
||||
st.b r2, 2, r0
|
||||
L_small_end:
|
||||
blink tr2, r63
|
||||
|
||||
L_small_storelong:
|
||||
shlli r23, 3, r7
|
||||
SHHI r0, r7, r1
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
shlri r1, 32, r1
|
||||
#else
|
||||
shlri r0, 32, r0
|
||||
#endif
|
||||
stlo.l r2, 0, r0
|
||||
sthi.l r2, 3, r0
|
||||
stlo.l r20, -4, r1
|
||||
sthi.l r20, -1, r1
|
||||
blink tr2, r63
|
||||
|
||||
#else /* SHcompact */
|
||||
|
||||
/* This code is optimized for size. Instruction selection is SH5 specific.
|
||||
SH4 should use a different version. */
|
||||
ENTRY(strncpy)
|
||||
mov #0, r6
|
||||
cmp/eq r4, r6
|
||||
bt return
|
||||
mov r2, r5
|
||||
add #-1, r5
|
||||
add r5, r4
|
||||
loop:
|
||||
bt/s found0
|
||||
add #1, r5
|
||||
mov.b @r3+, r1
|
||||
found0:
|
||||
cmp/eq r5,r4
|
||||
mov.b r1, @r5
|
||||
bf/s loop
|
||||
cmp/eq r1, r6
|
||||
return:
|
||||
rts
|
||||
nop
|
||||
|
||||
#endif /* SHcompact */
|
||||
#endif /* __SH5__ */
|
|
@ -0,0 +1,18 @@
|
|||
## Process this file with automake to generate Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
|
||||
AM_CCASFLAGS = $(INCLUDES) $(CFLAGS)
|
||||
|
||||
noinst_LIBRARIES = lib.a
|
||||
|
||||
lib_a_SOURCES = syscalls.c trap.S creat.c ftruncate.c truncate.c
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
all-local: crt0.o
|
||||
|
||||
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
|
||||
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
|
|
@ -0,0 +1,474 @@
|
|||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = .
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(srcdir)/../../../../mkinstalldirs
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
lib_a_AR = $(AR) $(ARFLAGS)
|
||||
lib_a_LIBADD =
|
||||
am_lib_a_OBJECTS = lib_a-syscalls.$(OBJEXT) lib_a-trap.$(OBJEXT) \
|
||||
lib_a-creat.$(OBJEXT) lib_a-ftruncate.$(OBJEXT) \
|
||||
lib_a-truncate.$(OBJEXT)
|
||||
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(lib_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
|
||||
NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
READELF = @READELF@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
aext = @aext@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
libm_machine_dir = @libm_machine_dir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lpfx = @lpfx@
|
||||
machine_dir = @machine_dir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
newlib_basedir = @newlib_basedir@
|
||||
oext = @oext@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sys_dir = @sys_dir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
|
||||
AM_CCASFLAGS = $(INCLUDES) $(CFLAGS)
|
||||
noinst_LIBRARIES = lib.a
|
||||
lib_a_SOURCES = syscalls.c trap.S creat.c ftruncate.c truncate.c
|
||||
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
|
||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
|
||||
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .obj
|
||||
am--refresh: Makefile
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --cygnus \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --cygnus Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
|
||||
-rm -f lib.a
|
||||
$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
|
||||
$(RANLIB) lib.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
.S.o:
|
||||
$(CPPASCOMPILE) -c -o $@ $<
|
||||
|
||||
.S.obj:
|
||||
$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
lib_a-trap.o: trap.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-trap.o `test -f 'trap.S' || echo '$(srcdir)/'`trap.S
|
||||
|
||||
lib_a-trap.obj: trap.S
|
||||
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-trap.obj `if test -f 'trap.S'; then $(CYGPATH_W) 'trap.S'; else $(CYGPATH_W) '$(srcdir)/trap.S'; fi`
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
lib_a-syscalls.o: syscalls.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-syscalls.o `test -f 'syscalls.c' || echo '$(srcdir)/'`syscalls.c
|
||||
|
||||
lib_a-syscalls.obj: syscalls.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-syscalls.obj `if test -f 'syscalls.c'; then $(CYGPATH_W) 'syscalls.c'; else $(CYGPATH_W) '$(srcdir)/syscalls.c'; fi`
|
||||
|
||||
lib_a-creat.o: creat.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creat.o `test -f 'creat.c' || echo '$(srcdir)/'`creat.c
|
||||
|
||||
lib_a-creat.obj: creat.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-creat.obj `if test -f 'creat.c'; then $(CYGPATH_W) 'creat.c'; else $(CYGPATH_W) '$(srcdir)/creat.c'; fi`
|
||||
|
||||
lib_a-ftruncate.o: ftruncate.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftruncate.o `test -f 'ftruncate.c' || echo '$(srcdir)/'`ftruncate.c
|
||||
|
||||
lib_a-ftruncate.obj: ftruncate.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ftruncate.obj `if test -f 'ftruncate.c'; then $(CYGPATH_W) 'ftruncate.c'; else $(CYGPATH_W) '$(srcdir)/ftruncate.c'; fi`
|
||||
|
||||
lib_a-truncate.o: truncate.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-truncate.o `test -f 'truncate.c' || echo '$(srcdir)/'`truncate.c
|
||||
|
||||
lib_a-truncate.obj: truncate.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-truncate.obj `if test -f 'truncate.c'; then $(CYGPATH_W) 'truncate.c'; else $(CYGPATH_W) '$(srcdir)/truncate.c'; fi`
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
check-am:
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES) all-local
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am all-local am--refresh check check-am \
|
||||
clean clean-generic clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-tags dvi dvi-am \
|
||||
html html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am
|
||||
|
||||
|
||||
all-local: 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:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,14 @@
|
|||
dnl This is the newlib/libc/sys/sh configure.in file.
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT([newlib],[NEWLIB_VERSION])
|
||||
AC_CONFIG_SRCDIR([creat.c])
|
||||
|
||||
dnl Can't be done in NEWLIB_CONFIGURE because that confuses automake.
|
||||
AC_CONFIG_AUX_DIR(../../../..)
|
||||
|
||||
NEWLIB_CONFIGURE(../../..)
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
|
@ -0,0 +1,7 @@
|
|||
int
|
||||
creat(path, mode)
|
||||
const char *path;
|
||||
int mode;
|
||||
{
|
||||
return _creat (path, mode);
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
|
||||
#ifdef __SH5__
|
||||
.section .data,"aw"
|
||||
.global ___data
|
||||
___data:
|
||||
|
||||
.section .rodata,"a"
|
||||
.global ___rodata
|
||||
___rodata:
|
||||
|
||||
#if __SH5__ == 64
|
||||
.section .text,"ax"
|
||||
#define LOAD_ADDR(sym, reg) \
|
||||
movi (sym >> 48) & 65535, reg; \
|
||||
shori (sym >> 32) & 65535, reg; \
|
||||
shori (sym >> 16) & 65535, reg; \
|
||||
shori sym & 65535, reg
|
||||
#else
|
||||
.mode SHmedia
|
||||
.section .text..SHmedia32,"ax"
|
||||
#define LOAD_ADDR(sym, reg) \
|
||||
movi (sym >> 16) & 65535, reg; \
|
||||
shori sym & 65535, reg
|
||||
#endif
|
||||
.global start
|
||||
start:
|
||||
LOAD_ADDR (_stack, r15)
|
||||
|
||||
pt/l zero_bss_loop, tr0
|
||||
pt/l _atexit, tr1
|
||||
pt/l _init, tr5
|
||||
pt/l _main, tr6
|
||||
pt/l _exit, tr7
|
||||
|
||||
! zero out bss
|
||||
LOAD_ADDR (_edata, r0)
|
||||
LOAD_ADDR (_end, r1)
|
||||
zero_bss_loop:
|
||||
stx.q r0, r63, r63
|
||||
addi r0, 8, r0
|
||||
bgt/l r1, r0, tr0
|
||||
|
||||
LOAD_ADDR (___data, r26)
|
||||
LOAD_ADDR (___rodata, r27)
|
||||
|
||||
#if ! __SH4_NOFPU__
|
||||
getcon cr0, r0
|
||||
movi 1, r1
|
||||
shlli r1, 15, r1
|
||||
or r1, r0, r0
|
||||
putcon r0, cr0
|
||||
#endif
|
||||
|
||||
! arrange for exit to call fini
|
||||
LOAD_ADDR (_fini, r2)
|
||||
blink tr1, r18
|
||||
|
||||
! call init
|
||||
blink tr5, r18
|
||||
|
||||
! call the mainline
|
||||
blink tr6, r18
|
||||
|
||||
! call exit
|
||||
blink tr7, r18
|
||||
#else
|
||||
.section .text
|
||||
.global start
|
||||
start:
|
||||
mov.l stack_k,r15
|
||||
|
||||
! zero out bss
|
||||
mov.l edata_k,r0
|
||||
mov.l end_k,r1
|
||||
mov #0,r2
|
||||
start_l:
|
||||
mov.l r2,@r0
|
||||
add #4,r0
|
||||
cmp/ge r0,r1
|
||||
bt start_l
|
||||
|
||||
#ifndef __SH2A_NOFPU__
|
||||
#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY) || defined(__SH2A__)
|
||||
mov.l set_fpscr_k, r1
|
||||
jsr @r1
|
||||
mov #0,r4
|
||||
lds r3,fpscr
|
||||
#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A__) */
|
||||
#endif /* !__SH2A_NOFPU__ */
|
||||
|
||||
! call the mainline
|
||||
mov.l main_k,r0
|
||||
jsr @r0
|
||||
or r0,r0
|
||||
|
||||
! call exit
|
||||
mov r0,r4
|
||||
mov.l exit_k,r0
|
||||
jsr @r0
|
||||
or r0,r0
|
||||
|
||||
.align 2
|
||||
#ifndef __SH2A_NOFPU__
|
||||
#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A__)
|
||||
set_fpscr_k:
|
||||
.long ___set_fpscr
|
||||
#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) || defined(__SH2A__) */
|
||||
#endif /* !__SH2A_NOFPU__ */
|
||||
stack_k:
|
||||
.long _stack
|
||||
edata_k:
|
||||
.long _edata
|
||||
end_k:
|
||||
.long _end
|
||||
main_k:
|
||||
.long _main
|
||||
exit_k:
|
||||
.long _exit
|
||||
#endif
|
|
@ -0,0 +1,9 @@
|
|||
#include <_ansi.h>
|
||||
#include <sys/types.h>
|
||||
#include "sys/syscall.h"
|
||||
|
||||
int
|
||||
ftruncate (int file, off_t length)
|
||||
{
|
||||
return __trap34 (SYS_ftruncate, file, length, 0);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#define SYS_exit 1
|
||||
#define SYS_fork 2
|
||||
|
||||
#define SYS_read 3
|
||||
#define SYS_write 4
|
||||
#define SYS_open 5
|
||||
#define SYS_close 6
|
||||
#define SYS_wait4 7
|
||||
#define SYS_creat 8
|
||||
#define SYS_link 9
|
||||
#define SYS_unlink 10
|
||||
#define SYS_execv 11
|
||||
#define SYS_chdir 12
|
||||
#define SYS_mknod 14
|
||||
#define SYS_chmod 15
|
||||
#define SYS_chown 16
|
||||
#define SYS_lseek 19
|
||||
#define SYS_getpid 20
|
||||
#define SYS_isatty 21
|
||||
#define SYS_fstat 22
|
||||
#define SYS_time 23
|
||||
|
||||
|
||||
#define SYS_ARG 24
|
||||
#define SYS_stat 38
|
||||
|
||||
#define SYS_pipe 42
|
||||
#define SYS_execve 59
|
||||
|
||||
#define SYS_truncate 129
|
||||
#define SYS_ftruncate 130
|
||||
|
||||
#define SYS_argc 172 /* == 0xAC, for Argument Count :-) */
|
||||
#define SYS_argnlen 173
|
||||
#define SYS_argn 174
|
||||
|
||||
#define SYS_utime 201 /* not really a system call */
|
||||
#define SYS_wait 202 /* nor is this */
|
|
@ -0,0 +1,196 @@
|
|||
#include <_ansi.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include "sys/syscall.h"
|
||||
int errno;
|
||||
|
||||
/* This is used by _sbrk. */
|
||||
register char *stack_ptr asm ("r15");
|
||||
|
||||
int
|
||||
_read (int file,
|
||||
char *ptr,
|
||||
int len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_lseek (int file,
|
||||
int ptr,
|
||||
int dir)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_write ( int file,
|
||||
char *ptr,
|
||||
int len)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_close (int file)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_link (char *old, char *new)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
caddr_t
|
||||
_sbrk (int incr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_fstat (int file,
|
||||
struct stat *st)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_open (const char *path,
|
||||
int flags)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_creat (const char *path,
|
||||
int mode)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_unlink ()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
isatty (fd)
|
||||
int fd;
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
_isatty (fd)
|
||||
int fd;
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
_exit (n)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_kill (n, m)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_getpid (n)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
_raise ()
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
_stat (const char *path, struct stat *st)
|
||||
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_chmod (const char *path, short mode)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_chown (const char *path, short owner, short group)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_utime (path, times)
|
||||
const char *path;
|
||||
char *times;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_fork ()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_wait (statusp)
|
||||
int *statusp;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_execve (const char *path, char *const argv[], char *const envp[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_execv (const char *path, char *const argv[])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_pipe (int *fd)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* This is only provided because _gettimeofday_r and _times_r are
|
||||
defined in the same module, so we avoid a link error. */
|
||||
clock_t
|
||||
_times (struct tms *tp)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
_gettimeofday (struct timeval *tv, void *tz)
|
||||
{
|
||||
//tv->tv_usec = 0;
|
||||
//tv->tv_sec = __trap34 (SYS_time);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int
|
||||
__setup_argv_for_main (int argc)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
__setup_argv_and_call_main ()
|
||||
{
|
||||
return main (0, NULL);
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#if __SH5__
|
||||
.mode SHmedia
|
||||
#if __SH5__ == 32 && __SHMEDIA__
|
||||
.section .text..SHmedia32, "ax"
|
||||
#else
|
||||
.text
|
||||
#endif
|
||||
.global ___trap34
|
||||
___trap34:
|
||||
movi 34, r0
|
||||
trapa r0
|
||||
pt/l ret, tr1
|
||||
ptabs/l r18, tr0
|
||||
beqi r1, 0, tr1
|
||||
#if __SH5__ == 64
|
||||
movi ((_errno >> 48) & 65535), r0
|
||||
shori ((_errno >> 32) & 65535), r0
|
||||
shori ((_errno >> 16) & 65535), r0
|
||||
#else
|
||||
movi ((_errno >> 16) & 65535), r0
|
||||
#endif
|
||||
shori (_errno & 65535), r0
|
||||
stx.l r0, r63, r1
|
||||
ret:
|
||||
blink tr0, r63
|
||||
|
||||
#else
|
||||
.text
|
||||
.global ___trap34
|
||||
___trap34:
|
||||
trapa #34
|
||||
tst r1,r1 ! r1 is errno
|
||||
bt ret
|
||||
mov.l perrno,r2
|
||||
mov.l r1,@r2
|
||||
ret:
|
||||
rts
|
||||
nop
|
||||
|
||||
.align 2
|
||||
perrno:
|
||||
.long _errno
|
||||
#endif /* ! __SH5__ */
|
|
@ -0,0 +1,9 @@
|
|||
#include <_ansi.h>
|
||||
#include <sys/types.h>
|
||||
#include "sys/syscall.h"
|
||||
|
||||
int
|
||||
truncate (const char *path, off_t length)
|
||||
{
|
||||
return __trap34 (SYS_truncate, path, length, 0);
|
||||
}
|
Loading…
Reference in New Issue