config.gcc: Add cris-*-aout, cris-*-elf, cris-*-none, cris-*-linux* cases.

* config.gcc: Add cris-*-aout, cris-*-elf, cris-*-none,
	cris-*-linux* cases.
	* config/cris/cris-protos.h: New file.
	* config/cris/cris.c: New file.
	* config/cris/cris.h: New file.
	* config/cris/cris.md: New file.
	* config/cris/linux.h: New file.
	* config/cris/aout.h: New file.
	* config/cris/arit.c: New file.
	* config/cris/cris_abi_symbol.c: New file.
	* config/cris/mulsi3.asm: New file.
	* config/cris/t-aout: New file.
	* config/cris/t-cris: New file.
	* config/cris/t-elfmulti: New file.
	* config/cris/t-linux: New file.
	* doc/invoke.texi: Add CRIS options.
	* doc/install.texi (Specific): Add blurb for CRIS.

From-SVN: r46191
This commit is contained in:
Hans-Peter Nilsson 2001-10-11 17:02:36 +00:00 committed by Hans-Peter Nilsson
parent 1567080ca3
commit 0b85d8165e
17 changed files with 11596 additions and 0 deletions

View File

@ -1,3 +1,23 @@
2001-10-11 Hans-Peter Nilsson <hp@axis.com>
* config.gcc: Add cris-*-aout, cris-*-elf, cris-*-none,
cris-*-linux* cases.
* config/cris/cris-protos.h: New file.
* config/cris/cris.c: New file.
* config/cris/cris.h: New file.
* config/cris/cris.md: New file.
* config/cris/linux.h: New file.
* config/cris/aout.h: New file.
* config/cris/arit.c: New file.
* config/cris/cris_abi_symbol.c: New file.
* config/cris/mulsi3.asm: New file.
* config/cris/t-aout: New file.
* config/cris/t-cris: New file.
* config/cris/t-elfmulti: New file.
* config/cris/t-linux: New file.
* doc/invoke.texi: Add CRIS options.
* doc/install.texi (Specific): Add blurb for CRIS.
2001-10-10 Hartmut Schirmer <SchirmerH@Innovative-Systems.de>
* config/float-i128.h: Make sure __STDC__VERSION__ is defined

View File

@ -657,6 +657,27 @@ clipper-intergraph-clix*)
extra_parts="crtbegin.o crtend.o"
install_headers_dir=install-headers-cpio
;;
cris-*-aout)
tm_file="dbxelf.h cris/cris.h cris/aout.h"
gas=yes
tmake_file="cris/t-cris cris/t-aout"
;;
cris-*-elf | cris-*-none)
tm_file="elfos.h cris/cris.h"
tmake_file="cris/t-cris cris/t-elfmulti"
gas=yes
;;
cris-*-linux*)
tm_file="linux.h cris/cris.h cris/linux.h"
tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
case x${enable_threads} in
x | xyes | xpthreads | xposix)
thread_file=posix
;;
esac
gas=yes
;;
d30v-*)
float_format=i64
;;

422
gcc/config/cris/aout.h Normal file
View File

