This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ia64: add option to suppress warnings about A/B-step errata
- From: Zack Weinberg <zack at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Sat, 10 Apr 2004 11:48:19 -0700
- Subject: ia64: add option to suppress warnings about A/B-step errata
There aren't very many ia64 A or B step chips out there, so the
assembler warnings about additional NOPs needed to avoid their
errata aren't very useful. This patch turns them off by default,
and adds an option -mb-step to turn them back on. This name
matches the GCC option which instructs the compiler to generate
those additional NOPs - the idea is that GCC will pass the option
along to the assembler, and the assembler will catch mistakes in
GCC's code generation, or in hand-written inline assembly.
Unfortunately the assembler does not ignore unrecognized -m options,
so there is a compatibility issue if I make GCC 3.4 (say) start
passing -mb-step along to the assembler, but it will only affect
people who want to use brand new GCC to generate code for these old
chips - I think it can be handled with a release note.
I tested the patch with this code fragment:
mov r2 = 12345
fcmp.eq p6,p7 = f0,f1 ;;
(p6) mov r2 = 67890 ;;
st8 [r2] = r0
$ ./as-new test.s
$ ./as-new -mb-step test.s
test.s: Assembler messages:
test.s:4: Warning: Additional NOP may be necessary to workaround
Itanium processor A/B step errata
If this patch is approved I would like it to be included on the 2.15
release branch as well as mainline.
Comments? Where should this be documented? How do I add test cases?
zw
* config/tc-ia64.c (struct md): Add detect_b_step_errata flag.
(md_parse_option): Set it when -mb-step.
(emit_one_bundle): Check it before calling errata_nop_necessary_p.
===================================================================
Index: gas/config/tc-ia64.c
--- gas/config/tc-ia64.c 9 Apr 2004 18:28:11 -0000 1.101.4.1
+++ gas/config/tc-ia64.c 10 Apr 2004 18:45:10 -0000
@@ -220,6 +220,7 @@ static struct
manual_bundling : 1,
debug_dv: 1,
detect_dv: 1,
+ detect_b_step_errata: 1,
explicit_mode : 1, /* which mode we're in */
default_explicit_mode : 1, /* which mode is the default */
mode_explicitly_set : 1, /* was the current mode explicitly set? */
@@ -6351,7 +6352,8 @@ emit_one_bundle ()
dwarf2_gen_line_info (addr, &md.slot[curr].debug_line);
}
- if (errata_nop_necessary_p (md.slot + curr, insn_unit))
+ if (md.detect_b_step_errata
+ && errata_nop_necessary_p (md.slot + curr, insn_unit))
as_warn (_("Additional NOP may be necessary to workaround Itanium processor A/B step errata"));
build_insn (md.slot + curr, insn + i);
@@ -6476,6 +6478,10 @@ md_parse_option (c, arg)
else if (strcmp (arg, "be") == 0)
{
md.flags |= EF_IA_64_BE;
+ }
+ else if (strcmp (arg, "b-step") == 0)
+ {
+ md.detect_b_step_errata = 1;
}
else
return 0;