From: Julian Seward Date: Fri, 13 Jan 2017 18:02:38 +0000 (+0000) Subject: Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and X-Git-Tag: svn/VALGRIND_3_13_0~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8840b0bb8dd303475568f4c1530339a1c61d2a65;p=thirdparty%2Fvalgrind.git Add support for Iop_MaxNumF64, Iop_MinNumF64, Iop_MaxNumF32 and Iop_MinNumF32, as introduced in vex r3293. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16202 --- diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index da7a0bb992..0b91840756 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -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: diff --git a/memcheck/tests/vbit-test/irops.c b/memcheck/tests/vbit-test/irops.c index 5b1106a1ca..71589d8ec3 100644 --- a/memcheck/tests/vbit-test/irops.c +++ b/memcheck/tests/vbit-test/irops.c @@ -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 },