diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2008-05-16 10:28:50 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2008-05-16 10:28:50 +0000 |
commit | 1686960610014d17b0e76fb5f4689b78edbb77f4 (patch) | |
tree | e99329ad8e842d3ca072dc3ad47cbff46ae27d93 /gcc/config/bfin | |
parent | d0569f9fd3d445ceb0235abafeae6e08143b67c5 (diff) | |
download | gcc-1686960610014d17b0e76fb5f4689b78edbb77f4.zip gcc-1686960610014d17b0e76fb5f4689b78edbb77f4.tar.gz gcc-1686960610014d17b0e76fb5f4689b78edbb77f4.tar.bz2 |
From Jie Zhang <jie.zhang@analog.com>
* config/bfin/t-bfin-elf (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Remove mcpu=bf532-0.3,
mcpu=bf561-none and mcpu=bf561-0.2.
* config/bfin/t-bfin-uclinux (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Likewise.
* config/bfin/t-bfin-linux (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Likewise.
* config/bfin/bfin-protos.h (enum bfin_cpu_type): Add
BFIN_CPU_UNKNOWN.
* config/bfin/elf.h (STARTFILE_SPEC): Use specific CRT for
BF561.
(LIB_SPEC): Use proper linker script for bf561. Error if no mcpu
option.
* config/bfin/bfin.c (bfin_cpu_type): Set to BFIN_CPU_UNKNOWN.
(cputype_selected): Remove.
(bfin_handle_option): Don't use cputype_selected.
(override_options): When no mcpu option, enable all workarounds.
Don't use bfin_workarounds.
* config/bfin/bfin.h (DRIVER_SELF_SPECS): Don't set default
processor type.
(DEFAULT_CPU_TYPE): Don't define.
From-SVN: r135413
Diffstat (limited to 'gcc/config/bfin')
-rw-r--r-- | gcc/config/bfin/bfin-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.c | 32 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.h | 13 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.opt | 16 | ||||
-rw-r--r-- | gcc/config/bfin/elf.h | 17 | ||||
-rw-r--r-- | gcc/config/bfin/t-bfin-elf | 20 | ||||
-rw-r--r-- | gcc/config/bfin/t-bfin-linux | 18 | ||||
-rw-r--r-- | gcc/config/bfin/t-bfin-uclinux | 20 |
8 files changed, 103 insertions, 34 deletions
diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h index b1e1108..b068bef 100644 --- a/gcc/config/bfin/bfin-protos.h +++ b/gcc/config/bfin/bfin-protos.h @@ -25,6 +25,7 @@ /* CPU type. */ typedef enum bfin_cpu_type { + BFIN_CPU_UNKNOWN, BFIN_CPU_BF522, BFIN_CPU_BF523, BFIN_CPU_BF524, diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 933b12b..d24570f 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -94,7 +94,7 @@ static int bfin_flag_schedule_insns2; static int bfin_flag_var_tracking; /* -mcpu support */ -bfin_cpu_t bfin_cpu_type = DEFAULT_CPU_TYPE; +bfin_cpu_t bfin_cpu_type = BFIN_CPU_UNKNOWN; /* -msi-revision support. There are three special values: -1 -msi-revision=none. @@ -104,8 +104,6 @@ int bfin_si_revision; /* The workarounds enabled */ unsigned int bfin_workarounds = 0; -static bool cputype_selected = false; - struct bfin_cpu { const char *name; @@ -2378,8 +2376,6 @@ bfin_handle_option (size_t code, const char *arg, int value) q = arg + strlen (p); - cputype_selected = true; - if (*q == '\0') { bfin_si_revision = bfin_cpus[i].si_revision; @@ -2450,6 +2446,17 @@ bfin_init_machine_status (void) void override_options (void) { + /* If processor type is not specified, enable all workarounds. */ + if (bfin_cpu_type == BFIN_CPU_UNKNOWN) + { + int i; + + for (i = 0; bfin_cpus[i].name != NULL; i++) + bfin_workarounds |= bfin_cpus[i].workarounds; + + bfin_si_revision = 0xffff; + } + if (bfin_csync_anomaly == 1) bfin_workarounds |= WA_SPECULATIVE_SYNCS; else if (bfin_csync_anomaly == 0) @@ -2460,9 +2467,6 @@ override_options (void) else if (bfin_specld_anomaly == 0) bfin_workarounds &= ~WA_SPECULATIVE_LOADS; - if (!cputype_selected) - bfin_workarounds |= WA_RETS; - if (TARGET_OMIT_LEAF_FRAME_POINTER) flag_omit_frame_pointer = 1; @@ -2498,6 +2502,18 @@ override_options (void) if (flag_pic && !TARGET_FDPIC && !TARGET_ID_SHARED_LIBRARY) flag_pic = 0; + if (TARGET_MULTICORE && bfin_cpu_type != BFIN_CPU_BF561) + error ("-mmulticore can only be used with BF561"); + + if (TARGET_COREA && !TARGET_MULTICORE) + error ("-mcorea should be used with -mmulticore"); + + if (TARGET_COREB && !TARGET_MULTICORE) + error ("-mcoreb should be used with -mmulticore"); + + if (TARGET_COREA && TARGET_COREB) + error ("-mcorea and -mcoreb can't be used together"); + flag_schedule_insns = 0; /* Passes after sched2 can break the helpful TImode annotations that diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 38f96cb..042528a 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -33,10 +33,6 @@ extern int target_flags; -#ifndef DEFAULT_CPU_TYPE -#define DEFAULT_CPU_TYPE BFIN_CPU_BF532 -#endif - /* Predefinition in the preprocessor for this target machine */ #ifndef TARGET_CPU_CPP_BUILTINS #define TARGET_CPU_CPP_BUILTINS() \ @@ -148,12 +144,19 @@ extern int target_flags; builtin_define ("__ID_SHARED_LIB__"); \ if (flag_no_builtin) \ builtin_define ("__NO_BUILTIN"); \ + if (TARGET_MULTICORE) \ + builtin_define ("__BFIN_MULTICORE"); \ + if (TARGET_COREA) \ + builtin_define ("__BFIN_COREA"); \ + if (TARGET_COREB) \ + builtin_define ("__BFIN_COREB"); \ + if (TARGET_SDRAM) \ + builtin_define ("__BFIN_SDRAM"); \ } \ while (0) #endif #define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS "\ - %{!mcpu=*:-mcpu=bf532} \ %{mleaf-id-shared-library:%{!mid-shared-library:-mid-shared-library}} \ %{mfdpic:%{!fpic:%{!fpie:%{!fPIC:%{!fPIE:\ %{!fno-pic:%{!fno-pie:%{!fno-PIC:%{!fno-PIE:-fpie}}}}}}}}} \ diff --git a/gcc/config/bfin/bfin.opt b/gcc/config/bfin/bfin.opt index ed79e65..9df8843 100644 --- a/gcc/config/bfin/bfin.opt +++ b/gcc/config/bfin/bfin.opt @@ -79,3 +79,19 @@ Enable inlining of PLT in function calls mstack-check-l1 Target Report Mask(STACK_CHECK_L1) Do stack checking using bounds in L1 scratch memory + +mmulticore +Target Report Mask(MULTICORE) +Enable multicore support + +mcorea +Target Report Mask(COREA) +Build for Core A + +mcoreb +Target Report Mask(COREB) +Build for Core B + +msdram +Target Report Mask(SDRAM) +Build for SDRAM diff --git a/gcc/config/bfin/elf.h b/gcc/config/bfin/elf.h index 52a3708..5d317cd 100644 --- a/gcc/config/bfin/elf.h +++ b/gcc/config/bfin/elf.h @@ -1,7 +1,9 @@ #undef STARTFILE_SPEC #define STARTFILE_SPEC "\ %{msim:%{!shared:crt0%O%s}} \ -%{!msim:basiccrt%O%s} \ +%{!msim:%{!mcpu=bf561*:%{!msdram:basiccrt%O%s} %{msdram:basiccrts%O%s};: \ + %{!msdram:basiccrt561%O%s} %{msdram:basiccrt561s%O%s}} \ + %{mcpu=bf561*:%{mmulticore:%{!mcorea:%{!mcoreb:basiccrt561b%O%s}}}}} \ crti%O%s crtbegin%O%s crtlibid%O%s" #undef ENDFILE_SPEC @@ -9,7 +11,8 @@ crti%O%s crtbegin%O%s crtlibid%O%s" #undef LIB_SPEC #define LIB_SPEC "--start-group -lc %{msim:-lsim}%{!msim:-lnosys} --end-group \ -%{!T*:%{!msim:%{mcpu=bf522*:-T bf522.ld%s}%{mcpu=bf523*:-T bf523.ld%s} \ +%{!T*:%{!msim:%{!msdram: \ + %{mcpu=bf522*:-T bf522.ld%s}%{mcpu=bf523*:-T bf523.ld%s} \ %{mcpu=bf524*:-T bf524.ld%s}%{mcpu=bf525*:-T bf525.ld%s} \ %{mcpu=bf526*:-T bf526.ld%s}%{mcpu=bf527*:-T bf527.ld%s} \ %{mcpu=bf531*:-T bf531.ld%s}%{mcpu=bf532*:-T bf532.ld%s} \ @@ -19,8 +22,14 @@ crti%O%s crtbegin%O%s crtlibid%O%s" %{mcpu=bf542*:-T bf542.ld%s}%{mcpu=bf544*:-T bf544.ld%s} \ %{mcpu=bf547*:-T bf547.ld%s}%{mcpu=bf548*:-T bf548.ld%s} \ %{mcpu=bf549*:-T bf549.ld%s} \ - %{!mcpu=*:-T bf532.ld%s} \ - -T bfin-common-sc.ld%s}}" + %{mcpu=bf561*:%{!mmulticore:-T bf561.ld%s} \ + %{mmulticore:%{mcorea:-T bf561a.ld%s}} \ + %{mmulticore:%{mcoreb:-T bf561b.ld%s}} \ + %{mmulticore:%{!mcorea:%{!mcoreb:-T bf561m.ld%s}}}} \ + %{!mcpu=*:%eno processor type specified for linking} \ + %{!mcpu=bf561*:-T bfin-common-sc.ld%s} \ + %{mcpu=bf561*:%{!mmulticore:-T bfin-common-sc.ld%s} \ + %{mmulticore:-T bfin-common-mc.ld%s}}}}}" #undef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" diff --git a/gcc/config/bfin/t-bfin-elf b/gcc/config/bfin/t-bfin-elf index d81da3c..35fafd2 100644 --- a/gcc/config/bfin/t-bfin-elf +++ b/gcc/config/bfin/t-bfin-elf @@ -17,14 +17,22 @@ fp-bit.c: $(srcdir)/config/fp-bit.c CRTSTUFF_T_CFLAGS = -fpic TARGET_LIBGCC2_CFLAGS = -fpic -MULTILIB_OPTIONS=mcpu=bf532-none/mcpu=bf532-0.3 +MULTILIB_OPTIONS=mcpu=bf532-none MULTILIB_OPTIONS+=mid-shared-library/msep-data/mfdpic mleaf-id-shared-library -MULTILIB_DIRNAMES=bf532-none bf532-0.3 mid-shared-library msep-data mfdpic mleaf-id-shared-library -MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf561 -MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf561-none mcpu?bf532-none=mcpu?bf561-0.5 -MULTILIB_MATCHES+=mcpu?bf532-0.3=mcpu?bf531-0.4 mcpu?bf532-0.3=mcpu?bf531-0.3 mcpu?bf532-0.3=mcpu?bf532-0.4 mcpu?bf532-0.3=mcpu?bf534-0.4 mcpu?bf532-0.3=mcpu?bf534-0.3 mcpu?bf532-0.3=mcpu?bf534-0.2 mcpu?bf532-0.3=mcpu?bf534-0.1 mcpu?bf532-0.3=mcpu?bf536-0.2 mcpu?bf532-0.3=mcpu?bf536-0.1 mcpu?bf532-0.3=mcpu?bf537-0.2 mcpu?bf532-0.3=mcpu?bf537-0.1 mcpu?bf532-0.3=mcpu?bf561-0.3 mcpu?bf532-0.3=mcpu?bf561-0.2 mcpu?bf532-0.3=mcpu?bf531-any mcpu?bf532-0.3=mcpu?bf532-any mcpu?bf532-0.3=mcpu?bf533-any mcpu?bf532-0.3=mcpu?bf534-any mcpu?bf532-0.3=mcpu?bf536-any mcpu?bf532-0.3=mcpu?bf537-any mcpu?bf532-0.3=mcpu?bf561-any +MULTILIB_DIRNAMES=bf532-none mid-shared-library msep-data mfdpic mleaf-id-shared-library + +MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf522-none mcpu?bf532-none=mcpu?bf523-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf524-none mcpu?bf532-none=mcpu?bf525-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf526-none mcpu?bf532-none=mcpu?bf527-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf538-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf539-none mcpu?bf532-none=mcpu?bf542-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf544-none mcpu?bf532-none=mcpu?bf547-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf548-none mcpu?bf532-none=mcpu?bf549-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf561-none + MULTILIB_EXCEPTIONS=mleaf-id-shared-library* -MULTILIB_EXCEPTIONS+=mcpu=bf532-0.3/mleaf-id-shared-library* MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library* MULTILIB_EXCEPTIONS+=*mfdpic/mleaf-id-shared-library* MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library* diff --git a/gcc/config/bfin/t-bfin-linux b/gcc/config/bfin/t-bfin-linux index 849dcee..782d0ca 100644 --- a/gcc/config/bfin/t-bfin-linux +++ b/gcc/config/bfin/t-bfin-linux @@ -17,11 +17,19 @@ fp-bit.c: $(srcdir)/config/fp-bit.c CRTSTUFF_T_CFLAGS = -fpic TARGET_LIBGCC2_CFLAGS = -fpic -MULTILIB_OPTIONS=mcpu=bf532-none/mcpu=bf532-0.3 -MULTILIB_DIRNAMES=bf532-none bf532-0.3 -MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf561 -MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf561-none mcpu?bf532-none=mcpu?bf561-0.5 -MULTILIB_MATCHES+=mcpu?bf532-0.3=mcpu?bf531-0.4 mcpu?bf532-0.3=mcpu?bf531-0.3 mcpu?bf532-0.3=mcpu?bf532-0.4 mcpu?bf532-0.3=mcpu?bf533-0.4 mcpu?bf532-0.3=mcpu?bf533-0.3 mcpu?bf532-0.3=mcpu?bf534-0.2 mcpu?bf532-0.3=mcpu?bf534-0.1 mcpu?bf532-0.3=mcpu?bf536-0.2 mcpu?bf532-0.3=mcpu?bf536-0.1 mcpu?bf532-0.3=mcpu?bf537-0.2 mcpu?bf532-0.3=mcpu?bf537-0.1 mcpu?bf532-0.3=mcpu?bf561-0.3 mcpu?bf532-0.3=mcpu?bf561-0.2 mcpu?bf532-0.3=mcpu?bf531-any mcpu?bf532-0.3=mcpu?bf532-any mcpu?bf532-0.3=mcpu?bf533-any mcpu?bf532-0.3=mcpu?bf534-any mcpu?bf532-0.3=mcpu?bf536-any mcpu?bf532-0.3=mcpu?bf537-any mcpu?bf532-0.3=mcpu?bf561-any +MULTILIB_OPTIONS=mcpu=bf532-none +MULTILIB_DIRNAMES=bf532-none + +MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf522-none mcpu?bf532-none=mcpu?bf523-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf524-none mcpu?bf532-none=mcpu?bf525-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf526-none mcpu?bf532-none=mcpu?bf527-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf538-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf539-none mcpu?bf532-none=mcpu?bf542-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf544-none mcpu?bf532-none=mcpu?bf547-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf548-none mcpu?bf532-none=mcpu?bf549-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf561-none SHLIB_MAPFILES=$(srcdir)/config/bfin/libgcc-bfin.ver diff --git a/gcc/config/bfin/t-bfin-uclinux b/gcc/config/bfin/t-bfin-uclinux index 4668653..437666a 100644 --- a/gcc/config/bfin/t-bfin-uclinux +++ b/gcc/config/bfin/t-bfin-uclinux @@ -17,14 +17,22 @@ fp-bit.c: $(srcdir)/config/fp-bit.c CRTSTUFF_T_CFLAGS = -fpic TARGET_LIBGCC2_CFLAGS = -fpic -MULTILIB_OPTIONS=mcpu=bf532-none/mcpu=bf532-0.3 +MULTILIB_OPTIONS=mcpu=bf532-none MULTILIB_OPTIONS+=mid-shared-library/msep-data mleaf-id-shared-library -MULTILIB_DIRNAMES=bf532-none bf532-0.3 mid-shared-library msep-data mleaf-id-shared-library -MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf561 -MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf561-none mcpu?bf532-none=mcpu?bf561-0.5 -MULTILIB_MATCHES+=mcpu?bf532-0.3=mcpu?bf531-0.4 mcpu?bf532-0.3=mcpu?bf531-0.3 mcpu?bf532-0.3=mcpu?bf532-0.4 mcpu?bf532-0.3=mcpu?bf533-0.4 mcpu?bf532-0.3=mcpu?bf533-0.3 mcpu?bf532-0.3=mcpu?bf534-0.2 mcpu?bf532-0.3=mcpu?bf534-0.1 mcpu?bf532-0.3=mcpu?bf536-0.2 mcpu?bf532-0.3=mcpu?bf536-0.1 mcpu?bf532-0.3=mcpu?bf537-0.2 mcpu?bf532-0.3=mcpu?bf537-0.1 mcpu?bf532-0.3=mcpu?bf561-0.3 mcpu?bf532-0.3=mcpu?bf561-0.2 mcpu?bf532-0.3=mcpu?bf531-any mcpu?bf532-0.3=mcpu?bf532-any mcpu?bf532-0.3=mcpu?bf533-any mcpu?bf532-0.3=mcpu?bf534-any mcpu?bf532-0.3=mcpu?bf536-any mcpu?bf532-0.3=mcpu?bf537-any mcpu?bf532-0.3=mcpu?bf561-any +MULTILIB_DIRNAMES=bf532-none mid-shared-library msep-data mleaf-id-shared-library + +MULTILIB_MATCHES=mcpu?bf532-none=mcpu?bf522-none mcpu?bf532-none=mcpu?bf523-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf524-none mcpu?bf532-none=mcpu?bf525-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf526-none mcpu?bf532-none=mcpu?bf527-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf531-none mcpu?bf532-none=mcpu?bf533-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf534-none mcpu?bf532-none=mcpu?bf536-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf537-none mcpu?bf532-none=mcpu?bf538-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf539-none mcpu?bf532-none=mcpu?bf542-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf544-none mcpu?bf532-none=mcpu?bf547-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf548-none mcpu?bf532-none=mcpu?bf549-none +MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf561-none + MULTILIB_EXCEPTIONS=mleaf-id-shared-library* -MULTILIB_EXCEPTIONS+=mcpu=bf532-0.3/mleaf-id-shared-library* MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library* MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library* |