From: Julian Seward Date: Tue, 29 Jan 2013 17:18:56 +0000 (+0000) Subject: Fix the mkLazy3 case for I32 x I8 x I128 -> I128. X-Git-Tag: svn/VALGRIND_3_9_0~406 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=875aed56c449f83ade806c8c8dc71a7ae0d87338;p=thirdparty%2Fvalgrind.git Fix the mkLazy3 case for I32 x I8 x I128 -> I128. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13275 --- diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index fae9f17f57..600bc0195c 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -1633,14 +1633,16 @@ IRAtom* mkLazy3 ( MCEnv* mce, IRType finalVty, if (t1 == Ity_I32 && t2 == Ity_I8 && t3 == Ity_I128 && finalVty == Ity_I128) { if (0) VG_(printf)("mkLazy3: I32 x I8 x I128 -> I128\n"); - /* Widen 1st and 2nd args to I128. Since 1st arg is typically a rounding - mode indication which is fully defined, this should get - folded out later. */ + /* Use I64 as an intermediate type, which means PCasting all 3 + args to I64 to start with. 1st arg is typically a rounding + mode indication which is fully defined, so we hope that it + will get folded out later. */ IRAtom* at1 = mkPCastTo(mce, Ity_I64, va1); IRAtom* at2 = mkPCastTo(mce, Ity_I64, va2); - /* Now fold in 2nd and 3rd args. */ + IRAtom* at3 = mkPCastTo(mce, Ity_I64, va3); + /* Now UifU all three together. */ at = mkUifU(mce, Ity_I64, at1, at2); // UifU(PCast(va1), PCast(va2)) - at = mkUifU(mce, Ity_I128, at, va3); + at = mkUifU(mce, Ity_I64, at, at3); // ... `UifU` PCast(va3) /* and PCast once again. */ at = mkPCastTo(mce, Ity_I128, at); return at;