]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and
authorJulian Seward <jseward@acm.org>
Fri, 13 Jan 2017 18:02:38 +0000 (18:02 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 13 Jan 2017 18:02:38 +0000 (18:02 +0000)
Iop_MinNumF32, as introduced in vex r3293.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16202

memcheck/mc_translate.c
memcheck/tests/vbit-test/irops.c

index da7a0bb9925271f437bf269021527a067181521c..0b918407562990ae51ba0247cbb363ee733538a2 100644 (file)
@@ -1611,6 +1611,14 @@ IRAtom* mkLazy2 ( MCEnv* mce, IRType finalVty, IRAtom* va1, IRAtom* va2 )
       return at;
    }
 
+   /* I32 x I32 -> I32 */
+   if (t1 == Ity_I32 && t2 == Ity_I32 && finalVty == Ity_I32) {
+      if (0) VG_(printf)("mkLazy2: I32 x I32 -> I32\n");
+      at = mkUifU(mce, Ity_I32, va1, va2);
+      at = mkPCastTo(mce, Ity_I32, at);
+      return at;
+   }
+
    if (0) {
       VG_(printf)("mkLazy2 ");
       ppIRType(t1);
@@ -3942,6 +3950,16 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce,
       case Iop_CmpExpD128:
          return mkLazy2(mce, Ity_I32, vatom1, vatom2);
 
+      case Iop_MaxNumF32:
+      case Iop_MinNumF32:
+         /* F32 x F32 -> F32 */
+         return mkLazy2(mce, Ity_I32, vatom1, vatom2);
+
+      case Iop_MaxNumF64:
+      case Iop_MinNumF64:
+         /* F64 x F64 -> F64 */
+         return mkLazy2(mce, Ity_I64, vatom1, vatom2);
+
       /* non-FP after here */
 
       case Iop_DivModU64to32:
index 5b1106a1ca07bfb2c312444aa04ee01ae5c5a770..71589d8ec368fe5ea4c8d49c72a6396e40f374d3 100644 (file)
@@ -295,6 +295,12 @@ static irop_t irops[] = {
   { DEFOP(Iop_RecpExpF64, UNDEF_UNKNOWN), },
   { DEFOP(Iop_RecpExpF32, UNDEF_UNKNOWN), },
 
+  /* --------- Possibly required by IEEE 754-2008. --------- */
+  { DEFOP(Iop_MaxNumF64, UNDEF_ALL), .arm = 1 },
+  { DEFOP(Iop_MinNumF64, UNDEF_ALL), .arm = 1 },
+  { DEFOP(Iop_MaxNumF32, UNDEF_ALL), .arm = 1 },
+  { DEFOP(Iop_MinNumF32, UNDEF_ALL), .arm = 1 },
+
   /* ------------------ 16-bit scalar FP ------------------ */
   { DEFOP(Iop_F16toF64,  UNDEF_ALL), .arm64 = 1 },
   { DEFOP(Iop_F64toF16,  UNDEF_ALL), .arm64 = 1 },