]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
PPC64, fix output for xvcvdpsp instruction.
authorCarl Love <carll@us.ibm.com>
Fri, 22 Mar 2019 17:42:27 +0000 (12:42 -0500)
committerCarl Love <carll@us.ibm.com>
Fri, 22 Mar 2019 17:42:27 +0000 (12:42 -0500)
The instruction should write the output to the upper and lower 32-bit
halfs of the results.

Valgrind bugzilla 405733.

NEWS
VEX/priv/guest_ppc_toIR.c

diff --git a/NEWS b/NEWS
index a18d3406abdb69536438092f2f84b193dc1831cc..c2a78482f6ae4b4f9aac3f6b2497d9530f4e18b3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -119,6 +119,7 @@ where XXXXXX is the bug number as listed below.
 405363  PPC64, xvcvdpsxws, xvcvdpuxws, do not handle NaN arguments correctly.
 405365  PPC64, function _get_maxmin_fp_NaN() doesn't handle QNaN, SNaN case
         correctly.
+405733  PPC64, xvcvdpsp should write 32-bit result to upper and lower 32-bits of the 64-bit destination field.
 
 n-i-bz  add syswrap for PTRACE_GET|SET_THREAD_AREA on amd64.
 n-i-bz  Fix callgrind_annotate non deterministic order for equal total
index 3725e6ae9cfab887d26417b29db39efa64296560..9bc7c3bf7c5fa0b4254805d61bdde044f3d1aba6 100644 (file)
@@ -16332,6 +16332,9 @@ dis_vx_conv ( UInt theInstr, UInt opc2 )
       case 0x312: // xvcvdpsp (VSX Vector round Double-Precision to single-precision
                   //           and Convert to Single-Precision format)
          DIP("xvcvdpsp v%u,v%u\n", XT, XB);
+
+         /* Note, the 32-bit result is put into the upper and lower bits of the
+            doubleword result.  */
          putVSReg( XT,
                    binop( Iop_64HLtoV128,
                           binop( Iop_32HLto64,
@@ -16340,14 +16343,22 @@ dis_vx_conv ( UInt theInstr, UInt opc2 )
                                              binop( Iop_RoundF64toF32,
                                                     get_IR_roundingmode(),
                                                     mkexpr( xB ) ) ) ),
-                                 mkU32( 0 ) ),
+                                 unop( Iop_ReinterpF32asI32,
+                                       unop( Iop_TruncF64asF32,
+                                             binop( Iop_RoundF64toF32,
+                                                    get_IR_roundingmode(),
+                                                    mkexpr( xB ) ) ) ) ),
                           binop( Iop_32HLto64,
                                  unop( Iop_ReinterpF32asI32,
                                        unop( Iop_TruncF64asF32,
                                              binop( Iop_RoundF64toF32,
                                                     get_IR_roundingmode(),
                                                     mkexpr( xB2 ) ) ) ),
-                                 mkU32( 0 ) ) ) );
+                                 unop( Iop_ReinterpF32asI32,
+                                       unop( Iop_TruncF64asF32,
+                                             binop( Iop_RoundF64toF32,
+                                                    get_IR_roundingmode(),
+                                                    mkexpr( xB2 ) ) ) ) ) ) );
          break;
       case 0x390: // xvcvdpuxds (VSX Vector truncate Double-Precision to integer
                   //             and Convert to Unsigned Integer Doubleword format