Package: binutils
Version: 2.15-6
Tags: sarge, patch
Severity: wishlist
This is a backport of an optimization already in upstream. Text of
original patch submission by H.J. Lu (source URL in dpatch below):
Montecito supports the [EMAIL PROTECTED] on .i, .m, .f ports only.
[EMAIL PROTECTED] on a b syllable decodes to a nop. Anticipated
performance gains may not be realized for any [EMAIL PROTECTED]
instruction.
BTW, Montecito is the code name for the next Itanium processor.
The 2.4 and 2.6 Linux kernels are OK with this patch.
I've tested kernel builds with Sarge binutils 2.15-6 with this patch
included using the option -Wa,-mhint.b=error. No issues found. Please
consider this patch for any post Sarge initial release rolls of
binutils. The unstable branch already contains a binutils that includes
this. Thanks,
Alex
--
Alex Williamson HP Linux & Open Source Lab
#! /bin/sh -e
## 124_montecito_b_slot_hint.dpatch
##
## DP: Description: Disable hint in B unit for Montecito
## DP: Author: H. J. Lu
## DP: Upstream status: Committed to trunk.
## DP: Date: 2005-02-16
## DP: URL: http://sources.redhat.com/ml/binutils/2005-02/msg00367.html
if [ $# -lt 1 ]; then
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
case "$1" in
-patch) patch -p1 ${patch_opts} < $0;;
-unpatch) patch -R -p1 ${patch_opts} < $0;;
*)
echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
exit 1;;
esac
exit 0
@DPATCH@
--- binutils/gas/doc/as.texinfo.orig 2004-01-08 19:34:04.000000000 -0700
+++ binutils/gas/doc/as.texinfo 2005-06-07 13:57:05.610782978 -0600
@@ -313,6 +313,7 @@
[EMAIL PROTECTED]|@b{-mauto-pic}]
[EMAIL PROTECTED]|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
[EMAIL PROTECTED]|@b{mbe}]
+ [EMAIL PROTECTED]|@b{-mhint.b=warning}|@b{-mhint.b=error}]
[EMAIL PROTECTED]|@b{-xexplicit}] [EMAIL PROTECTED] [EMAIL PROTECTED]
@end ifset
@ifset IP2K
--- binutils/gas/doc/c-ia64.texi.orig 2003-10-26 11:12:03.000000000 -0700
+++ binutils/gas/doc/c-ia64.texi 2005-06-07 10:36:08.790618174 -0600
@@ -65,6 +65,15 @@
byte order (default) and @code{-mbe} selects big-endian byte order. Note that
IA-64 machine code always uses little-endian byte order.
[EMAIL PROTECTED] -mhint.b=ok
[EMAIL PROTECTED] -mhint.b=warning
[EMAIL PROTECTED] -mhint.b=error
+These options control what assembler will do when the @samp{hint.b}
+instruction is used. @code{-mhint.b=ok} will make assembler to accept
[EMAIL PROTECTED] @code{-mhint.b=warning} will make assembler to issue
+a warning when @samp{hint.b} is used. @code{-mhint.b=error} will make
+assembler to treat @samp{hint.b} as an error, which is the default.
+
@item -x
@item -xexplicit
These options turn on dependency violation checking. This checking is turned
on by
--- binutils/gas/testsuite/gas/ia64/hint.b-err.l.orig 2005-06-07
10:36:08.790618174 -0600
+++ binutils/gas/testsuite/gas/ia64/hint.b-err.l 2005-06-07
10:36:08.790618174 -0600
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:1: Error: hint.b shouldn't be used
+.*:2: Error: hint.b shouldn't be used
--- binutils/gas/testsuite/gas/ia64/hint.b-err.s.orig 2005-06-07
10:36:08.791594737 -0600
+++ binutils/gas/testsuite/gas/ia64/hint.b-err.s 2005-06-07
10:36:08.791594737 -0600
@@ -0,0 +1,2 @@
+ hint.b @pause
+ hint.b 0x1ffff
--- binutils/gas/testsuite/gas/ia64/hint.b-warn.l.orig 2005-06-07
10:36:08.791594737 -0600
+++ binutils/gas/testsuite/gas/ia64/hint.b-warn.l 2005-06-07
10:36:08.791594737 -0600
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:1: Warning: hint.b may be treated as nop
+.*:2: Warning: hint.b may be treated as nop
--- binutils/gas/testsuite/gas/ia64/hint.b-warn.s.orig 2005-06-07
10:36:08.792571299 -0600
+++ binutils/gas/testsuite/gas/ia64/hint.b-warn.s 2005-06-07
10:36:08.792571299 -0600
@@ -0,0 +1,2 @@
+ hint.b @pause
+ hint.b 0x1ffff
--- binutils/gas/testsuite/gas/ia64/ia64.exp.orig 2003-09-25
21:54:09.000000000 -0600
+++ binutils/gas/testsuite/gas/ia64/ia64.exp 2005-06-07 14:13:24.325614739
-0600
@@ -55,4 +55,6 @@
run_dump_test "unwind"
run_dump_test "alias"
}
+ run_list_test "hint.b-err" ""
+ run_list_test "hint.b-warn" "-mhint.b=warning"
}
--- binutils/gas/testsuite/gas/ia64/opc-b.d.orig 2003-09-25
21:54:09.000000000 -0600
+++ binutils/gas/testsuite/gas/ia64/opc-b.d 2005-06-07 14:14:43.129324711
-0600
@@ -1,3 +1,4 @@
+#as: -mhint.b=ok
#objdump: -d
#name: ia64 opc-b
--- binutils/gas/NEWS.orig 2004-05-17 13:36:07.000000000 -0600
+++ binutils/gas/NEWS 2005-06-07 14:15:38.543386532 -0600
@@ -1,5 +1,7 @@
-*- text -*-
+* New command line option -mhint.b=[ok|warning|error] for IA64 targets.
+
* The MIPS -membedded-pic option (Embedded-PIC code generation) is
deprecated and will be removed in a future release.
--- binutils/gas/config/tc-ia64.c 2005-06-07 14:49:27.012111684 -0600
+++ binutils/gas/config/tc-ia64.c 2005-06-07 14:52:15.904687740 -0600
@@ -216,6 +216,14 @@
that are predicatable. */
expressionS qp;
+ /* What to do when hint.b is used. */
+ enum
+ {
+ hint_b_error,
+ hint_b_warning,
+ hint_b_ok
+ } hint_b;
+
unsigned int
manual_bundling : 1,
debug_dv: 1,
@@ -6295,9 +6303,16 @@
if (idesc->type == IA64_TYPE_DYN)
{
if ((strcmp (idesc->name, "nop") == 0)
- || (strcmp (idesc->name, "hint") == 0)
|| (strcmp (idesc->name, "break") == 0))
insn_unit = required_unit;
+ else if (strcmp (idesc->name, "hint") == 0)
+ {
+ if (required_unit == IA64_UNIT_B
+ && md.hint_b != hint_b_ok)
+ insn_unit = IA64_UNIT_I;
+ else
+ insn_unit = required_unit;
+ }
else if (strcmp (idesc->name, "chk.s") == 0)
{
insn_unit = IA64_UNIT_M;
@@ -6489,6 +6504,18 @@
{
md.flags |= EF_IA_64_BE;
}
+ else if (strncmp (arg, "hint.b=", 7) == 0)
+ {
+ arg += 7;
+ if (strcmp (arg, "ok") == 0)
+ md.hint_b = hint_b_ok;
+ else if (strcmp (arg, "warning") == 0)
+ md.hint_b = hint_b_warning;
+ else if (strcmp (arg, "error") == 0)
+ md.hint_b = hint_b_error;
+ else
+ return 0;
+ }
else
return 0;
break;
@@ -6592,6 +6619,8 @@
EF_IA_64_NOFUNCDESC_CONS_GP)\n\
-milp32|-milp64|-mlp64|-mp64 select data model (default -mlp64)\n\
-mle | -mbe select little- or big-endian byte order (default
-mle)\n\
+ -mhint.b=[ok|warning|error]\n\
+ hint.b check (default -mhint.b=error)\n\
-x | -xexplicit turn on dependency violation checking (default)\n\
-xauto automagically remove dependency violations\n\
-xdebug debug dependency violation checker\n"),
@@ -6937,6 +6966,7 @@
char **argv ATTRIBUTE_UNUSED;
{
md.flags = MD_FLAGS_DEFAULT;
+ md.hint_b = hint_b_error;
}
/* Return a string for the target object file format. */
@@ -10002,6 +10032,20 @@
idesc = get_next_opcode (idesc);
}
}
+ else if (strcmp (idesc->name, "hint.b") == 0)
+ {
+ switch (md.hint_b)
+ {
+ case hint_b_ok:
+ break;
+ case hint_b_warning:
+ as_warn ("hint.b may be treated as nop");
+ break;
+ case hint_b_error:
+ as_bad ("hint.b shouldn't be used");
+ break;
+ }
+ }
qp_regno = 0;
if (md.qp.X_op == O_register)
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]