gas/
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 17 Feb 2005 23:22:05 +0000 (23:22 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 17 Feb 2005 23:22:05 +0000 (23:22 +0000)
2005-02-17  H.J. Lu  <hongjiu.lu@intel.com>

* NEWS: Mention "-mhint.b=[ok|warning|error]".

* config/tc-ia64.c (md): Add hint_b.
(emit_one_bundle): Handle md.hint_b for "hint".
(md_parse_option): Accepted "-mhint.b=[ok|warning|error]".
(md_show_usage): Add "-mhint.b=[ok|warning|error]".
(ia64_init): Set md.hint_b to error.
(md_assemble): Handle md.hint_b for "hint.b".

* doc/as.texinfo: Add "-mhint.b=[ok|warning|error]".
* doc/c-ia64.texi: Likewise.

gas/testsuite/

2005-02-17  H.J. Lu  <hongjiu.lu@intel.com>

* gas/ia64/hint.b-err.l: New file.
* gas/ia64/hint.b-err.s: Likewise.
* gas/ia64/hint.b-warn.l: Likewise.
* gas/ia64/hint.b-warn.s: Likewise.

* gas/ia64/ia64.exp: Run hint.b-err and hint.b-warn.

* gas/ia64/opc-b.d: Pass -mhint.b=ok to as.

12 files changed:
gas/ChangeLog
gas/NEWS
gas/config/tc-ia64.c
gas/doc/as.texinfo
gas/doc/c-ia64.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/ia64/hint.b-err.l [new file with mode: 0644]
gas/testsuite/gas/ia64/hint.b-err.s [new file with mode: 0644]
gas/testsuite/gas/ia64/hint.b-warn.l [new file with mode: 0644]
gas/testsuite/gas/ia64/hint.b-warn.s [new file with mode: 0644]
gas/testsuite/gas/ia64/ia64.exp
gas/testsuite/gas/ia64/opc-b.d

index 699c9a660ff91664db85e2b7c29931bb5c28c159..ebf77e72d072fd44a02070f6a9c99dd52bcbb1d4 100644 (file)
@@ -1,3 +1,17 @@
+2005-02-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * NEWS: Mention "-mhint.b=[ok|warning|error]".
+
+       * config/tc-ia64.c (md): Add hint_b.
+       (emit_one_bundle): Handle md.hint_b for "hint".
+       (md_parse_option): Accepted "-mhint.b=[ok|warning|error]".
+       (md_show_usage): Add "-mhint.b=[ok|warning|error]".
+       (ia64_init): Set md.hint_b to error.
+       (md_assemble): Handle md.hint_b for "hint.b".
+
+       * doc/as.texinfo: Add "-mhint.b=[ok|warning|error]".
+       * doc/c-ia64.texi: Likewise.
+
 2005-02-17  Alan Modra  <amodra@bigpond.net.au>
 
        * tc.h (struct relax_type, relax_typeS): Move from here..
index feaee1f732db8c47ff2969126e1c28da9dc1f7fe..293668c59d697ab1547f5403e786c7c90ef4542c 100644 (file)
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,5 +1,7 @@
 -*- text -*-
 
+* New command line option -mhint.b=[ok|warning|error] for IA64 targets.
+
 * New command line option -munwind-check=[warning|error] for IA64
   targets.
 
index e43619d8a891362c825ee6314886143a34ec8cd4..251185fb9d36714a671386670cf961691ee9b8e6 100644 (file)
@@ -229,6 +229,14 @@ static struct
        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,
@@ -6705,9 +6713,34 @@ emit_one_bundle ()
          enum ia64_opnd opnd1, opnd2;
 
          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)
+           {
+             insn_unit = required_unit;
+             if (required_unit == IA64_UNIT_B)
+               {
+                 switch (md.hint_b)
+                   {
+                   case hint_b_ok:
+                     break;
+                   case hint_b_warning:
+                     as_warn ("hint in B unit may be treated as nop");
+                     break;
+                   case hint_b_error:
+                     /* When manual bundling is off and there is no
+                        user template, we choose a different unit so
+                        that hint won't go into the current slot. We
+                        will fill the current bundle with nops and
+                        try to put hint into the next bundle.  */
+                     if (!manual_bundling && user_template < 0)
+                       insn_unit = IA64_UNIT_I;
+                     else
+                       as_bad ("hint in B unit can't be used");
+                     break;
+                   }
+               }
+           }
          else if (strcmp (idesc->name, "chk.s") == 0
              || strcmp (idesc->name, "mov") == 0)
            {
@@ -6916,6 +6949,18 @@ md_parse_option (c, arg)
          else
            return 0;
        }
+      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;
@@ -7030,6 +7075,8 @@ IA-64 options:\n\
   -mle | -mbe            select little- or big-endian byte order (default -mle)\n\
   -munwind-check=[warning|error]\n\
                          unwind directive check (default -munwind-check=warning)\n\
+  -mhint.b=[ok|warning|error]\n\
+                         hint.b check (default -mhint.b=error)\n\
   -x | -xexplicit        turn on dependency violation checking\n\
   -xauto                 automagically remove dependency violations (default)\n\
   -xnone                 turn off dependency violation checking\n\
