From: Florian Krohm Date: Tue, 12 Mar 2013 01:31:24 +0000 (+0000) Subject: s390: Support the SRNMT instruction. X-Git-Tag: svn/VALGRIND_3_9_0^2~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=530ec5e6ae152c1009304d722a03426d8cff4c05;p=thirdparty%2Fvalgrind.git s390: Support the SRNMT instruction. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com). Part of fixing BZ 307113. git-svn-id: svn://svn.valgrind.org/vex/trunk@2696 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index b013e192bd..7ffeef3214 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -8555,6 +8555,25 @@ s390_irgen_srnmb_wrapper(UChar b2, UShort d2) s390_format_S_RD(s390_irgen_SRNMB, b2, d2); } +/* Wrapper to validate the parameter as in SRNMB is not required, as all + the 8 values in op2addr[61:63] correspond to a valid DFP rounding mode */ +static const HChar * +s390_irgen_SRNMT(IRTemp op2addr) +{ + UInt input_mask, fpc_mask; + + input_mask = 7; + fpc_mask = 0x70; + + /* fpc[25:27] <- op2addr[61:63] + fpc = (fpc & ~(0x70)) | ((op2addr & 7) << 4) */ + put_fpc_w0(binop(Iop_Or32, binop(Iop_And32, get_fpc_w0(), mkU32(~fpc_mask)), + binop(Iop_Shl32, binop(Iop_And32, + unop(Iop_64to32, mkexpr(op2addr)), + mkU32(input_mask)), mkU8(4)))); + return "srnmt"; +} + static const HChar * s390_irgen_SFPC(UChar r1) @@ -13976,7 +13995,8 @@ s390_decode_4byte_and_irgen(UChar *bytes) case 0xb2b2: /* LPSWE */ goto unimplemented; case 0xb2b8: s390_irgen_srnmb_wrapper(ovl.fmt.S.b2, ovl.fmt.S.d2); goto ok; - case 0xb2b9: /* SRNMT */ goto unimplemented; + case 0xb2b9: s390_format_S_RD(s390_irgen_SRNMT, ovl.fmt.S.b2, ovl.fmt.S.d2); + goto ok; case 0xb2bd: /* LFAS */ goto unimplemented; case 0xb2e0: /* SCCTR */ goto unimplemented; case 0xb2e1: /* SPCTR */ goto unimplemented;