]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
valgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128.
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 26 Dec 2012 17:48:46 +0000 (17:48 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 26 Dec 2012 17:48:46 +0000 (17:48 +0000)
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

memcheck/mc_translate.c
memcheck/tests/vbit-test/irops.c
memcheck/tests/vbit-test/util.c
none/tests/s390x/dfp-3.c
none/tests/s390x/dfp-3.stdout.exp

index 0931ea32b2d9da4f4d0f938fd75735a758cfb97f..65a1647187449e55025d1e03f93eb8c99ab393d5 100644 (file)
@@ -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 */
index 88157779967ea272c5913ba7bf3b9d3f26fa2fc1..a82f0c24b771d9571d7a9c8c6db9d89801066640 100644 (file)
@@ -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 },
index 718df63db8e3240c21db32501f932ec7e870ccee..ebfe54be46bf3068de596fb7baa39f374f77b33c 100644 (file)
@@ -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:
index f1c9969bc0551f03b8b8946fa21629811794ac67..ed0177c69fa8bd6757446215c48534b1d776a4ec 100644 (file)
@@ -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;
 }
index 066ecc82d41d7ea34780f3d2fc8414b16840edef..83c422fc1fb8b8a68c6ae77bba8212d560212c9f 100644 (file)
@@ -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)