@@ -7382,6 +7429,7 @@ ia64_init (argc, argv)
   md.detect_dv = 1;
   /* FIXME: We should change it to unwind_check_error someday.  */
   md.unwind_check = unwind_check_warning;
+  md.hint_b = hint_b_error;
 }
 
 /* Return a string for the target object file format.  */
@@ -10600,6 +10648,20 @@ md_assemble (str)
                    TOUPPER (unit));
        }
     }
+  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)
index 051ab70df62d0a02fd4bf81b0fafadda0722c142..6e616df830bd2b2b78c440c0cd4a2d2b25956003 100644 (file)
@@ -316,6 +316,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
    [@b{-milp32}|@b{-milp64}|@b{-mlp64}|@b{-mp64}]
    [@b{-mle}|@b{mbe}]
    [@b{-munwind-check=warning}|@b{-munwind-check=error}]
+   [@b{-mhint.b=ok}|@b{-mhint.b=warning}|@b{-mhint.b=error}]
    [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}]
 @end ifset
 @ifset IP2K
index 4858cb9e3b618ecbcf13c2b3c15f5148fdcadda1..5d0ec9070045dc8d3695a892c9d0ad58453b9b76 100644 (file)
@@ -73,6 +73,15 @@ will make the assembler issue a warning when an unwind directive check
 fails.  This is the default.  @code{-munwind-check=error} will make the
 assembler issue an error when an unwind directive check fails.
 
+@item -mhint.b=ok
+@item -mhint.b=warning
+@item -mhint.b=error
+These options control what the assembler will do when the @samp{hint.b}
+instruction is used.  @code{-mhint.b=ok} will make the assembler accept
+@samp{hint.b}.  @code{-mint.b=warning} will make the assembler issue a
+warning when @samp{hint.b} is used.  @code{-mhint.b=error} will make
+the assembler treat @samp{hint.b} as an error, which is the default.
+
 @item -x
 @item -xexplicit
 These options turn on dependency violation checking.
index 680365dc0b3cd1c514504e253eace9dcf913a874..8ae4093612b591bae1f15753d85211d6d05af371 100644 (file)
@@ -1,3 +1,14 @@
+2005-02-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gas/ia64/hint.b-err.l: New file.
+       * gas/ia64/hint.b-err.s: Likewise.
+       * gas/ia64/hint.b-warn.l: Likewise.
+       * gas/ia64/hint.b-warn.s: Likewise.
+
+       * gas/ia64/ia64.exp: Run hint.b-err and hint.b-warn.
+
+       * gas/ia64/opc-b.d: Pass -mhint.b=ok to as.
+
 2005-02-17  Jan Beulich  <jbeulich@novell.com>
 
        * gas/ia64/nostkreg.[ds]: New.
diff --git a/gas/testsuite/gas/ia64/hint.b-err.l b/gas/testsuite/gas/ia64/hint.b-err.l
new file mode 100644 (file)
index 0000000..86d8b5e
--- /dev/null
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:1: Error: hint.b shouldn't be used
+.*:2: Error: hint.b shouldn't be used
diff --git a/gas/testsuite/gas/ia64/hint.b-err.s b/gas/testsuite/gas/ia64/hint.b-err.s
new file mode 100644 (file)
index 0000000..75f7a65
--- /dev/null
@@ -0,0 +1,2 @@
+       hint.b  @pause
+       hint.b  0x1ffff
diff --git a/gas/testsuite/gas/ia64/hint.b-warn.l b/gas/testsuite/gas/ia64/hint.b-warn.l
new file mode 100644 (file)
index 0000000..1c5f0be
--- /dev/null
@@ -0,0 +1,3 @@
+.*: Assembler messages:
+.*:1: Warning: hint.b may be treated as nop
+.*:2: Warning: hint.b may be treated as nop
diff --git a/gas/testsuite/gas/ia64/hint.b-warn.s b/gas/testsuite/gas/ia64/hint.b-warn.s
new file mode 100644 (file)
index 0000000..75f7a65
--- /dev/null
@@ -0,0 +1,2 @@
+       hint.b  @pause
+       hint.b  0x1ffff
index 0f1ec68f3e786fd1249abd76ba246c0906b775b5..83d98fb60174073fb6aebaf3a962d1aff772befb 100644 (file)
@@ -79,4 +79,6 @@ if [istarget "ia64-*"] then {
     run_list_test "slot2" ""
     run_list_test "unwind-err" "-munwind-check=error"
     run_dump_test "operand-or"
+    run_list_test "hint.b-err" ""
+    run_list_test "hint.b-warn" "-mhint.b=warning"
 }
index 64a492839cb61a4b7c06b17442a1b33533a8a6f9..cb0973c9718844504c3222a2748df59960b4dbd8 100644 (file)
@@ -1,4 +1,4 @@
-#as: -xnone
+#as: -xnone -mhint.b=ok
 #objdump: -d
 #name: ia64 opc-b