aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/h8300
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2015-04-28 04:16:27 +0900
committerJeff Law <law@gcc.gnu.org>2015-04-27 13:16:27 -0600
commit2f6bd6eb67a11faef36ab3420cf6783de15e4760 (patch)
treea67446cf5b576ae16aac0ce5b4210d02ea3e99ef /gcc/config/h8300
parentd5302f06b81185a1c785263358f204fc0f5bdba2 (diff)
downloadgcc-2f6bd6eb67a11faef36ab3420cf6783de15e4760.zip
gcc-2f6bd6eb67a11faef36ab3420cf6783de15e4760.tar.gz
gcc-2f6bd6eb67a11faef36ab3420cf6783de15e4760.tar.bz2
config.gcc: Add h8300-*-linux.
gcc/ * config.gcc: Add h8300-*-linux. * config/h8300/linux.h: New. * config/h8300/t-linux: New. * config/h8300/h8300.c (h8300_option_override): Normal mode is not supported for h8300-*-linux. (h8300_file_start): Target priority change. (get_shift_alg): Likewise. (h8300_shift_need_scratch_p): Likewise. * config/h8300/h8300.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/h8300/h8300.md (define_peephole2): Remove duplicate condition. libgcc/ * config.host: Add h8300-*-linux * config/h8300/t-linux: New file. * config/h8300/lib1funs.s: Change symbol prefix. * config/h8300/sfp-machine.h: 64bit double support. From-SVN: r222479
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r--gcc/config/h8300/h8300.c26
-rw-r--r--gcc/config/h8300/h8300.h20
-rw-r--r--gcc/config/h8300/h8300.md2
-rw-r--r--gcc/config/h8300/linux.h50
-rw-r--r--gcc/config/h8300/t-linux20
5 files changed, 98 insertions, 20 deletions
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 4e9110e..00087f3 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -406,6 +406,14 @@ h8300_option_override (void)
- Option ignored!");
}
+#ifdef H8300_LINUX
+ if ((TARGET_NORMAL_MODE))
+ {
+ error ("-mn is not supported for linux targets");
+ target_flags ^= MASK_NORMAL_MODE;
+ }
+#endif
+
/* Some of the shifts are optimized for speed by default.
See http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01858.html
If optimizing for size, change shift_alg for those shift to
@@ -1006,12 +1014,12 @@ h8300_file_start (void)
{
default_file_start ();
- if (TARGET_H8300H)
- fputs (TARGET_NORMAL_MODE ? "\t.h8300hn\n" : "\t.h8300h\n", asm_out_file);
- else if (TARGET_H8300SX)
+ if (TARGET_H8300SX)
fputs (TARGET_NORMAL_MODE ? "\t.h8300sxn\n" : "\t.h8300sx\n", asm_out_file);
else if (TARGET_H8300S)
fputs (TARGET_NORMAL_MODE ? "\t.h8300sn\n" : "\t.h8300s\n", asm_out_file);
+ else if (TARGET_H8300H)
+ fputs (TARGET_NORMAL_MODE ? "\t.h8300hn\n" : "\t.h8300h\n", asm_out_file);
}
/* Output assembly language code for the end of file. */
@@ -4094,10 +4102,10 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode,
/* Find the target CPU. */
if (TARGET_H8300)
cpu = H8_300;
- else if (TARGET_H8300H)
- cpu = H8_300H;
- else
+ else if (TARGET_H8300S)
cpu = H8_S;
+ else
+ cpu = H8_300H;
/* Find the shift algorithm. */
info->alg = SHIFT_LOOP;
@@ -4540,10 +4548,10 @@ h8300_shift_needs_scratch_p (int count, machine_mode mode)
/* Find out the target CPU. */
if (TARGET_H8300)
cpu = H8_300;
- else if (TARGET_H8300H)
- cpu = H8_300H;
- else
+ else if (TARGET_H8300S)
cpu = H8_S;
+ else
+ cpu = H8_300H;
/* Find the shift algorithm. */
switch (mode)
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 2a47aa8..86fd7d1 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -39,29 +39,29 @@ extern const char * const *h8_reg_names;
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- if (TARGET_H8300H) \
+ if (TARGET_H8300SX) \
{ \
- builtin_define ("__H8300H__"); \
- builtin_assert ("cpu=h8300h"); \
- builtin_assert ("machine=h8300h"); \
+ builtin_define ("__H8300SX__"); \
if (TARGET_NORMAL_MODE) \
{ \
builtin_define ("__NORMAL_MODE__"); \
} \
} \
- else if (TARGET_H8300SX) \
+ else if (TARGET_H8300S) \
{ \
- builtin_define ("__H8300SX__"); \
+ builtin_define ("__H8300S__"); \
+ builtin_assert ("cpu=h8300s"); \
+ builtin_assert ("machine=h8300s"); \
if (TARGET_NORMAL_MODE) \
{ \
builtin_define ("__NORMAL_MODE__"); \
} \
} \
- else if (TARGET_H8300S) \
+ else if (TARGET_H8300H) \
{ \
- builtin_define ("__H8300S__"); \
- builtin_assert ("cpu=h8300s"); \
- builtin_assert ("machine=h8300s"); \
+ builtin_define ("__H8300H__"); \
+ builtin_assert ("cpu=h8300h"); \
+ builtin_assert ("machine=h8300h"); \
if (TARGET_NORMAL_MODE) \
{ \
builtin_define ("__NORMAL_MODE__"); \
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index dfd082c..4079b30 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -5847,7 +5847,7 @@
(pc)))]
"(TARGET_H8300H || TARGET_H8300S)
&& peep2_reg_dead_p (1, operands[0])
- && ((TARGET_H8300H && INTVAL (operands[1]) == 3)
+ && (INTVAL (operands[1]) == 3
|| INTVAL (operands[1]) == 7
|| INTVAL (operands[1]) == 15
|| INTVAL (operands[1]) == 31
diff --git a/gcc/config/h8300/linux.h b/gcc/config/h8300/linux.h
new file mode 100644
index 0000000..ef31e86
--- /dev/null
+++ b/gcc/config/h8300/linux.h
@@ -0,0 +1,50 @@
+/* Definitions of target machine for GNU compiler.
+ Renesas H8/300 (linux variant)
+ Copyright (C) 2015
+ Free Software Foundation, Inc.
+ Contributed by Yoshinori Sato <ysato@users.sourceforge.jp>
+
+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/>. */
+
+#ifndef GCC_H8300_LINUX_H
+#define GCC_H8300_LINUX_H
+
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
+ } \
+ while (0)
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{mh:-mh8300helf_linux} %{ms:-m h8300self_linux} %{msx:-m h8300sxelf_linux}"
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_QUICKCALL | MASK_INT32 | MASK_H8300H)
+
+/* Width of a word, in units (bytes). */
+#undef DOUBLE_TYPE_SIZE
+#define DOUBLE_TYPE_SIZE 64
+
+#undef DEFAULT_SIGNED_CHAR
+#define DEFAULT_SIGNED_CHAR 1
+
+#undef USER_LABEL_PREFIX
+
+#define H8300_LINUX
+
+#endif /* ! GCC_H8300_LINUX_H */
diff --git a/gcc/config/h8300/t-linux b/gcc/config/h8300/t-linux
new file mode 100644
index 0000000..11237ea
--- /dev/null
+++ b/gcc/config/h8300/t-linux
@@ -0,0 +1,20 @@
+# Copyright (C) 2015 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/>.
+
+MULTILIB_OPTIONS = ms/msx
+MULTILIB_DIRNAMES = h8300s h8sx