From: Florian Krohm Date: Mon, 17 Jun 2013 19:04:24 +0000 (+0000) Subject: valgrind side changes to support the new IRops introduced X-Git-Tag: svn/VALGRIND_3_9_0~259 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=849b1058149da604744f19f5816a2bd19991bbdf;p=thirdparty%2Fvalgrind.git valgrind side changes to support the new IRops introduced in VEX r2727 (conversion ops between binary floating point and decimal floating point). Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com). Part of fixing BZ 307113. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13428 --- diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 22738f63dc..74d4ca598f 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -3437,22 +3437,31 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce, /* I32(rm) x I64/D64 -> D64/I64 */ return mkLazy2(mce, Ity_I64, vatom1, vatom2); + case Iop_F32toD32: + case Iop_F64toD32: + case Iop_F128toD32: + case Iop_D32toF32: + case Iop_D64toF32: + case Iop_D128toF32: + /* I32(rm) x F32/F64/F128/D32/D64/D128 -> D32/F32 */ + return mkLazy2(mce, Ity_I32, vatom1, vatom2); + + case Iop_F32toD64: case Iop_F64toD64: + case Iop_F128toD64: + case Iop_D32toF64: case Iop_D64toF64: - /* I32(rm) x F64/D64 -> D64/F64 */ - return mkLazy2(mce, Ity_I64, vatom1, vatom2); - - case Iop_F64toD128: - /* I32(rm) x F64 -> D128 */ - return mkLazy2(mce, Ity_I128, vatom1, vatom2); - case Iop_D128toF64: - /* I32(rm) x D128 -> F64 */ + /* I32(rm) x F32/F64/F128/D32/D64/D128 -> D64/F64 */ return mkLazy2(mce, Ity_I64, vatom1, vatom2); + case Iop_F32toD128: + case Iop_F64toD128: case Iop_F128toD128: + case Iop_D32toF128: + case Iop_D64toF128: case Iop_D128toF128: - /* I32(rm) x F128/D128 -> D128/F128 */ + /* I32(rm) x F32/F64/F128/D32/D64/D128 -> D128/F128 */ return mkLazy2(mce, Ity_I128, vatom1, vatom2); case Iop_RoundF32toInt: diff --git a/memcheck/tests/vbit-test/irops.c b/memcheck/tests/vbit-test/irops.c index 09ba7b8172..c0ba5ee19f 100644 --- a/memcheck/tests/vbit-test/irops.c +++ b/memcheck/tests/vbit-test/irops.c @@ -509,11 +509,23 @@ static irop_t irops[] = { { DEFOP(Iop_D128toI64U, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_D128toI32S, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_D128toI32U, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F32toD32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F32toD64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F32toD128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F64toD32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_F64toD64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, - { DEFOP(Iop_D64toF64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_F64toD128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, - { DEFOP(Iop_D128toF64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F128toD32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_F128toD64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_F128toD128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D32toF32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D32toF64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D32toF128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D64toF32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D64toF64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D64toF128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D128toF32, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, + { DEFOP(Iop_D128toF64, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_D128toF128, UNDEF_ALL), .s390x = 1, .ppc64 = 0, .ppc32 = 0 }, { DEFOP(Iop_RoundD64toInt, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, { DEFOP(Iop_RoundD128toInt, UNDEF_ALL), .s390x = 0, .ppc64 = 1, .ppc32 = 1 }, @@ -984,6 +996,32 @@ get_irop(IROp op) rc /= 256; if (rc != 0) return NULL; } + /* PFPO Iops */ + case Iop_F32toD32: + case Iop_F32toD64: + case Iop_F32toD128: + case Iop_F64toD32: + case Iop_F64toD64: + case Iop_F64toD128: + case Iop_F128toD32: + case Iop_F128toD64: + case Iop_F128toD128: + case Iop_D32toF32: + case Iop_D32toF64: + case Iop_D32toF128: + case Iop_D64toF32: + case Iop_D64toF64: + case Iop_D64toF128: + case Iop_D128toF32: + case Iop_D128toF64: + case Iop_D128toF128: { + int rc; + /* These IROps require the Perform Floating Point Operation facility */ + rc = system(S390X_FEATURES " s390x-pfpo"); + // s390x_features returns 1 if feature does not exist + rc /= 256; + if (rc != 0) return NULL; + } } return p->s390x ? p : NULL; #endif diff --git a/memcheck/tests/vbit-test/util.c b/memcheck/tests/vbit-test/util.c index 4e0ad0d28a..b174a037b9 100644 --- a/memcheck/tests/vbit-test/util.c +++ b/memcheck/tests/vbit-test/util.c @@ -869,21 +869,57 @@ typeof_primop(IROp op, IRType *t_dst, IRType *t_arg1, IRType *t_arg2, case Iop_I64UtoD128: UNARY(Ity_I64, Ity_D128); + case Iop_F32toD32: + BINARY(ity_RMode, Ity_F32, Ity_D32); + + case Iop_F32toD64: + BINARY(ity_RMode, Ity_F32, Ity_D64); + + case Iop_F32toD128: + BINARY(ity_RMode, Ity_F32, Ity_D128); + + case Iop_F64toD32: + BINARY(ity_RMode, Ity_F64, Ity_D32); + case Iop_F64toD64: BINARY(ity_RMode, Ity_F64, Ity_D64); - case Iop_D64toF64: /* I64 bit pattern stored in Float register */ - BINARY(ity_RMode, Ity_D64, Ity_F64); - case Iop_F64toD128: BINARY(ity_RMode, Ity_F64, Ity_D128); - case Iop_D128toF64: - BINARY(ity_RMode, Ity_D128, Ity_F64); + case Iop_F128toD32: + BINARY(ity_RMode, Ity_F128, Ity_D32); + + case Iop_F128toD64: + BINARY(ity_RMode, Ity_F128, Ity_D64); case Iop_F128toD128: BINARY(ity_RMode, Ity_F128, Ity_D128); + case Iop_D32toF32: + BINARY(ity_RMode, Ity_D32, Ity_F32); + + case Iop_D32toF64: + BINARY(ity_RMode, Ity_D32, Ity_F64); + + case Iop_D32toF128: + BINARY(ity_RMode, Ity_D32, Ity_F128); + + case Iop_D64toF32: + BINARY(ity_RMode, Ity_D64, Ity_F32); + + case Iop_D64toF64: + BINARY(ity_RMode, Ity_D64, Ity_F64); + + case Iop_D64toF128: + BINARY(ity_RMode, Ity_D64, Ity_F128); + + case Iop_D128toF32: + BINARY(ity_RMode, Ity_D128, Ity_F32); + + case Iop_D128toF64: + BINARY(ity_RMode, Ity_D128, Ity_F64); + case Iop_D128toF128: BINARY(ity_RMode, Ity_D128, Ity_F128);