summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-16 04:12:25 +0000
committerbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-16 04:12:25 +0000
commit8e80b4520e259086551b61242488a1c9f1000f47 (patch)
tree45364d7fffff828f2ab90d8eb69bf68535809e99 /gcc
parentf9854e90ac189d83fba9b71eb51de6cf23e558c3 (diff)
downloadgcc-8e80b4520e259086551b61242488a1c9f1000f47.tar.gz
* config.gcc, config/m68k/linux.h: Implement with-cpu for m68k-linux.
* longlong.h: Make code 68060 clean when compiling for m68060. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79524 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config.gcc45
-rw-r--r--gcc/config/m68k/linux.h8
-rw-r--r--gcc/longlong.h10
4 files changed, 62 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 635e5ae31db..b5f6e95299e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
+
+ * config.gcc, config/m68k/linux.h: Implement with-cpu for m68k-linux.
+ * longlong.h: Make code 68060 clean when compiling for m68060.
+
2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
* config/m68k/m68k.md: Fix constraints for bitfield instructions.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 189ff02eb7b..7dfadfd973c 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2302,6 +2302,20 @@ fi
esac
;;
+ m68k*-linux*)
+ supported_defaults="cpu"
+ case "$with_cpu" in
+ "" | "m68020" | "m68030" | "m68040" | "m68060" | "m68020-40" | "m68020-60")
+ # OK
+ ;;
+ *)
+ echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2
+ echo "m68020 m68030 m68040 m68060 m68020-40 m68020-60" 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+
hppa*-*-* | parisc*-*-*)
supported_defaults="arch schedule"
@@ -2494,6 +2508,37 @@ fi
esac
;;
+ m68k*-linux*)
+ case "x$with_cpu" in
+ x)
+ # The most generic
+ target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)"
+ ;;
+ xm68020)
+ target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)"
+ ;;
+ xm68030)
+ target_cpu_default2="(MASK_68030|MASK_68020|MASK_68881|MASK_BITFIELD)"
+ ;;
+ xm68040)
+ target_cpu_default2="(MASK_68040|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)"
+ ;;
+ xm68060)
+ target_cpu_default2="(MASK_68060|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)"
+ ;;
+ xm68020-40)
+ target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)"
+ ;;
+ xm68020-60)
+ target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040|MASK_68060)"
+ ;;
+ *)
+ echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+
hppa*-*-* | parisc*-*-*)
if test x$gas = xyes
then
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 687e0b0d297..a5859a1d672 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -23,8 +23,14 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (68k GNU/Linux with ELF)");
-/* 68020 with 68881 */
+/* Default target comes from config.gcc. */
+
+#undef TARGET_DEFAULT
+#ifdef TARGET_CPU_DEFAULT
+#define TARGET_DEFAULT TARGET_CPU_DEFAULT
+#else
#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
+#endif
/* for 68k machines this only needs to be TRUE for the 68000 */
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 03150201103..0f5d05ffe2d 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -415,7 +415,7 @@ UDItype __umulsidi3 (USItype, USItype);
"g" ((USItype) (bl)))
/* The '020, '030, '040, '060 and CPU32 have 32x32->64 and 64/32->32q-32r. */
-#if defined (__mc68020__)
+#if (defined (__mc68020__) && !defined (__mc68060__))
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("mulu%.l %3,%1:%0" \
: "=d" ((USItype) (w0)), \
@@ -439,8 +439,8 @@ UDItype __umulsidi3 (USItype, USItype);
"1" ((USItype) (n1)), \
"dmi" ((USItype) (d)))
-#else /* not mc68020 */
-#if defined(__mcoldfire__)
+#elif defined (__mcoldfire__) /* not mc68020 */
+
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("| Inlined umul_ppmm\n" \
" move%.l %2,%/d0\n" \
@@ -511,12 +511,12 @@ UDItype __umulsidi3 (USItype, USItype);
: "d0", "d1", "d2", "d3", "d4")
#define UMUL_TIME 100
#define UDIV_TIME 400
-#endif /* not ColdFire */
+
#endif /* not mc68020 */
/* The '020, '030, '040 and '060 have bitfield insns.
cpu32 disguises as a 68020, but lacks them. */
-#if defined (__mc68020__) && !defined(__mcpu32__)
+#if defined (__mc68020__) && !defined (__mcpu32__)
#define count_leading_zeros(count, x) \
__asm__ ("bfffo %1{%b2:%b2},%0" \
: "=d" ((USItype) (count)) \