aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:35:44 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:35:44 +0000
commit96abdcb1dd3c0dfa332afb3fd26af473222ed569 (patch)
tree0ad58e4e3da2b39d6818ff9e9008dbd9c18828eb
parentf76b9db2874507ed287d1fe39ca2b1e89ae95207 (diff)
downloadgcc-96abdcb1dd3c0dfa332afb3fd26af473222ed569.zip
gcc-96abdcb1dd3c0dfa332afb3fd26af473222ed569.tar.gz
gcc-96abdcb1dd3c0dfa332afb3fd26af473222ed569.tar.bz2
add support for -EL and -EB
From-SVN: r8471
-rw-r--r--gcc/config/mips/dec-bsd.h4
-rw-r--r--gcc/config/mips/dec-osf1.h4
-rw-r--r--gcc/config/mips/iris3.h4
-rw-r--r--gcc/config/mips/iris5.h4
-rw-r--r--gcc/config/mips/mips.c78
-rw-r--r--gcc/config/mips/mips.h69
-rw-r--r--gcc/config/mips/osfrose.h4
-rw-r--r--gcc/config/mips/t-mips7
-rw-r--r--gcc/config/mips/t-mips-gas7
9 files changed, 107 insertions, 74 deletions
diff --git a/gcc/config/mips/dec-bsd.h b/gcc/config/mips/dec-bsd.h
index 0c7c046..8fb46dd 100644
--- a/gcc/config/mips/dec-bsd.h
+++ b/gcc/config/mips/dec-bsd.h
@@ -50,7 +50,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
%{!.S:%{!.s: -D__LANGUAGE_C -D_LANGUAGE_C %{!ansi:-DLANGUAGE_C}}} \
%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mips3:-U__mips -D__mips=3}"
+%{mips3:-U__mips -D__mips=3} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
#endif
/* Always uses GNU ld. */
diff --git a/gcc/config/mips/dec-osf1.h b/gcc/config/mips/dec-osf1.h
index 3c73477..27c2a25 100644
--- a/gcc/config/mips/dec-osf1.h
+++ b/gcc/config/mips/dec-osf1.h
@@ -51,7 +51,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
%{!.S:%{!.s: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}} \
%{mlong64:-D__PTRDIFF_TYPE__=long\\ int} \
-%{!mlong64:-D__PTRDIFF_TYPE__=int}"
+%{!mlong64:-D__PTRDIFF_TYPE__=int} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
/* turn off collect2 COFF support, since ldfcn now has elf declaration */
#undef OBJECT_FORMAT_COFF
diff --git a/gcc/config/mips/iris3.h b/gcc/config/mips/iris3.h
index d075818..da3920a 100644
--- a/gcc/config/mips/iris3.h
+++ b/gcc/config/mips/iris3.h
@@ -38,7 +38,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
%{!.S: %{!.s: %{!.cc: %{!.cxx: %{!.C: %{!.m: -D_LANGUAGE_C %{!ansi:-DLANGUAGE_C}}}}}}} \
%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mips3:-U__mips -D__mips=3}"
+%{mips3:-U__mips -D__mips=3} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
#define LIB_SPEC \
"%{!p:%{!pg:%{!static:%{!g*:-lc_s}} -lc}}%{p:-lc_p}%{pg:-lc_p} crtn.o%s"
diff --git a/gcc/config/mips/iris5.h b/gcc/config/mips/iris5.h
index 5290136..5b1987b 100644
--- a/gcc/config/mips/iris5.h
+++ b/gcc/config/mips/iris5.h
@@ -73,7 +73,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
%{!mlong64: -D_MIPS_SZLONG=32}%{mlong64: -D_MIPS_SZLONG=64} \
%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mips3:-U__mips -D__mips=3}"
+%{mips3:-U__mips -D__mips=3} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
#undef LINK_SPEC
#define LINK_SPEC "\
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 6fa67cf..e22b76b 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1328,9 +1328,8 @@ mips_move_2words (operands, insn)
{
if (TARGET_FLOAT64 && !TARGET_64BIT)
{
- operands[2] = GEN_INT (CONST_DOUBLE_LOW (op1));
- operands[3] = GEN_INT (CONST_DOUBLE_HIGH (op1));
- ret = "li\t%M0,%3\n\tli\t%L0,%2";
+ split_double (op1, operands + 2, operands + 3);
+ ret = "li\t%0,%2\n\tli\t%D0,%3";
}
else
ret = "li.d\t%0,%1\n\tdsll\t%D0,%0,32\n\tdsrl\t%D0,32\n\tdsrl\t%0,32";
@@ -1345,9 +1344,8 @@ mips_move_2words (operands, insn)
else
{
- operands[2] = GEN_INT (CONST_DOUBLE_LOW (op1));
- operands[3] = GEN_INT (CONST_DOUBLE_HIGH (op1));
- ret = "li\t%M0,%3\n\tli\t%L0,%2";
+ split_double (op1, operands + 2, operands + 3);
+ ret = "li\t%0,%2\n\tli\t%D0,%3";
}
}
@@ -2481,19 +2479,22 @@ output_block_move (insn, operands, num_regs, move_type)
/* ??? Fails because of a MIPS assembler bug? */
else if (TARGET_64BIT && bytes >= 8)
{
-#if BYTES_BIG_ENDIAN
- load_store[num].load = "ldl\t%0,%1\n\tldr\t%0,%2";
- load_store[num].load_nop = "ldl\t%0,%1\n\tldr\t%0,%2%#";
- load_store[num].store = "sdl\t%0,%1\n\tsdr\t%0,%2";
- load_store[num].last_store = "sdr\t%0,%2";
- load_store[num].final = "sdl\t%0,%1";
-#else
- load_store[num].load = "ldl\t%0,%2\n\tldr\t%0,%1";
- load_store[num].load_nop = "ldl\t%0,%2\n\tldr\t%0,%1%#";
- load_store[num].store = "sdl\t%0,%2\n\tsdr\t%0,%1";
- load_store[num].last_store = "sdr\t%0,%1";
- load_store[num].final = "sdl\t%0,%2";
-#endif
+ if (BYTES_BIG_ENDIAN)
+ {
+ load_store[num].load = "ldl\t%0,%1\n\tldr\t%0,%2";
+ load_store[num].load_nop = "ldl\t%0,%1\n\tldr\t%0,%2%#";
+ load_store[num].store = "sdl\t%0,%1\n\tsdr\t%0,%2";
+ load_store[num].last_store = "sdr\t%0,%2";
+ load_store[num].final = "sdl\t%0,%1";
+ }
+ else
+ {
+ load_store[num].load = "ldl\t%0,%2\n\tldr\t%0,%1";
+ load_store[num].load_nop = "ldl\t%0,%2\n\tldr\t%0,%1%#";
+ load_store[num].store = "sdl\t%0,%2\n\tsdr\t%0,%1";
+ load_store[num].last_store = "sdr\t%0,%1";
+ load_store[num].final = "sdl\t%0,%2";
+ }
load_store[num].mode = DImode;
offset += 8;
bytes -= 8;
@@ -2514,19 +2515,22 @@ output_block_move (insn, operands, num_regs, move_type)
else if (bytes >= 4)
{
-#if BYTES_BIG_ENDIAN
- load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2";
- load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#";
- load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2";
- load_store[num].last_store = "swr\t%0,%2";
- load_store[num].final = "swl\t%0,%1";
-#else
- load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1";
- load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#";
- load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1";
- load_store[num].last_store = "swr\t%0,%1";
- load_store[num].final = "swl\t%0,%2";
-#endif
+ if (BYTES_BIG_ENDIAN)
+ {
+ load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2";
+ load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#";
+ load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2";
+ load_store[num].last_store = "swr\t%0,%2";
+ load_store[num].final = "swl\t%0,%1";
+ }
+ else
+ {
+ load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1";
+ load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#";
+ load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1";
+ load_store[num].last_store = "swr\t%0,%1";
+ load_store[num].final = "swl\t%0,%2";
+ }
load_store[num].mode = SImode;
offset += 4;
bytes -= 4;
@@ -3623,13 +3627,9 @@ print_operand (file, op, letter)
{
register int regnum = REGNO (op);
- if (letter == 'M')
- regnum += MOST_SIGNIFICANT_WORD;
-
- else if (letter == 'L')
- regnum += LEAST_SIGNIFICANT_WORD;
-
- else if (letter == 'D')
+ if ((letter == 'M' && ! WORDS_BIG_ENDIAN)
+ || (letter == 'L' && WORDS_BIG_ENDIAN)
+ || letter == 'D')
regnum++;
fprintf (file, "%s", reg_names[regnum]);
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 37ca9a9..5347988 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -259,7 +259,7 @@ extern char *mktemp ();
#define MASK_64BIT 0x00002000 /* Use 64 bit GP registers and insns */
#define MASK_EMBEDDED_PIC 0x00004000 /* Generate embedded PIC code */
#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code */
-#define MASK_UNUSED4 0x00010000
+#define MASK_BIG_ENDIAN 0x00010000 /* Generate big endian code */
#define MASK_UNUSED3 0x00020000
#define MASK_UNUSED2 0x00040000
#define MASK_UNUSED1 0x00080000
@@ -338,6 +338,9 @@ extern char *mktemp ();
fastest code. */
#define TARGET_EMBEDDED_DATA (target_flags & MASK_EMBEDDED_DATA)
+ /* generate big endian code. */
+#define TARGET_BIG_ENDIAN (target_flags & MASK_BIG_ENDIAN)
+
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
@@ -378,6 +381,8 @@ extern char *mktemp ();
{"no-embedded-pic", -MASK_EMBEDDED_PIC}, \
{"embedded-data", MASK_EMBEDDED_DATA}, \
{"no-embedded-data", -MASK_EMBEDDED_DATA}, \
+ {"eb", MASK_BIG_ENDIAN}, \
+ {"el", -MASK_BIG_ENDIAN}, \
{"debug", MASK_DEBUG}, \
{"debuga", MASK_DEBUG_A}, \
{"debugb", MASK_DEBUG_B}, \
@@ -389,7 +394,9 @@ extern char *mktemp ();
{"debugh", MASK_DEBUG_H}, \
{"debugi", MASK_DEBUG_I}, \
{"debugj", MASK_DEBUG_J}, \
- {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT} \
+ {"", (TARGET_DEFAULT \
+ | TARGET_CPU_DEFAULT \
+ | TARGET_ENDIAN_DEFAULT)} \
}
/* Default target_flags if no switches are specified */
@@ -402,6 +409,14 @@ extern char *mktemp ();
#define TARGET_CPU_DEFAULT 0
#endif
+#ifndef TARGET_ENDIAN_DEFAULT
+#ifndef DECSTATION
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_ENDIAN
+#else
+#define TARGET_ENDIAN_DEFAULT 0
+#endif
+#endif
+
/* This macro is similar to `TARGET_SWITCHES' but defines names of
command options that have values. Its definition is an
initializer with a subgrouping for each command option.
@@ -648,7 +663,7 @@ while (0)
#define CC1_SPEC "\
%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
%{mips1:-mfp32 -mgp32}%{mips2:-mfp32 -mgp32}%{mips3:-mfp64 -mgp64} \
-%{G*} \
+%{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \
%{pic-none: -mno-half-pic} \
%{pic-lib: -mhalf-pic} \
%{pic-extern: -mhalf-pic} \
@@ -669,7 +684,9 @@ while (0)
%{!.S:%{!.s: -D__LANGUAGE_C -D_LANGUAGE_C %{!ansi:-DLANGUAGE_C}}} \
%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
%{!mlong64:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mips3:-U__mips -D__mips=3}"
+%{mips3:-U__mips -D__mips=3} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
#endif
/* If defined, this macro is an additional prefix to try after
@@ -900,39 +917,27 @@ do { \
/* Target machine storage layout */
+/* Define in order to support both big and little endian float formats
+ in the same gcc binary. */
+#define REAL_ARITHMETIC
+
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields.
*/
#define BITS_BIG_ENDIAN 0
/* Define this if most significant byte of a word is the lowest numbered. */
-#ifndef BYTES_BIG_ENDIAN
-#ifndef DECSTATION
-#define BYTES_BIG_ENDIAN 1
-#else
-#define BYTES_BIG_ENDIAN 0
-#endif
-#endif
+#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
/* Define this if most significant word of a multiword number is the lowest. */
-#ifndef WORDS_BIG_ENDIAN
-#ifndef DECSTATION
-#define WORDS_BIG_ENDIAN 1
-#else
-#define WORDS_BIG_ENDIAN 0
-#endif
-#endif
-
-/* Define macros to easily access the most and least significant words
- without a lot of #ifdef's. */
-
-#if WORDS_BIG_ENDIAN
-#define MOST_SIGNIFICANT_WORD 0
-#define LEAST_SIGNIFICANT_WORD 1
+#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
+/* Define this to set the endianness to use in libgcc2.c, which can
+ not depend on target_flags. */
+#if !defined(MIPSEL) && !defined(__MIPSEL__)
+#define LIBGCC2_WORDS_BIG_ENDIAN 1
#else
-#define MOST_SIGNIFICANT_WORD 1
-#define LEAST_SIGNIFICANT_WORD 0
+#define LIBGCC2_WORDS_BIG_ENDIAN 0
#endif
/* Number of bits in an addressable storage unit */
@@ -2602,9 +2607,13 @@ while (0)
return COSTS_N_INSNS (SYMBOL_REF_FLAG (X) ? 1 : 2); \
\
case CONST_DOUBLE: \
- return COSTS_N_INSNS ((CONST_DOUBLE_HIGH (X) == 0 \
- && CONST_DOUBLE_LOW (X)) ? 2 : 4);
-
+ { \
+ rtx high, low; \
+ split_double (X, &high, &low); \
+ return COSTS_N_INSNS ((high == CONST0_RTX (GET_MODE (high)) \
+ || low == CONST0_RTX (GET_MODE (low))) \
+ ? 2 : 4); \
+ }
/* Like `CONST_COSTS' but applies to nonconstant RTL expressions.
This can be used, for example, to indicate how costly a multiply
diff --git a/gcc/config/mips/osfrose.h b/gcc/config/mips/osfrose.h
index e41f92a..3263e96 100644
--- a/gcc/config/mips/osfrose.h
+++ b/gcc/config/mips/osfrose.h
@@ -80,7 +80,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
%{!.S:%{!.s: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}} \
%{mlong64:-D__PTRDIFF_TYPE__=long\\ int} \
%{!mlong64:-D__PTRDIFF_TYPE__=int} \
-%{mips3:-U__mips -D__mips=3}"
+%{mips3:-U__mips -D__mips=3} \
+%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \
+%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}}"
/* ??? This assumes that GNU as is always used with GNU ld, and MIPS as is
always used with MIPS ld. */
diff --git a/gcc/config/mips/t-mips b/gcc/config/mips/t-mips
index ad90c01..f1915c8 100644
--- a/gcc/config/mips/t-mips
+++ b/gcc/config/mips/t-mips
@@ -6,3 +6,10 @@
# and does not need anything from libgcc1.a.
LIBGCC1 = libgcc1.null
CROSS_LIBGCC1 = libgcc1.null
+
+MULTILIB_OPTIONS=EL/EB
+MULTILIB_DIRNAMES=el eb
+MULTILIB_MATCHES=
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-mips-gas b/gcc/config/mips/t-mips-gas
index 62b481b..69d82f1 100644
--- a/gcc/config/mips/t-mips-gas
+++ b/gcc/config/mips/t-mips-gas
@@ -2,3 +2,10 @@
# and does not need anything from libgcc1.a.
LIBGCC1 = libgcc1.null
CROSS_LIBGCC1 = libgcc1.null
+
+MULTILIB_OPTIONS=EL/EB
+MULTILIB_DIRNAMES=el eb
+MULTILIB_MATCHES=
+
+LIBGCC = stmp-multilib
+INSTALL_LIBGCC = install-multilib