summaryrefslogtreecommitdiff
path: root/gcc/config/moxie
diff options
context:
space:
mode:
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-13 23:35:48 +0000
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-13 23:35:48 +0000
commit6ae1c73e3d6595f758bced5e2be0eba3cd056a88 (patch)
tree8bd0fde963766978acebadafd751ef93c218c9b8 /gcc/config/moxie
parent8eba82c2c6494554a413467fde6b5eba8650aa58 (diff)
downloadgcc-6ae1c73e3d6595f758bced5e2be0eba3cd056a88.tar.gz
Bi-endian support for moxie
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/moxie')
-rw-r--r--gcc/config/moxie/moxie.h19
-rw-r--r--gcc/config/moxie/moxie.opt27
-rw-r--r--gcc/config/moxie/t-moxie3
3 files changed, 44 insertions, 5 deletions
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index c80d26c5ae9..7604ac427a0 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -41,9 +41,13 @@
#define LIB_SPEC "%{!shared:%{!symbolic:-lc}}"
#undef LINK_SPEC
-#define LINK_SPEC "%{h*} %{v:-V} \
+#define LINK_SPEC "%{h*} %{v:-V} %{!mel:-EB} %{mel:-EL}\
%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic}"
+#ifndef MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS { "meb" }
+#endif
+
/* Layout of Source Language Data Types */
#define INT_TYPE_SIZE 32
@@ -192,6 +196,7 @@ enum reg_class
/* The Overall Framework of an Assembler File */
#undef ASM_SPEC
+#define ASM_SPEC "%{!mel:-EB} %{mel:-EL}"
#define ASM_COMMENT_START "#"
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
@@ -291,8 +296,8 @@ enum reg_class
/* Storage Layout */
#define BITS_BIG_ENDIAN 0
-#define BYTES_BIG_ENDIAN 1
-#define WORDS_BIG_ENDIAN 1
+#define BYTES_BIG_ENDIAN ( ! TARGET_LITTLE_ENDIAN )
+#define WORDS_BIG_ENDIAN ( ! TARGET_LITTLE_ENDIAN )
/* Alignment required for a function entry point, in bits. */
#define FUNCTION_BOUNDARY 16
@@ -473,8 +478,12 @@ enum reg_class
#define TARGET_CPU_CPP_BUILTINS() \
{ \
- builtin_define_std ("moxie"); \
- builtin_define_std ("MOXIE"); \
+ builtin_define_std ("moxie"); \
+ builtin_define_std ("MOXIE"); \
+ if (TARGET_LITTLE_ENDIAN) \
+ builtin_define ("__MOXIE_LITTLE_ENDIAN__"); \
+ else \
+ builtin_define ("__MOXIE_BIG_ENDIAN__"); \
}
#define HAS_LONG_UNCOND_BRANCH true
diff --git a/gcc/config/moxie/moxie.opt b/gcc/config/moxie/moxie.opt
new file mode 100644
index 00000000000..00f3ff82cc8
--- /dev/null
+++ b/gcc/config/moxie/moxie.opt
@@ -0,0 +1,27 @@
+; Options for the moxie compiler port.
+
+; Copyright (C) 2012 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 3, 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 COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+meb
+Target RejectNegative Report InverseMask(LITTLE_ENDIAN)
+Generate big-endian code
+
+mel
+Target RejectNegative Report Mask(LITTLE_ENDIAN)
+Generate little-endian code
diff --git a/gcc/config/moxie/t-moxie b/gcc/config/moxie/t-moxie
index 5498ecbb354..9111fd603ab 100644
--- a/gcc/config/moxie/t-moxie
+++ b/gcc/config/moxie/t-moxie
@@ -18,3 +18,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+MULTILIB_OPTIONS = meb/mel
+MULTILIB_DIRNAMES = eb el
+