From: Florian Krohm Date: Wed, 26 Dec 2012 17:48:46 +0000 (+0000) Subject: valgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128. X-Git-Tag: svn/VALGRIND_3_9_0~474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df5c8e140b0b55eeac092b8a3e80fd25cf24c0e;p=thirdparty%2Fvalgrind.git valgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128. VEX buddy patch is r2617. Enhance testcase for CEDTR and CEXTR. Adapt vbit tester. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com). This is part of fixing BZ 307113. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13203 --- diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 0931ea32b2..65a1647187 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -3370,6 +3370,8 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce, case Iop_CmpF128: case Iop_CmpD64: case Iop_CmpD128: + case Iop_CmpExpD64: + case Iop_CmpExpD128: return mkLazy2(mce, Ity_I32, vatom1, vatom2); /* non-FP after here */ diff --git a/memcheck/tests/vbit-test/irops.c b/memcheck/tests/vbit-test/irops.c index 8815777996..a82f0c24b7 100644 --- a/memcheck/tests/vbit-test/irops.c +++ b/memcheck/tests/vbit-test/irops.c @@ -501,6 +501,8 @@ static irop_t irops[] = { { DEFOP(Iop_RoundD128toInt, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, { DEFOP(Iop_CmpD64, UNDEF_ALL), .s390x = 1, .ppc64 = 1, .ppc32 = 1 }, { DEFOP(Iop_CmpD128, UNDEF_ALL), .s390x = 1, .ppc64 = 1, .ppc32 = 1 }, + { DEFOP(Iop_CmpExpD64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_CmpExpD128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_QuantizeD64, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, { DEFOP(Iop_QuantizeD128, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, { DEFOP(Iop_SignificanceRoundD64, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, diff --git a/memcheck/tests/vbit-test/util.c b/memcheck/tests/vbit-test/util.c index 718df63db8..ebfe54be46 100644 --- a/memcheck/tests/vbit-test/util.c +++ b/memcheck/tests/vbit-test/util.c @@ -884,9 +884,11 @@ typeof_primop(IROp op, IRType *t_dst, IRType *t_arg1, IRType *t_arg2, BINARY(ity_RMode, Ity_D64, Ity_D64); case Iop_CmpD64: + case Iop_CmpExpD64: BINARY(Ity_D64,Ity_D64, Ity_I32); case Iop_CmpD128: + case Iop_CmpExpD128: BINARY(Ity_D128,Ity_D128, Ity_I32); case Iop_QuantizeD64: diff --git a/none/tests/s390x/dfp-3.c b/none/tests/s390x/dfp-3.c index f1c9969bc0..ed0177c69f 100644 --- a/none/tests/s390x/dfp-3.c +++ b/none/tests/s390x/dfp-3.c @@ -40,7 +40,7 @@ printf(" > "); \ break; \ case 3: \ - printf(" <> "); \ + printf(" <> "); \ break; \ } \ DFP_VAL_PRINT(v2, type); \ @@ -52,11 +52,10 @@ int main(void) _Decimal64 d64_1, d64_2; _Decimal128 d128_1, d128_2; + /* compare 8 bytes DFP value */ + printf("cdtr:\n"); d64_1 = 5.000005DD; d64_2 = 50000000000000000.000005DD; - - // compare 8 bytes DFP value - printf("cdtr:\n"); COMPARE(CDTR, d64_1, d64_1, _Decimal64); COMPARE(CDTR, d64_1, d64_2, _Decimal64); COMPARE(CDTR, d64_2, d64_1, _Decimal64); @@ -68,18 +67,10 @@ int main(void) COMPARE(CDTR, d64_1, d64_1, _Decimal64); COMPARE(CDTR, d64_2, d64_2, _Decimal64); -#if 0 //fixs390: enable it when Iop_ExtractD64 is available - // compare exponents of 8 bytes DFP value - printf("cedtr:\n"); - COMPARE(CEDTR, d64_1, d64_1, _Decimal64); - COMPARE(CEDTR, d64_1, d64_2, _Decimal64); - COMPARE(CEDTR, d64_2, d64_1, _Decimal64); -#endif + /* compare 16 bytes DFP value */ + printf("cxtr:\n"); d128_1 = 5.00005DL; d128_2 = 5000000000000000.5DL; - - // compare 16 bytes DFP value - printf("cxtr:\n"); COMPARE(CXTR, d128_1, d128_1, _Decimal128); COMPARE(CXTR, d128_1, d128_2, _Decimal128); COMPARE(CXTR, d128_2, d128_1, _Decimal128); @@ -91,13 +82,35 @@ int main(void) COMPARE(CXTR, d128_1, d128_1, _Decimal128); COMPARE(CXTR, d128_2, d128_2, _Decimal128); -#if 0 //fixs390: enable it when Iop_ExtractD128 is available - // compare exponents of 16 bytes DFP value + /* compare exponents of 8 bytes DFP value */ + printf("cedtr:\n"); + d64_1 = 5.000005DD; + d64_2 = 50000000000000000.000005DD; + COMPARE(CEDTR, d64_1, d64_1, _Decimal64); + COMPARE(CEDTR, d64_1, d64_2, _Decimal64); + COMPARE(CEDTR, d64_2, d64_1, _Decimal64); + + /* compare NAN and INF operands */ + d64_1 = DEC_INFINITY; + d64_2 = DEC_NAN; + COMPARE(CEDTR, d64_1, d64_2, _Decimal64); + COMPARE(CEDTR, d64_1, d64_1, _Decimal64); + COMPARE(CEDTR, d64_2, d64_2, _Decimal64); + + /* compare exponents of 16 bytes DFP value */ printf("cextr:\n"); + d128_1 = 5.00005DL; + d128_2 = 5000000000000000.5DL; COMPARE(CEXTR, d128_1, d128_1, _Decimal128); COMPARE(CEXTR, d128_1, d128_2, _Decimal128); COMPARE(CEXTR, d128_2, d128_1, _Decimal128); -#endif + + /* compare NAN and INF operands */ + d128_1 = DEC_INFINITY; + d128_2 = DEC_NAN; + COMPARE(CEXTR, d128_1, d128_2, _Decimal128); + COMPARE(CEXTR, d128_1, d128_1, _Decimal128); + COMPARE(CEXTR, d128_2, d128_2, _Decimal128); return 0; } diff --git a/none/tests/s390x/dfp-3.stdout.exp b/none/tests/s390x/dfp-3.stdout.exp index 066ecc82d4..83c422fc1f 100644 --- a/none/tests/s390x/dfp-3.stdout.exp +++ b/none/tests/s390x/dfp-3.stdout.exp @@ -12,3 +12,17 @@ cxtr: 780000000000000000000000 <> 7c0000000000000000000000 (cc == 3) 780000000000000000000000 == 780000000000000000000000 (cc == 0) 7c0000000000000000000000 <> 7c0000000000000000000000 (cc == 3) +cedtr: +2220000000500005 == 2220000000500005 (cc == 0) +2220000000500005 < 363c000000000000 (cc == 1) +363c000000000000 > 2220000000500005 (cc == 2) +7800000000000000 <> 7c00000000000000 (cc == 3) +7800000000000000 == 7800000000000000 (cc == 0) +7c00000000000000 == 7c00000000000000 (cc == 0) +cextr: +2206c00000000000000a0005 == 2206c00000000000000a0005 (cc == 0) +2206c00000000000000a0005 < 2207c00000000000140000000000005 (cc == 1) +2207c00000000000140000000000005 > 2206c00000000000000a0005 (cc == 2) +780000000000000000000000 <> 7c0000000000000000000000 (cc == 3) +780000000000000000000000 == 780000000000000000000000 (cc == 0) +7c0000000000000000000000 == 7c0000000000000000000000 (cc == 0)