OSDN Git Service

* config.gcc, config/m68k/linux.h: Implement with-cpu for m68k-linux.
authorbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Mar 2004 04:12:25 +0000 (04:12 +0000)
committerbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Mar 2004 04:12:25 +0000 (04:12 +0000)
* 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

gcc/ChangeLog
gcc/config.gcc
gcc/config/m68k/linux.h
gcc/longlong.h

index 635e5ae..b5f6e95 100644 (file)
@@ -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.
index 189ff02..7dfadfd 100644 (file)
@@ -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
index 687e0b0..a5859a1 100644 (file)
@@ -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 */
 
index 0315020..0f5d05f 100644 (file)
@@ -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))                                   \