@ -0,0 +1,422 @@
/* Definitions for GCC. Part of the machine description for CRIS.
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* After the first "Node:" comment comes all preprocessor directives and
attached declarations described in the info files, the "Using and
Porting GCC" manual (uapgcc), in the same order as found in the "Target
macros" section in the gcc-2.9x CVS edition of 2000-03-17. FIXME: Not
really, but needs an update anyway.
There is no generic copy-of-uapgcc comment, you'll have to see uapgcc
for that. If applicable, there is a CRIS-specific comment. The order
of macro definitions follow the order in the manual. Every section in
the manual (node in the info pages) has an introductory `Node:
<subchapter>' comment. If no macros are defined for a section, only
the section-comment is present. */
/* This file defines the macros for a.out that are not covered by cris.h.
Many macros are copied from elfos.h and should be in some generic
config/gas-aout.h. */
/* Node: Driver */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{melinux:crt0.o%s}\
%{!melinux:\
%{sim2:s2crt0.o%s}\
%{!sim2:\
%{sim:scrt0.o%s}\
%{!sim:%{pg:gcrt0.o%s}\
%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}}"
/* Which library to get. The only difference from the default is to get
libsc.a if -sim is given to the driver. Repeat -lc -lsysX
{X=sim,linux}, because libsysX needs (at least) errno from libc, and
then we want to resolve new unknowns in libc against libsysX, not
libnosys. Assume everything is in libc for -mlinux. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{melinux:-lc -lsyslinux -lc -lsyslinux -lic}\
%{!melinux:\
%{sim*:-lc -lsyssim -lc -lsyssim}\
%{!sim*:%{g*:-lg}\
%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} -lbsp}\
-lnosys}"
#undef CRIS_CPP_SUBTARGET_SPEC
#define CRIS_CPP_SUBTARGET_SPEC \
"-D__AOUT__\
%{melinux:-D__linux__ -D__unix__ -D__elinux__ -D__uclinux__\
%{!nostdinc:\
%{!mbest-lib-options:%{isystem*}}\
-isystem elinux/include%s\
%{mbest-lib-options:%{isystem*}}}\
%{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix -Delinux -Duclinux}}}}\
%{mbest-lib-options:\
%{!moverride-best-lib-options:\
%{!march=*:%{!metrax*:%{!mcpu=*:-D__tune_v8 -D__CRIS_arch_tune=8}}}}}"
#undef CRIS_CC1_SUBTARGET_SPEC
#define CRIS_CC1_SUBTARGET_SPEC \
"%{mbest-lib-options:\
%{!moverride-best-lib-options:\
%{!march=*:%{!mcpu=*:-mtune=v8}}}}"
#undef CRIS_ASM_SUBTARGET_SPEC
#define CRIS_ASM_SUBTARGET_SPEC "--em=crisaout"
#undef CRIS_LINK_SUBTARGET_SPEC
#define CRIS_LINK_SUBTARGET_SPEC \
"-mcrisaout\
%{sim2:%{!T*:-Tdata 0x4000000 -Tbss 0x8000000}}\
%{melinux:-Ur -d\
%{!shlib:%{!symbolic:-Bstatic}}\
%{shlib:-Bdynamic}\
%{symbolic:-Bdynamic}\
%{static:-Bstatic}}\
%{melinux-stacksize=*:-defsym __Stacksize=%*}"
#undef CRIS_SUBTARGET_SWITCHES
#define CRIS_SUBTARGET_SWITCHES \
{"elinux", (TARGET_MASK_SVINTO \
+ TARGET_MASK_STACK_ALIGN \
+ TARGET_MASK_CONST_ALIGN \
+ TARGET_MASK_DATA_ALIGN \
+ TARGET_MASK_ETRAX4_ADD \
+ TARGET_MASK_ALIGN_BY_32), \
N_("Compile for the MMU-less Etrax 100-based elinux system")}, \
/* Legacy option. */ \
{"aout", 0, ""},
#undef CRIS_SUBTARGET_LONG_OPTIONS
#define CRIS_SUBTARGET_LONG_OPTIONS \
{"elinux-stacksize=", &cris_elinux_stacksize_str, \
N_("For elinux, request a specified stack-size for this program")}, \
#undef CRIS_SUBTARGET_VERSION
#define CRIS_SUBTARGET_VERSION " - a.out"
#undef CRIS_SUBTARGET_DEFAULT
#define CRIS_SUBTARGET_DEFAULT 0
/* Node: Storage Layout */
/* We can align to 16 bits (only) with CRIS a.out. */
#define MAX_OFILE_ALIGNMENT 16
/* Node: Library Calls */
#define TARGET_MEM_FUNCTIONS
/* Node: Data Output */
#define ESCAPES \
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
/* Some svr4 assemblers have a limit on the number of characters which
can appear in the operand of a .string directive. If your assembler
has such a limitation, you should define STRING_LIMIT to reflect that
limit. Note that at least some svr4 assemblers have a limit on the
actual number of bytes in the double-quoted string, and that they
count each character in an escape sequence as one byte. Thus, an
escape sequence like \377 would count as four bytes.
If your target assembler doesn't support the .string directive, you
should define this to zero. */
#define STRING_LIMIT ((unsigned) 256)
#define STRING_ASM_OP "\t.string\t"
#define ASCII_DATA_ASM_OP "\t.ascii\t"
#define TYPE_ASM_OP "\t.type\t"
#define SIZE_ASM_OP "\t.size\t"
#define TYPE_OPERAND_FMT "@%s"
/* The routine used to output NUL terminated strings. We use a special
version of this for most svr4 targets because doing so makes the
generated assembly code more compact (and thus faster to assemble)
as well as more readable, especially for targets like the i386
(where the only alternative is to output character sequences as
comma separated lists of numbers). */
#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
do \
{ \
register const unsigned char *_limited_str = \
(const unsigned char *) (STR); \
register unsigned ch; \
\
fprintf ((FILE), "%s\"", STRING_ASM_OP); \
\
for (; (ch = *_limited_str); _limited_str++) \
{ \
register int escape; \
\
switch (escape = ESCAPES[ch]) \
{ \
case 0: \
putc (ch, (FILE)); \
break; \
case 1: \
fprintf ((FILE), "\\%03o", ch); \
break; \
default: \
putc ('\\', (FILE)); \
putc (escape, (FILE)); \
break; \
} \
} \
\
fprintf ((FILE), "\"\n"); \
} \
while (0)
/* The routine used to output sequences of byte values. We use a special
version of this for most svr4 targets because doing so makes the
generated assembly code more compact (and thus faster to assemble)
as well as more readable. Note that if we find subparts of the
character sequence which end with NUL (and which are shorter than
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
register const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
register const unsigned char *limit = _ascii_bytes + (LENGTH); \
register unsigned bytes_in_chunk = 0; \
\
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
register const unsigned char *p; \
\
if (bytes_in_chunk >= 60) \
{ \
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
\
for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
continue; \
\
if (p < limit && (p - _ascii_bytes) <= (long)STRING_LIMIT) \
{ \
if (bytes_in_chunk > 0) \
{ \
fprintf ((FILE), "\"\n"); \
bytes_in_chunk = 0; \
} \
\
ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
_ascii_bytes = p; \
} \
else \
{ \
register int escape; \
register unsigned ch; \
\
if (bytes_in_chunk == 0) \
fprintf ((FILE), "%s\"", ASCII_DATA_ASM_OP); \
\
switch (escape = ESCAPES[ch = *_ascii_bytes]) \
{ \
case 0: \
putc (ch, (FILE)); \
bytes_in_chunk++; \
break; \
case 1: \
fprintf ((FILE), "\\%03o", ch); \
bytes_in_chunk += 4; \
break; \
default: \
putc ('\\', (FILE)); \
putc (escape, (FILE)); \
bytes_in_chunk += 2; \
break; \
} \
} \
} \
\
if (bytes_in_chunk > 0) \
fprintf ((FILE), "\"\n"); \
} \
while (0)
/* Node: Label Output */
#define SET_ASM_OP "\t.set\t"
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
ASM_GLOBALIZE_LABEL (FILE, XSTR (FUN, 0))
#define ASM_WEAKEN_LABEL(FILE, NAME) \
do \
{ \
fputs ("\t.weak\t", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputc ('\n', (FILE)); \
} \
while (0)
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
do \
{ \
fprintf (FILE, "%s", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
putc ('\n', FILE); \
\
ASM_OUTPUT_LABEL(FILE, NAME); \
} \
while (0)
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
do \
{ \
fprintf (FILE, "%s", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
putc ('\n', FILE); \
\
size_directive_output = 0; \
\
if (!flag_inhibit_size_directive \
&& (DECL) && DECL_SIZE (DECL)) \
{ \
size_directive_output = 1; \
fprintf (FILE, "%s", SIZE_ASM_OP); \
assemble_name (FILE, NAME); \
putc (',', FILE); \
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
int_size_in_bytes (TREE_TYPE (DECL))); \
fputc ('\n', FILE); \
} \
\
ASM_OUTPUT_LABEL (FILE, NAME); \
} \
while (0)
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)\
do \
{ \
const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
\
if (!flag_inhibit_size_directive \
&& DECL_SIZE (DECL) \
&& ! AT_END && TOP_LEVEL \
&& DECL_INITIAL (DECL) == error_mark_node \
&& !size_directive_output) \
{ \
size_directive_output = 1; \
fprintf (FILE, "%s", SIZE_ASM_OP); \
assemble_name (FILE, name); \
putc (',', FILE); \
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, \
int_size_in_bytes (TREE_TYPE (DECL))); \
fputc ('\n', FILE); \
} \
} \
while (0)
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
do \
{ \
if (!flag_inhibit_size_directive) \
{ \
char label[256]; \
static int labelno; \
\
labelno++; \
\
ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \
ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \
\
fprintf (FILE, "%s", SIZE_ASM_OP); \
assemble_name (FILE, (FNAME)); \
fprintf (FILE, ","); \
assemble_name (FILE, label); \
fprintf (FILE, "-"); \
assemble_name (FILE, (FNAME)); \
putc ('\n', FILE); \
} \
} \
while (0)
/* Node: Alignment Output */
#define SKIP_ASM_OP "\t.zero\t"
#undef ASM_OUTPUT_SKIP
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
fprintf (FILE, "%s%u\n", SKIP_ASM_OP, (SIZE))
/* Node: All Debuggers */
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
/* Node: Misc */
#define HANDLE_SYSV_PRAGMA
/* In theory, this one isn't necessary, but over time, external tools have
been primed on names with "." rather than "$". */
#define NO_DOLLAR_IN_LABEL
/* These are undocumented, but to keep a single
CRIS_ASM_OUTPUT_ALIGNED_DECL_COMMON, we set this to an asm that will
emit an error if ever output. It will not be emitted for a.out modulo
careless hacking. */
#define COMMON_ASM_OP "\t.err\t"
#define LOCAL_ASM_OP "\t.err\t"
#if defined(__CRIS__) && defined (__AOUT__) && defined (IN_GCC)
#define CRIS_ABI_VERSION_SYMBOL_STRING ".$CRIS_ABI_V2"
/* Make all a.out library functions have undefined references to the
.$CRIS_ABI_V2 symbol, so it will be picked up. Used by GDB. GDB has
a bug with reading a.out symbols; it does not see the GNU weak
extensions, so we can't have .$CRIS_ABI_V2 weak. Weak. */
__asm__ (".set .$abi_referer," CRIS_ABI_VERSION_SYMBOL_STRING);
#endif
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: t
* End:
*/

302
gcc/config/cris/arit.c Normal file
View File

@ -0,0 +1,302 @@
/* Signed and unsigned multiplication and division and modulus for CRIS.
Contributed by Axis Communications.
Written by Hans-Peter Nilsson <hp@axis.se>, c:a 1992.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file with other programs, and to distribute
those programs without any restriction coming from the use of this
file. (The General Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into another program.)
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
As a special exception, if you link this library with files, some of
which are compiled with GCC, this library does not by itself cause
the resulting object or executable to be covered by the GNU General
Public License.
This exception does not however invalidate any other reasons why
the executable file or object might be covered by the GNU General
Public License. */
/* Note that we provide prototypes for all "const" functions, to attach
the const attribute. This is necessary in 2.7.2 - adding the
attribute to the function *definition* is a syntax error.
This did not work with e.g. 2.1; back then, the return type had to
be "const". */
#include "config.h"
#if defined (__CRIS_arch_version) && __CRIS_arch_version >= 3
#define LZ(v) __extension__ \
({ int tmp_; __asm__ ("lz %1,%0" : "=r" (tmp_) : "r" (v)); tmp_; })
#endif
#if defined (L_udivsi3) || defined (L_divsi3) || defined (L_umodsi3) \
|| defined (L_modsi3)
/* Result type of divmod worker function. */
struct quot_rem
{
long quot;
long rem;
};
/* This is the worker function for div and mod. It is inlined into the
respective library function. */
static __inline__ struct quot_rem
do_31div (unsigned long a, unsigned long b) __attribute__ ((__const__));
static __inline__ struct quot_rem
do_31div (unsigned long a, unsigned long b)
{
/* Adjust operands and result if a is 31 bits. */
long extra = 0;
int quot_digits = 0;
if (b == 0)
{
struct quot_rem ret;
ret.quot = 0xffffffff;
ret.rem = 0xffffffff;
return ret;
}
if (a < b)
return (struct quot_rem) { 0, a };
#ifdef LZ
if (b <= a)
{
quot_digits = LZ (b) - LZ (a);
quot_digits += (a >= (b << quot_digits));
b <<= quot_digits;
}
#else
while (b <= a)
{
b <<= 1;
quot_digits++;
}
#endif
/* Is a 31 bits? Note that bit 31 is handled by the caller. */
if (a & 0x40000000)
{
/* Then make b:s highest bit max 0x40000000, because it must have
been 0x80000000 to be 1 bit higher than a. */
b >>= 1;
/* Adjust a to be maximum 0x3fffffff, i.e. two upper bits zero. */
if (a >= b)
{
a -= b;
extra = 1 << (quot_digits - 1);
}
else
{
a -= b >> 1;
/* Remember that we adjusted a by subtracting b * 2 ** Something. */
extra = 1 << quot_digits;
}
/* The number of quotient digits will be one less, because
we just adjusted b. */
quot_digits--;
}
/* Now do the division part. */
/* Subtract b and add ones to the right when a >= b
i.e. "a - (b - 1) == (a - b) + 1". */
b--;
#define DS __asm__ ("dstep %2,%0" : "=r" (a) : "0" (a), "r" (b))
switch (quot_digits)
{
case 32: DS; case 31: DS; case 30: DS; case 29: DS;
case 28: DS; case 27: DS; case 26: DS; case 25: DS;
case 24: DS; case 23: DS; case 22: DS; case 21: DS;
case 20: DS; case 19: DS; case 18: DS; case 17: DS;
case 16: DS; case 15: DS; case 14: DS; case 13: DS;
case 12: DS; case 11: DS; case 10: DS; case 9: DS;
case 8: DS; case 7: DS; case 6: DS; case 5: DS;
case 4: DS; case 3: DS; case 2: DS; case 1: DS;
case 0:;
}
{
struct quot_rem ret;
ret.quot = (a & ((1 << quot_digits) - 1)) + extra;
ret.rem = a >> quot_digits;
return ret;
}
}
/* Note that unsigned and signed division both build when L_divsi3, but
the unsigned variant is then inlined, as with do_31div above. */
#if defined (L_udivsi3) || defined (L_divsi3)
#ifndef L_udivsi3
static __inline__
#endif
unsigned long
__Udiv (unsigned long a, unsigned long b) __attribute__ ((__const__));
#ifndef L_udivsi3
static __inline__
#endif
unsigned long
__Udiv (unsigned long a, unsigned long b)
{
long extra = 0;
/* Adjust operands and result, if a and/or b is 32 bits. */
/* Effectively: b & 0x80000000. */
if ((long) b < 0)
return a >= b;
/* Effectively: a & 0x80000000. */
if ((long) a < 0)
{
int tmp = 0;
if (b == 0)
return 0xffffffff;
#ifdef LZ
tmp = LZ (b);
#else
for (tmp = 31; (((long) b & (1 << tmp)) == 0); tmp--)
;
tmp = 31 - tmp;
#endif
if ((b << tmp) > a)
{
extra = 1 << (tmp-1);
a -= b << (tmp - 1);
}
else
{
extra = 1 << tmp;
a -= b << tmp;
}
}
return do_31div (a, b).quot+extra;
}
#ifdef L_divsi3
long
__Div (long a, long b) __attribute__ ((__const__));
long
__Div (long a, long b)
{
long sign;
long result;
/* Do *not* call do_31div since abs (-2147483648) == 2147483648
<=> abs (-0x80000000) == 0x80000000
which is still 32 bits. */
sign = a ^ b;
result = __Udiv (abs (a), abs (b));
return (sign < 0) ? -result : result;
}
#endif /* L_divsi3 */
#endif /* L_udivsi3 || L_divsi3 */
/* Note that unsigned and signed modulus both build when L_modsi3, but
then the unsigned variant is inlined, as with do_31div above. */
#if defined (L_umodsi3) || defined (L_modsi3)
#ifndef L_umodsi3
static __inline__
#endif
unsigned long
__Umod (unsigned long a, unsigned long b) __attribute__ ((__const__));
#ifndef L_umodsi3
static __inline__
#endif
unsigned long
__Umod (unsigned long a, unsigned long b)
{
/* Adjust operands and result if a and/or b is 32 bits. */
if ((long) b < 0)
return a >= b ? a - b : a;
if ((long) a < 0)
{
int tmp = 0;
if (b == 0)
return a;
#ifdef LZ
tmp = LZ (b);
#else
for (tmp = 31; (((long) b & (1 << tmp)) == 0); tmp--)
;
tmp = 31 - tmp;
#endif
if ((b << tmp) > a)
{
a -= b << (tmp - 1);
}
else
{
a -= b << tmp;
}
}
return do_31div (a, b).rem;
}
#ifdef L_modsi3
long
__Mod (long a, long b) __attribute__ ((__const__));
long
__Mod (long a, long b)
{
long result;
result = __Umod (abs (a), abs (b));
return (a < 0) ? -result : result;
}
#endif /* L_modsi3 */
#endif /* L_umodsi3 || L_modsi3 */
#endif /* L_udivsi3 || L_divsi3 || L_umodsi3 || L_modsi3 */
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: t
* End:
*/

View File

@ -0,0 +1,75 @@
/* Definitions for GCC. Part of the machine description for CRIS.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Axis Communications.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Prototypes for the CRIS port. */
#if defined(FILE) || defined(stdin) || defined(stdout) || defined(getc) || defined(putc)
#define STDIO_INCLUDED
#endif
extern void cris_conditional_register_usage PARAMS ((void));
extern int cris_simple_epilogue PARAMS ((void));
#ifdef RTX_CODE
extern const char *cris_op_str PARAMS ((rtx));
extern int cris_eligible_for_epilogue_delay PARAMS ((rtx));
extern void cris_notice_update_cc PARAMS ((rtx, rtx));
extern int cris_address_cost PARAMS ((rtx));
extern void cris_print_operand PARAMS ((FILE *, rtx, int));
extern void cris_print_operand_address PARAMS ((FILE *, rtx));
extern int cris_side_effect_mode_ok PARAMS ((enum rtx_code, rtx *, int, int,
int, int, int));
extern rtx cris_return_addr_rtx PARAMS ((int, rtx));
extern rtx cris_split_movdx PARAMS ((rtx *));
extern int cris_legitimate_pic_operand PARAMS ((rtx));
extern int cris_gotless_symbol PARAMS ((rtx));
extern int cris_got_symbol PARAMS ((rtx));
extern int cris_symbol PARAMS ((rtx));
extern void cris_output_addr_const PARAMS ((FILE *, rtx));
extern int cris_cfun_uses_pic_table PARAMS ((void));
extern void cris_target_asm_named_section
PARAMS ((const char *, unsigned int));
# ifdef TREE_CODE
extern rtx cris_expand_builtin_va_arg PARAMS ((tree, tree));
extern void cris_encode_section_info PARAMS ((tree));
# endif
#endif /* RTX_CODE */
#ifdef STDIO_INCLUDED
# ifdef TREE_CODE
extern void cris_asm_output_mi_thunk PARAMS ((FILE *, tree, int, tree));
# endif
#endif
#ifdef GCC_C_PRAGMA_H
extern void cris_pragma_expand_mul PARAMS ((cpp_reader *));
#endif
/* Need one that returns an int; usable in expressions. */
extern int cris_fatal PARAMS ((char *));
extern void cris_override_options PARAMS ((void));
extern int cris_initial_elimination_offset PARAMS ((int, int));
extern void cris_init_expanders PARAMS ((void));
extern int cris_delay_slots_for_epilogue PARAMS ((void));

3043
gcc/config/cris/cris.c Normal file

File diff suppressed because it is too large Load Diff

1937
gcc/config/cris/cris.h Normal file

File diff suppressed because it is too large Load Diff

5096
gcc/config/cris/cris.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
/* Define symbol to recognize CRIS ABI version 2, for a.out use.
Contributed by Axis Communications.
Written by Hans-Peter Nilsson <hp@axis.se>, c:a 1992.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file with other programs, and to distribute
those programs without any restriction coming from the use of this
file. (The General Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into another program.)
This file is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
As a special exception, if you link this library with files, some of
which are compiled with GCC, this library does not by itself cause
the resulting object or executable to be covered by the GNU General
Public License.
This exception does not however invalidate any other reasons why
the executable file or object might be covered by the GNU General
Public License. */
#include "config.h"
#ifdef __AOUT__
/* ELF support was not released before the ABI was changed, so we
restrict this awkwardness to a.out. This symbol is for gdb to
recognize, so it can debug both old and new programs successfully. */
__asm__ (".global " CRIS_ABI_VERSION_SYMBOL_STRING);
__asm__ (".set " CRIS_ABI_VERSION_SYMBOL_STRING ",0");
#else /* not __AOUT__ */
/* The file must not be empty (declaration/definition-wise) according to
ISO, IIRC. */
extern int _Dummy;
#endif /* not __AOUT__ */

134
gcc/config/cris/linux.h Normal file
View File

@ -0,0 +1,134 @@
/* Definitions for GCC. Part of the machine description for CRIS.
Copyright (C) 2001 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* After the first "Node:" comment comes all preprocessor directives and
attached declarations described in the info files, the "Using and
Porting GCC" manual (uapgcc), in the same order as found in the "Target
macros" section in the gcc-2.9x CVS edition of 2000-03-17. FIXME: Not
really, but needs an update anyway.
There is no generic copy-of-uapgcc comment, you'll have to see uapgcc
for that. If applicable, there is a CRIS-specific comment. The order
of macro definitions follow the order in the manual. Every section in
the manual (node in the info pages) has an introductory `Node:
<subchapter>' comment. If no macros are defined for a section, only
the section-comment is present. */
/* This file defines the macros for cris-axis-linux-gnu that are not
covered by cris.h, elfos.h and (config/)linux.h. */
/* Node: Instruction Output */
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX ""
/* Node: Driver */
/* These macros are CRIS-specific, but used in target driver macros. */
#undef CRIS_CPP_SUBTARGET_SPEC
#define CRIS_CPP_SUBTARGET_SPEC \
"-D__linux__ -D__unix__ -D__ELF__\
%{pthread:-D_REENTRANT}\
%{fPIC|fpic: -D__PIC__ -D__pic__}\
%{!fleading-underscore:-fno-leading-underscore -D__NO_UNDERSCORES__}\
%{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}\
%{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix}\
-Asystem(unix) -Asystem(posix) -Acpu(cris) -Amachine(cris)}}"
#undef CRIS_CC1_SUBTARGET_SPEC
#define CRIS_CC1_SUBTARGET_SPEC \
"%{!march=*:%{!cpu=*:-march=v10}}"
#undef CRIS_ASM_SUBTARGET_SPEC
#define CRIS_ASM_SUBTARGET_SPEC \
"--em=criself\
%{!fleading-underscore:--no-underscore}\
%{fPIC|fpic: --pic}"
/* Provide a legacy -mlinux option. */
#undef CRIS_SUBTARGET_SWITCHES
#define CRIS_SUBTARGET_SWITCHES \
{"linux", 0, ""}, \
{"gotplt", -TARGET_MASK_AVOID_GOTPLT, ""}, \
{"no-gotplt", TARGET_MASK_AVOID_GOTPLT, \
N_("Together with -fpic and -fPIC, do not use GOTPLT references")},
#undef CRIS_SUBTARGET_DEFAULT
#define CRIS_SUBTARGET_DEFAULT \
(TARGET_MASK_SVINTO \
+ TARGET_MASK_ETRAX4_ADD \
+ TARGET_MASK_ALIGN_BY_32 \
+ TARGET_MASK_ELF \
+ TARGET_MASK_LINUX)
#undef CRIS_DEFAULT_CPU_VERSION
#define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
#undef CRIS_SUBTARGET_VERSION
#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
/* Redefine what was in svr4.h. Include order madness makes it less
useful to include (config/)linux.h after cris.h. (config/)linux.h
includes svr4.h which undef:s lots of supposedly arch-specific macros
carefully defined by cris.h. */
#undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
/* We need an -rpath-link to ld.so.1, and presumably to each directory
specified with -B. */
#undef CRIS_LINK_SUBTARGET_SPEC
#define CRIS_LINK_SUBTARGET_SPEC \
"-mcrislinux\
-rpath-link include/asm/../..%s\
%{shared} %{static}\
%{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
%{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
%{O2|O3: --gc-sections}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:\
%{pg:gcrt1.o%s}\
%{!pg:\
%{p:gcrt1.o%s}\
%{!p:\
%{profile:gcrt1.o%s}\
%{!profile:crt1.o%s}}}}\
crti.o%s\
%{!shared:crtbegin.o%s}\
%{shared:crtbeginS.o%s}"
/* Node: Sections */
/* GNU/Linux has crti and crtn and does not need the
FORCE_INIT_SECTION_ALIGN trick in cris.h. */
#undef FORCE_INIT_SECTION_ALIGN
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: t
* End:
*/

227
gcc/config/cris/mulsi3.asm Normal file
View File

@ -0,0 +1,227 @@
;; This code used to be expanded through interesting expansions in
;; the machine description, compiled from this code:
;;
;; #ifdef L_mulsi3
;; long __Mul (unsigned long a, unsigned long b) __attribute__ ((__const__));
;;
;; /* This must be compiled with the -mexpand-mul flag, to synthesize the
;; multiplication from the mstep instructions. The check for
;; smaller-size multiplication pays off in the order of .5-10%;
;; estimated median 1%, depending on application.
;; FIXME: It can be further optimized if we go to assembler code, as
;; gcc 2.7.2 adds a few unnecessary instructions and does not put the
;; basic blocks in optimal order. */
;; long
;; __Mul (unsigned long a, unsigned long b)
;; {
;; #if defined (__CRIS_arch_version) && __CRIS_arch_version >= 10
;; /* In case other code is compiled without -march=v10, they will
;; contain calls to __Mul, regardless of flags at link-time. The
;; "else"-code below will work, but is unnecessarily slow. This
;; sometimes cuts a few minutes off from simulation time by just
;; returning a "mulu.d". */
;; return a * b;
;; #else
;; unsigned long min;
;;
;; /* Get minimum via the bound insn. */
;; min = a < b ? a : b;
;;
;; /* Can we omit computation of the high part? */
;; if (min > 65535)
;; /* No. Perform full multiplication. */
;; return a * b;
;; else
;; {
;; /* Check if both operands are within 16 bits. */
;; unsigned long max;
;;
;; /* Get maximum, by knowing the minimum.
;; This will partition a and b into max and min.
;; This is not currently something GCC understands,
;; so do this trick by asm. */
;; __asm__ ("xor %1,%0\n\txor %2,%0"
;; : "=r" (max)
;; : "r" (b), "r" (a), "0" (min));
;;
;; if (max > 65535)
;; /* Make GCC understand that only the low part of "min" will be
;; used. */
;; return max * (unsigned short) min;
;; else
;; /* Only the low parts of both operands are necessary. */
;; return ((unsigned short) max) * (unsigned short) min;
;; }
;; #endif /* not __CRIS_arch_version >= 10 */
;; }
;; #endif /* L_mulsi3 */
;;
;; That approach was abandoned since the caveats outweighted the
;; benefits. The expand-multiplication machinery is also removed, so you
;; can't do this anymore.
;;
;; For doubters of there being any benefits, some where: insensitivity to:
;; - ABI changes (mostly for experimentation)
;; - assembler syntax differences (mostly debug format).
;; - insn scheduling issues.
;; Most ABI experiments will presumably happen with arches with mul insns,
;; so that argument doesn't really hold anymore, and it's unlikely there
;; being new arch variants needing insn scheduling and not having mul
;; insns.
;; ELF and a.out have different syntax for local labels: the "wrong"
;; one may not be omitted from the object.
#undef L
#ifdef __AOUT__
# define L(x) x
#else
# define L(x) .x
#endif
.global ___Mul
.type ___Mul,@function
___Mul:
#if defined (__CRIS_arch_version) && __CRIS_arch_version >= 10
ret
mulu.d $r11,$r10
#else
move.d $r10,$r12
move.d $r11,$r9
bound.d $r12,$r9
cmpu.w 65535,$r9
bls L(L3)
move.d $r12,$r13
movu.w $r11,$r9
lslq 16,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
mstep $r9,$r13
clear.w $r10
test.d $r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
movu.w $r12,$r12
move.d $r11,$r9
clear.w $r9
test.d $r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
mstep $r12,$r9
add.w $r9,$r10
lslq 16,$r10
ret
add.d $r13,$r10
L(L3):
move.d $r9,$r10
xor $r11,$r10
xor $r12,$r10
cmpu.w 65535,$r10
bls L(L5)
movu.w $r9,$r13
movu.w $r13,$r13
move.d $r10,$r9
lslq 16,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
mstep $r13,$r9
clear.w $r10
test.d $r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
mstep $r13,$r10
lslq 16,$r10
ret
add.d $r9,$r10
L(L5):
movu.w $r9,$r9
lslq 16,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
mstep $r9,$r10
ret
mstep $r9,$r10
#endif
L(Lfe1):
.size ___Mul,L(Lfe1)-___Mul

12
gcc/config/cris/t-aout Normal file
View File

@ -0,0 +1,12 @@
LIB2FUNCS_STATIC_EXTRA = \
tmpabi_symbol.c $(srcdir)/config/cris/mulsi3.asm
MULTILIB_OPTIONS = melinux
MULTILIB_DIRNAMES = elinux
MULTILIB_EXTRA_OPTS = mbest-lib-options
INSTALL_LIBGCC = install-multilib
LIBGCC = stmp-multilib
tmpabi_symbol.c: $(srcdir)/config/cris/cris_abi_symbol.c
cp $(srcdir)/config/cris/cris_abi_symbol.c $@

43
gcc/config/cris/t-cris Normal file
View File

@ -0,0 +1,43 @@
#
# t-cris
#
# The Makefile fragment to include when compiling gcc et al for CRIS.
#
#
# The makefile macros etc. are included in the order found in the
# section "Target Fragment" in the gcc info-files (or the paper copy) of
# "Using and Porting GCC"
#
# Don't run fixproto
STMP_FIXPROTO =
LIB2FUNCS_EXTRA = _udivsi3.c _divsi3.c _umodsi3.c _modsi3.c
CRIS_LIB1CSRC = $(srcdir)/config/cris/arit.c
FPBIT = tmplibgcc_fp_bit.c
DPBIT = dp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT_BIT_ORDER_MISMATCH' > dp-bit.c
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
# Use another name to avoid confusing SUN make, if support for
# it is reinstated elsewhere. Prefixed with "tmplibgcc" means
# "make clean" will wipe it. We define a few L_ thingies
# because we can't select them individually through FPBIT_FUNCS;
# see above.
tmplibgcc_fp_bit.c: $(srcdir)/config/fp-bit.c
echo '#define FLOAT_BIT_ORDER_MISMATCH' > $@
echo '#define FLOAT' >> $@
cat $(srcdir)/config/fp-bit.c >> $@
# The fixed-point arithmetic code is in one file, arit.c,
# similar to libgcc2.c (or the old libgcc1.c). We need to
# "split it up" with one file per define.
$(LIB2FUNCS_EXTRA): $(CRIS_LIB1CSRC)
name=`echo $@ | sed -e 's,.*/,,' | sed -e 's,.c$$,,'`; \
echo "#define L$$name" > tmp-$@ \
&& echo '#include "$<"' >> tmp-$@ \
&& mv -f tmp-$@ $@
TARGET_LIBGCC2_CFLAGS = -Dinhibit_libc

View File

@ -0,0 +1,16 @@
LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/cris/mulsi3.asm
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
MULTILIB_OPTIONS = march=v10
MULTILIB_DIRNAMES = v10
MULTILIB_MATCHES = \
march?v10=mcpu?etrax100lx \
march?v10=mcpu?ng \
march?v10=march?etrax100lx \
march?v10=march?ng \
march?v10=march?v11 \
march?v10=mcpu?v11 \
march?v10=mcpu?v10
MULTILIB_EXTRA_OPTS = mbest-lib-options
INSTALL_LIBGCC = install-multilib
LIBGCC = stmp-multilib
CRTSTUFF_T_CFLAGS = $(LIBGCC2_CFLAGS) -moverride-best-lib-options

6
gcc/config/cris/t-linux Normal file
View File

@ -0,0 +1,6 @@
TARGET_LIBGCC2_CFLAGS += -fPIC
CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
# Override t-slibgcc-elf-ver to export some libgcc symbols with
# the symbol versions that glibc used.
SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver

View File

@ -1783,6 +1783,45 @@ can also be obtained from:
@uref{http://www.elec.canterbury.ac.nz/c4x/,,http://www.elec.canterbury.ac.nz/c4x/}
@end itemize
@html
</p>
<hr>
@end html
@heading @anchor{cris}CRIS
CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip
series. These are used in embedded applications.
@ifnothtml
@xref{CRIS Options,, CRIS Options, gcc, Using and Porting the GNU Compiler
Collection (GCC)},
@end ifnothtml
@ifhtml
See ``CRIS Options'' in the main manual
@end ifhtml
for a list of CRIS-specific options.
There are a few different CRIS targets:
@table @code
@item cris-axis-aout
Old target. Includes a multilib for the @samp{elinux} a.out-based
target. No multilibs for newer architecture variants.
@item cris-axis-elf
Mainly for monolithic embedded systems. Includes a multilib for the
@samp{v10} core used in @samp{ETRAX 100 LX}.
@item cris-axis-linux-gnu
A GNU/Linux port for the CRIS architecture, currently targeting
@samp{ETRAX 100 LX} by default.
@end table
For @code{cris-axis-aout} and @code{cris-axis-elf} you need binutils 2.11
or newer. For @code{cris-axis-linux-gnu} you need binutils 2.12 or newer.
Pre-packaged tools can be obtained from
@uref{ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/}. More
information about this platform is available at
@uref{http://developer.axis.com/}.
@html
</p>
<hr>

View File

@ -588,6 +588,15 @@ in the following sections.
-msmall-exec -mno-small-exec -mmvcle -mno-mvcle @gol
-m64 -m31 -mdebug -mno-debug}
@emph{CRIS Options}
@gccoptlist{
-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol
-mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol
-metrax4 -metrax100 -mpdebug -mcc-init -mno-side-effects @gol
-mstack-align -mdata-align -mconst-align @gol
-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol
-melf -maout -melinux -mlinux -sim -sim2}
@item Code Generation Options
@xref{Code Gen Options,,Options for Code Generation Conventions}.
@gccoptlist{
@ -5096,6 +5105,7 @@ that macro, which enables you to change the defaults.
* IA-64 Options::
* D30V Options::
* S/390 and zSeries Options::
* CRIS Options::
@end menu
@node M680x0 Options
@ -9464,6 +9474,143 @@ The default is to not print debug information.
@end table
@node CRIS Options
@subsection CRIS Options
@cindex CRIS Options
These options are defined specifically for the CRIS ports.
@table @gcctabopt
@item -march=@var{architecture-type}
@itemx -mcpu=@var{architecture-type}
@opindex march
@opindex mcpu
Generate code for the specified architecture. The choices for
@var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX.
Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
@samp{v10}.
@item -mtune=@var{architecture-type}
@opindex mtune
Tune to @var{architecture-type} everything applicable about the generated
code, except for the ABI and the set of available instructions. The
choices for @var{architecture-type} are the same as for
@option{-march=@var{architecture-type}}.
@item -mmax-stack-frame=@var{n}
@opindex mmax-stack-frame
Warn when the stack frame of a function exceeds @var{n} bytes.
@item -melinux-stacksize=@var{n}
@opindex melinux-stacksize
Only available with the @samp{cris-axis-aout} target. Arranges for
indications in the program to the kernel loader that the stack of the
program should be set to @var{n} bytes.
@item -metrax4
@itemx -metrax100
@opindex metrax4
@opindex metrax100
The options @option{-metrax4} and @option{-metrax100} are synonyms for
@option{-march=v3} and @option{-march=v8} respectively.
@item -mpdebug
@opindex mpdebug
Enable CRIS-specific verbose debug-related information in the assembly
code. This option also has the effect to turn off the @samp{#NO_APP}
formatted-code indicator to the assembler at the beginning of the
assembly file.
@item -mcc-init
@opindex mcc-init
Do not use condition-code results from previous instruction; always emit
compare and test instructions before use of condition codes.
@item -mno-side-effects
@opindex mno-side-effects
Do not emit instructions with side-effects in addressing modes other than
post-increment.
@item -mstack-align
@itemx -mno-stack-align
@itemx -mdata-align
@itemx -mno-data-align
@itemx -mconst-align
@itemx -mno-const-align
@opindex mstack-align
@opindex mno-stack-align
@opindex mdata-align
@opindex mno-data-align
@opindex mconst-align
@opindex mno-const-align
These options (no-options) arranges (eliminate arrangements) for the
stack-frame, individual data and constants to be aligned for the maximum
single data access size for the chosen CPU model. The default is to
arrange for 32-bit alignment. ABI details such as structure layout are
not affected by these options.
@item -m32-bit
@itemx -m16-bit
@itemx -m8-bit
@opindex m32-bit
@opindex m16-bit
@opindex m8-bit
Similar to the stack- data- and const-align options above, these options
arrange for stack-frame, writable data and constants to all be 32-bit,
16-bit or 8-bit aligned. The default is 32-bit alignment.
@item -mno-prologue-epilogue
@itemx -mprologue-epilogue
@opindex mno-prologue-epilogue
@opindex mprologue-epilogue
With @option{-mno-prologue-epilogue}, the normal function prologue and
epilogue that sets up the stack-frame are omitted and no return
instructions or return sequences are generated in the code. Use this
option only together with visual inspection of the compiled code: no
warnings or errors are generated when call-saved registers must be saved,
or storage for local variable needs to be allocated.
@item -mno-gotplt
@itemx -mgotplt
@opindex mno-gotplt
@opindex mgotplt
With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
instruction sequences that load addresses for functions from the PLT part
of the GOT rather than (traditional on other architectures) calls to the
PLT. The default is @option{-mgotplt}.
@item -maout
@opindex maout
Legacy no-op option only recognized with the cris-axis-aout target.
@item -melf
@opindex melf
Legacy no-op option only recognized with the cris-axis-elf and
cris-axis-linux-gnu targets.
@item -melinux
@opindex melinux
Only recognized with the cris-axis-aout target, where it selects a
GNU/linux-like multilib, include files and instruction set for
@option{-march=v8}.
@item -mlinux
@opindex mlinux
Legacy no-op option only recognized with the cris-axis-linux-gnu target.
@item -sim
@opindex sim
This option, recognized for the cris-axis-aout and cris-axis-elf arranges
to link with input-output functions from a simulator library. Code,
initialized data and zero-initialized data are allocated consecutively.
@item -sim2
@opindex sim2
Like @option{-sim}, but pass linker options to locate initialized data at
0x40000000 and zero-initialized data at 0x80000000.
@end table
@node Code Gen Options
@section Options for Code Generation Conventions