Commit 9d3f9aa3 by Bernd Schmidt Committed by Bernd Schmidt

bfin.opt (msim): New option.

	2007-02-11  Jie Zhang  <jie.zhang@analog.com>
	* config/bfin/bfin.opt (msim): New option.
	(mcpu=): New option.
	* config/bfin/bfin-protos.h (enum bfin_cpu): New.
	(bfin_cpu_t): Typedef of enum bfin_cpu.
	(bfin_cpu_type): New declaration.
	* config/bfin/elf.h (STARTFILE_SPEC): Add support for
	-msim and -mcpu= options.
	(LIB_SPEC): Likewise.
	* config/bfin/bfin.c (bfin_cpu_type): Define.
	(bfin_handle_option): Handle -mcpu= option.
	* config/bfin/bfin.h (DEFAULT_CPU_TYPE): Define as BFIN_CPU_BF532.
	(TARGET_CPU_CPP_BUILTINS): Define __ADSPBF531__, __ADSPBF532__,
	__ADSPBF533__ or __ADSPBF537__ according to the cpu type.

From-SVN: r123747
parent c18b8a1c
......@@ -17,6 +17,21 @@
(flag_macinit1hi): Tighten constraints.
(flag_mul_macv2hi_parts_acconly): New pattern.
2007-02-11 Jie Zhang <jie.zhang@analog.com>
* config/bfin/bfin.opt (msim): New option.
(mcpu=): New option.
* config/bfin/bfin-protos.h (enum bfin_cpu): New.
(bfin_cpu_t): Typedef of enum bfin_cpu.
(bfin_cpu_type): New declaration.
* config/bfin/elf.h (STARTFILE_SPEC): Add support for
-msim and -mcpu= options.
(LIB_SPEC): Likewise.
* config/bfin/bfin.c (bfin_cpu_type): Define.
(bfin_handle_option): Handle -mcpu= option.
* config/bfin/bfin.h (DEFAULT_CPU_TYPE): Define as BFIN_CPU_BF532.
(TARGET_CPU_CPP_BUILTINS): Define __ADSPBF531__, __ADSPBF532__,
__ADSPBF533__ or __ADSPBF537__ according to the cpu type.
2007-04-12 Richard Sandiford <richard@codesourcery.com>
* config.gcc (*-*-vxworks*): Don't add to tm_files in this stanza.
......
......@@ -23,6 +23,18 @@
#ifndef GCC_BFIN_PROTOS_H
#define GCC_BFIN_PROTOS_H
/* CPU type. */
typedef enum bfin_cpu
{
BFIN_CPU_BF531,
BFIN_CPU_BF532,
BFIN_CPU_BF533,
BFIN_CPU_BF537
} bfin_cpu_t;
/* Value of -mcpu= */
extern bfin_cpu_t bfin_cpu_type;
#define Mmode enum machine_mode
extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int);
......
......@@ -92,6 +92,9 @@ static int bfin_flag_schedule_insns2;
reorganization. */
static int bfin_flag_var_tracking;
/* -mcpu support */
bfin_cpu_t bfin_cpu_type = DEFAULT_CPU_TYPE;
int splitting_for_sched;
static void
......@@ -2058,6 +2061,19 @@ bfin_handle_option (size_t code, const char *arg, int value)
bfin_lib_id_given = 1;
return true;
case OPT_mcpu_:
if (strcmp (arg, "bf531") == 0)
bfin_cpu_type = BFIN_CPU_BF531;
else if (strcmp (arg, "bf532") == 0)
bfin_cpu_type = BFIN_CPU_BF532;
else if (strcmp (arg, "bf533") == 0)
bfin_cpu_type = BFIN_CPU_BF533;
else if (strcmp (arg, "bf537") == 0)
bfin_cpu_type = BFIN_CPU_BF537;
else
return false;
return true;
default:
return true;
}
......
......@@ -34,6 +34,10 @@
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() \
......@@ -42,6 +46,24 @@ extern int target_flags;
builtin_define_std ("bfin"); \
builtin_define_std ("BFIN"); \
builtin_define ("__ADSPBLACKFIN__"); \
builtin_define ("__ADSPLPBLACKFIN__"); \
\
switch (bfin_cpu_type) \
{ \
case BFIN_CPU_BF531: \
builtin_define ("__ADSPBF531__"); \
break; \
case BFIN_CPU_BF532: \
builtin_define ("__ADSPBF532__"); \
break; \
case BFIN_CPU_BF533: \
builtin_define ("__ADSPBF533__"); \
break; \
case BFIN_CPU_BF537: \
builtin_define ("__ADSPBF537__"); \
break; \
} \
\
if (TARGET_FDPIC) \
builtin_define ("__BFIN_FDPIC__"); \
if (TARGET_ID_SHARED_LIBRARY) \
......
......@@ -19,6 +19,14 @@
; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
; 02110-1301, USA.
msim
Target RejectNegative
Use simulator runtime
mcpu=
Target RejectNegative Joined
Specify the name of the target CPU
momit-leaf-frame-pointer
Target Report Mask(OMIT_LEAF_FRAME_POINTER)
Omit frame pointer for leaf functions
......
......@@ -7,11 +7,23 @@
sprintf (LABEL, "*%s%s$%d", LOCAL_LABEL_PREFIX, PREFIX, (int) NUM)
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared: crt0%O%s} crti%O%s crtbegin%O%s crtlibid%O%s"
#define STARTFILE_SPEC "\
%{msim:%{!shared:crt0%O%s}} \
%{!msim:%{mcpu=bf531|mcpu=bf532|mcpu=bf533 \
|mcpu=bf534|mcpu=bf536|mcpu=bf537:crt532%O%s} \
%{!mcpu=*:crt532%O%s}} \
crti%O%s crtbegin%O%s crtlibid%O%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend%O%s crtn%O%s"
#undef LIB_SPEC
#define LIB_SPEC "--start-group -lc %{msim:-lsim}%{!msim:-lnosys} --end-group \
%{!T*:%{!msim:%{mcpu=bf531:-Tbf531.ld}%{mcpu=bf532:-Tbf532.ld} \
%{mcpu=bf533:-Tbf533.ld}%{mcpu=bf534:-Tbf534.ld} \
%{mcpu=bf536:-Tbf536.ld}%{mcpu=bf537:-Tbf537.ld} \
%{!mcpu=*:-Tbf532.ld}}}"
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX "_"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment