ICU-2242 Assembly generation updates

X-SVN-Rev: 14649
This commit is contained in:
George Rhoten 2004-03-09 02:20:05 +00:00
parent f1c367f9b5
commit 7319205994
4 changed files with 44 additions and 33 deletions

View File

@ -2152,8 +2152,8 @@ fi
GENCCODE_ASSEMBLY=
if test "$ac_cv_prog_gcc" = yes; then
GENCCODE_ASSEMBLY=-a gcc
if test "$GCC" = yes; then
GENCCODE_ASSEMBLY="-a gcc"
fi
@ -4026,15 +4026,6 @@ then
CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
fi
if test "$ac_cv_lib_dld_shl_load" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
if test "$ac_cv_func_dllload" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure

View File

@ -4,7 +4,7 @@ dnl Copyright (c) 1999-2003, International Business Machines Corporation and
dnl others. All Rights Reserved.
dnl Stephen F. Booth, heavily modified by Yves and others
dnl $Id: configure.in,v 1.205 2004/03/02 00:36:00 grhoten-oss Exp $
dnl $Id: configure.in,v 1.206 2004/03/09 02:20:05 grhoten-oss Exp $
dnl Process this file with autoconf to produce a configure script
AC_INIT(common/unicode/utypes.h)
@ -296,9 +296,9 @@ AC_SUBST(HAVE_MMAP)
dnl Check to see if genccode can generate simple assembly.
GENCCODE_ASSEMBLY=
if test "$ac_cv_prog_gcc" = yes; then
if test "$GCC" = yes; then
dnl We're using gcc, and the simple -a gcc command line works for genccode
GENCCODE_ASSEMBLY=-a gcc
GENCCODE_ASSEMBLY="-a gcc"
fi
AC_SUBST(GENCCODE_ASSEMBLY)
@ -920,16 +920,6 @@ then
CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
fi
if test "$ac_cv_lib_dld_shl_load" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
dnl added for s/390 DLL loading detection
if test "$ac_cv_func_dllload" = "yes"; then
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
dnl output the Makefiles
AC_OUTPUT([icudefs.mk \
Makefile \

View File

@ -104,6 +104,36 @@ enum {
kOptAssembly
};
/*
Creating Template Files for New Platforms
Let the cc compiler help you get started.
Compile this program
const unsigned int x[5] = {1, 2, 0xdeadbeef, 0xffffffff, 16};
with the -S option to produce assembly output
This will produce a .s file, something like
.file "foo.c"
.version "01.01"
gcc2_compiled.:
.globl x
.section .rodata
.align 4
.type x,@object
.size x,20
x:
.long 1
.long 2
.long -559038737
.long -1
.long 16
.ident "GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-85)"
which gives a starting point that will compile, and can be transformed
to become the template, generally with some consulting of as docs and
some experimentation.
*/
static const struct AssemblyType {
const char *compiler;
const char *header;
@ -111,27 +141,27 @@ static const struct AssemblyType {
} assemblyHeader[] = {
{"gcc",
".file\t\"%s.s\"\n"
"\t.section .rodata\n"
".globl _%s\n"
"\t.text\n"
"\t.align 32\n"
/*"\t.section .rodata\n"*/ /* Not a portable named section */
"\t.text\n" /* program and const arrays are put here. .data is writable */
"\t.align 8\n" /* Either align 8 bytes or 2^8 (256) bytes. 8 bytes is needed. */
"_%s:\n\n",
".long "
},
#if 0
{"gcc-darwin",
".file\t\"%s.s\"\n"
"\t.section __TEXT,__text,regular,pure_instructions\n"
"\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"
/*"\t.section __TEXT,__text,regular,pure_instructions\n"
"\t.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32\n"*/
".globl _%s\n"
"\t.text\n"
"\t.align 5\n" /* 1<<5 = 32 */
"\t.align 4\n" /* 1<<4 = 16 */
"_%s:\n\n",
".long "
},
#endif
{"xlc",
"",
""}

View File

@ -347,7 +347,7 @@ pkg_mak_writeAssemblyHeader(FileStream *f, const UPKGOptions *o)
T_FileStream_writeLine(f, "\n");
T_FileStream_writeLine(f, "BASE_OBJECTS=$(NAME)_dat.o\n");
T_FileStream_writeLine(f, "\n");
T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST)\n");
T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME).dat: $(CMNLIST) $(DATAFILEPATHS)\n");
T_FileStream_writeLine(f, "\t$(INVOKE) $(GENCMN) -c -e $(ENTRYPOINT) -n $(NAME) -t dat -d $(TEMP_DIR) 0 $(CMNLIST)\n");
T_FileStream_writeLine(f, "\n");
T_FileStream_writeLine(f, "$(TEMP_DIR)/$(NAME)_dat.o : $(TEMP_DIR)/$(NAME).dat\n");