From: Sterling Augustine Date: Wed, 7 Jan 2009 17:41:09 +0000 (+0000) Subject: 2009-01-07 Sterling Augustine X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19fc37235f75095174fe9d679e94b686b9c8ee9f;p=binutils-gdb.git 2009-01-07 Sterling Augustine * config/tc-xtensa.c (produce_flix): New. (option_flix, optoin_no_generate_flix, option_no_flix) Define. (md_longopts): Add support for them. (md_parse_option): Likewise. (md_show_usage): Add help message. (finish_vinsn): Don't allow multi-slot flix when produce_flix option is set to FLIX_NONE. * config/xtensa-relax.c (transition_applies): Only relax to flix branches when produce_flix equals FLIX_ALL. * config/xtensa-relax.h (flix_level, FLIX_ALL, FLIX_NO_GENERATE FLIX_NONE): New. (produce_flix): Declare. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index cfb6fd39a64..0630b313cce 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,18 @@ +2009-01-07 Sterling Augustine + + * config/tc-xtensa.c (produce_flix): New. + (option_flix, optoin_no_generate_flix, option_no_flix) Define. + (md_longopts): Add support for them. + (md_parse_option): Likewise. + (md_show_usage): Add help message. + (finish_vinsn): Don't allow multi-slot flix when produce_flix + option is set to FLIX_NONE. + * config/xtensa-relax.c (transition_applies): Only relax to + flix branches when produce_flix equals FLIX_ALL. + * config/xtensa-relax.h (flix_level, FLIX_ALL, FLIX_NO_GENERATE + FLIX_NONE): New. + (produce_flix): Declare. + 2009-01-06 Chao-ying Fu * config/tc-mips.c (mips_ip): Set lastregno to 0xffffffff. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 6646ef7be66..04e96d3b4f3 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -591,6 +591,7 @@ static xtensa_opcode xtensa_waiti_opcode; /* Command-line Options. */ bfd_boolean use_literal_section = TRUE; +enum flix_level produce_flix = FLIX_ALL; static bfd_boolean align_targets = TRUE; static bfd_boolean warn_unaligned_branch_targets = FALSE; static bfd_boolean has_a0_b_retw = FALSE; @@ -635,6 +636,10 @@ enum option_density = OPTION_MD_BASE, option_no_density, + option_flix, + option_no_generate_flix, + option_no_flix, + option_relax, option_no_relax, @@ -693,6 +698,10 @@ struct option md_longopts[] = { "density", no_argument, NULL, option_density }, { "no-density", no_argument, NULL, option_no_density }, + { "flix", no_argument, NULL, option_flix }, + { "no-generate-flix", no_argument, NULL, option_no_generate_flix }, + { "no-allow-flix", no_argument, NULL, option_no_flix }, + /* Both "relax" and "generics" are deprecated and treated as equivalent to the "transform" option. */ { "relax", no_argument, NULL, option_relax }, @@ -775,6 +784,15 @@ md_parse_option (int c, char *arg) case option_no_link_relax: linkrelax = 0; return 1; + case option_flix: + produce_flix = FLIX_ALL; + return 1; + case option_no_generate_flix: + produce_flix = FLIX_NO_GENERATE; + return 1; + case option_no_flix: + produce_flix = FLIX_NONE; + return 1; case option_generics: as_warn (_("--generics is deprecated; use --transform instead")); return md_parse_option (option_transform, arg); @@ -941,6 +959,11 @@ Xtensa options:\n\ --[no-]target-align [Do not] try to align branch targets\n\ --[no-]longcalls [Do not] emit 32-bit call sequences\n\ --[no-]transform [Do not] transform instructions\n\ + --flix both allow hand-written and generate flix bundles\n\ + --no-generate-flix allow hand-written but do not generate\n\ + flix bundles\n\ + --no-allow-flix neither allow hand-written nor generate\n\ + flix bundles\n\ --rename-section old=new Rename section 'old' to 'new'\n", stream); } @@ -6180,6 +6203,14 @@ finish_vinsn (vliw_insn *vinsn) if (vinsn->format == XTENSA_UNDEFINED) vinsn->format = xg_find_narrowest_format (vinsn); + if (xtensa_format_num_slots (xtensa_default_isa, vinsn->format) > 1 + && produce_flix == FLIX_NONE) + { + as_bad (_("The option \"--no-allow-flix\" prohibits multi-slot flix.")); + xg_clear_vinsn (vinsn); + return; + } + if (vinsn->format == XTENSA_UNDEFINED) { as_where (&file_name, &line); diff --git a/gas/config/xtensa-relax.c b/gas/config/xtensa-relax.c index 5de7dd28c55..f4e9bb1c044 100644 --- a/gas/config/xtensa-relax.c +++ b/gas/config/xtensa-relax.c @@ -1543,9 +1543,12 @@ transition_applies (insn_pattern *initial_insn, else if (!strcmp (option_name, "Loops")) option_available = (XCHAL_HAVE_LOOPS == 1); else if (!strcmp (option_name, "WideBranches")) - option_available = (XCHAL_HAVE_WIDE_BRANCHES == 1); + option_available + = (XCHAL_HAVE_WIDE_BRANCHES == 1 && produce_flix == FLIX_ALL); else if (!strcmp (option_name, "PredictedBranches")) - option_available = (XCHAL_HAVE_PREDICTED_BRANCHES == 1); + option_available + = (XCHAL_HAVE_PREDICTED_BRANCHES == 1 + && produce_flix == FLIX_ALL); else if (!strcmp (option_name, "Booleans")) option_available = (XCHAL_HAVE_BOOLEANS == 1); else diff --git a/gas/config/xtensa-relax.h b/gas/config/xtensa-relax.h index 6cb8fcc989f..f7fb574c7ed 100644 --- a/gas/config/xtensa-relax.h +++ b/gas/config/xtensa-relax.h @@ -177,4 +177,13 @@ extern TransitionTable *xg_build_widen_table (transition_cmp_fn); extern bfd_boolean xg_has_userdef_op_fn (OpType); extern long xg_apply_userdef_op_fn (OpType, long); +enum flix_level +{ + FLIX_ALL, + FLIX_NO_GENERATE, + FLIX_NONE +}; + +extern enum flix_level produce_flix; + #endif /* !XTENSA_RELAX_H */