Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3 SPARC before v8 requires a nop instruction bet...



details:   https://anonhg.NetBSD.org/src/rev/6c4633b6647d
branches:  trunk
changeset: 343761:6c4633b6647d
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 25 12:36:36 2016 +0000

description:
SPARC before v8 requires a nop instruction between a floating point
instruction and a floating point branch.  SPARCv8 requires a nop only
immediately after FPop2 (fcmp*) instructions. Adjust the logic to
properly implement the v8 rules when targetting a less ancient
architecture.

diffstat:

 external/gpl3/binutils.old/dist/gas/config/tc-sparc.c |  16 ++++++++++------
 external/gpl3/binutils/dist/gas/config/tc-sparc.c     |  16 ++++++++++------
 2 files changed, 20 insertions(+), 12 deletions(-)

diffs (54 lines):

diff -r b064f03b6e77 -r 6c4633b6647d external/gpl3/binutils.old/dist/gas/config/tc-sparc.c
--- a/external/gpl3/binutils.old/dist/gas/config/tc-sparc.c     Thu Feb 25 12:22:30 2016 +0000
+++ b/external/gpl3/binutils.old/dist/gas/config/tc-sparc.c     Thu Feb 25 12:36:36 2016 +0000
@@ -1348,13 +1348,17 @@
          || (last_opcode & ANNUL) == 0))
     as_warn (_("FP branch in delay slot"));
 
-  /* SPARC before v9 requires a nop instruction between a floating
-     point instruction and a floating point branch.  We insert one
-     automatically, with a warning.  */
-  if (max_architecture < SPARC_OPCODE_ARCH_V9
-      && last_insn != NULL
+  /* SPARC before v8 requires a nop instruction between a floating
+     point instruction and a floating point branch.  SPARCv8 requires
+     a nop only immediately after FPop2 (fcmp*) instructions.
+     We insert one automatically, with a warning.
+   */
+  if (last_insn != NULL
       && (insn->flags & F_FBR) != 0
-      && (last_insn->flags & F_FLOAT) != 0)
+      && (last_insn->flags & F_FLOAT) != 0
+      && (max_architecture < SPARC_OPCODE_ARCH_V8 ||
+          (max_architecture < SPARC_OPCODE_ARCH_V9 &&
+           strncmp(last_insn->name, "fcmp", 4) == 0)))
     {
       struct sparc_it nop_insn;
 
diff -r b064f03b6e77 -r 6c4633b6647d external/gpl3/binutils/dist/gas/config/tc-sparc.c
--- a/external/gpl3/binutils/dist/gas/config/tc-sparc.c Thu Feb 25 12:22:30 2016 +0000
+++ b/external/gpl3/binutils/dist/gas/config/tc-sparc.c Thu Feb 25 12:36:36 2016 +0000
@@ -1402,13 +1402,17 @@
          || (last_opcode & ANNUL) == 0))
     as_warn (_("FP branch in delay slot"));
 
-  /* SPARC before v9 requires a nop instruction between a floating
-     point instruction and a floating point branch.  We insert one
-     automatically, with a warning.  */
-  if (max_architecture < SPARC_OPCODE_ARCH_V9
-      && last_insn != NULL
+  /* SPARC before v8 requires a nop instruction between a floating
+     point instruction and a floating point branch.  SPARCv8 requires
+     a nop only immediately after FPop2 (fcmp*) instructions.
+     We insert one automatically, with a warning.
+   */
+  if (last_insn != NULL
       && (insn->flags & F_FBR) != 0
-      && (last_insn->flags & F_FLOAT) != 0)
+      && (last_insn->flags & F_FLOAT) != 0
+      && (max_architecture < SPARC_OPCODE_ARCH_V8 ||
+          (max_architecture < SPARC_OPCODE_ARCH_V9 &&
+           strncmp(last_insn->name, "fcmp", 4) == 0)))
     {
       struct sparc_it nop_insn;
 



Home | Main Index | Thread Index | Old Index