]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mips32: protect mips32r2 instructions with a flag
authorPetar Jovanovic <mips32r2@gmail.com>
Sat, 21 Sep 2013 01:47:18 +0000 (01:47 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Sat, 21 Sep 2013 01:47:18 +0000 (01:47 +0000)
Regression issue that came when mips_dirtyhelper_calculate_FCSR was added.
Inline assembly with MIPS32r2 instructions needs to be protected by flags
that disable it for non-MIPS32r2 platforms such as some Broadcom boards.

Fixes the issue: Bugzilla 325124.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2773

VEX/priv/guest_mips_helpers.c

index df19d5f70ec038953bf4638257259402ec903201..c166b4dd8137f032c381aa5c2a8715d4c2d4b1e3 100644 (file)
@@ -1155,63 +1155,65 @@ extern UInt mips_dirtyhelper_calculate_FCSR ( void* gs, UInt fs, flt_op inst )
       case CEILWD:
          ASM_VOLATILE_ROUND(fs, ceil.w.d)
          break;
-      case CEILLS:
-         ASM_VOLATILE_ROUND(fs, ceil.l.s)
-         break;
-      case CEILLD:
-         ASM_VOLATILE_ROUND(fs, ceil.l.d)
-         break;
-      case ROUNDLS:
-         ASM_VOLATILE_ROUND(fs, round.l.s)
-         break;
-      case ROUNDLD:
-         ASM_VOLATILE_ROUND(fs, round.l.d)
-         break;
-      case TRUNCLS:
-         ASM_VOLATILE_ROUND(fs, trunc.l.s)
-         break;
-      case TRUNCLD:
-         ASM_VOLATILE_ROUND(fs, trunc.l.d)
-         break;
       case CVTDS:
          ASM_VOLATILE_ROUND(fs, cvt.d.s)
          break;
       case CVTDW:
          ASM_VOLATILE_ROUND(fs, cvt.d.w)
          break;
-      case CVTDL:
-         ASM_VOLATILE_ROUND(fs, cvt.d.l)
-         break;
       case CVTSW:
          ASM_VOLATILE_ROUND(fs, cvt.s.w)
          break;
       case CVTSD:
          ASM_VOLATILE_ROUND(fs, cvt.s.d)
          break;
-      case CVTSL:
-         ASM_VOLATILE_ROUND(fs, cvt.s.l)
-         break;
       case CVTWS:
          ASM_VOLATILE_ROUND(fs, cvt.w.s)
          break;
       case CVTWD:
          ASM_VOLATILE_ROUND(fs, cvt.w.d)
          break;
+      case ROUNDWS:
+         ASM_VOLATILE_ROUND(fs, round.w.s)
+         break;
+#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
+      case CEILLS:
+         ASM_VOLATILE_ROUND(fs, ceil.l.s)
+         break;
+      case CEILLD:
+         ASM_VOLATILE_ROUND(fs, ceil.l.d)
+         break;
+      case CVTDL:
+         ASM_VOLATILE_ROUND(fs, cvt.d.l)
+         break;
       case CVTLS:
          ASM_VOLATILE_ROUND(fs, cvt.l.s)
          break;
       case CVTLD:
          ASM_VOLATILE_ROUND(fs, cvt.l.d)
          break;
+      case CVTSL:
+         ASM_VOLATILE_ROUND(fs, cvt.s.l)
+         break;
       case FLOORLS:
          ASM_VOLATILE_ROUND(fs, floor.l.s)
          break;
       case FLOORLD:
          ASM_VOLATILE_ROUND(fs, floor.l.d)
          break;
-      case ROUNDWS:
-         ASM_VOLATILE_ROUND(fs, round.w.s)
+      case ROUNDLS:
+         ASM_VOLATILE_ROUND(fs, round.l.s)
          break;
+      case ROUNDLD:
+         ASM_VOLATILE_ROUND(fs, round.l.d)
+         break;
+      case TRUNCLS:
+         ASM_VOLATILE_ROUND(fs, trunc.l.s)
+         break;
+      case TRUNCLD:
+         ASM_VOLATILE_ROUND(fs, trunc.l.d)
+         break;
+#endif
       default:
          vassert(0);
          break;