Mark Wielaard 0ad11a
Subject: [PATCH v2] s390x: Fix unrecognized instruction fiebra
Mark Wielaard 3e15c8
Mark Wielaard 3e15c8
Add support for the z/Architecture instructions FIEBRA and FIDBRA.
Mark Wielaard 3e15c8
Also add a suitable test case.
Mark Wielaard 3e15c8
Mark Wielaard 3e15c8
GCC may emit FIEBRA since the following GCC patch:
Mark Wielaard 3e15c8
Mark Wielaard 3e15c8
  S/390: Add support for the "load fp integer" instructions:
Mark Wielaard 3e15c8
  https://gcc.gnu.org/ml/gcc-patches/2013-09/msg00112.html
Mark Wielaard 3e15c8
Mark Wielaard 3e15c8
Index: valgrind/none/tests/s390x/rounding-6.c
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/none/tests/s390x/rounding-6.c
Mark Wielaard 0ad11a
+++ valgrind/none/tests/s390x/rounding-6.c
Mark Wielaard 3e15c8
@@ -44,6 +44,20 @@ do { \
Mark Wielaard 3e15c8
           opcode, src, dst, cc, rtext(round));        \
Mark Wielaard 3e15c8
 } while (0)
Mark Wielaard 3e15c8
 
Mark Wielaard 0ad11a
+#define round_to_int(opcode,type,round,value)                   \
Mark Wielaard 0ad11a
+do {                                                            \
Mark Wielaard 0ad11a
+   type src = value;                                            \
Mark Wielaard 0ad11a
+   type dst;                                                    \
Mark Wielaard 0ad11a
+                                                                \
Mark Wielaard 0ad11a
+   __asm__ volatile (opcode " %[dst]," #round ",%[src]\n\t"     \
Mark Wielaard 0ad11a
+                     : [dst] "=f"(dst)                          \
Mark Wielaard 0ad11a
+                     : [src] "f"(src)                           \
Mark Wielaard 0ad11a
+                     : );                                       \
Mark Wielaard 0ad11a
+                                                                \
Mark Wielaard 0ad11a
+   printf("%s %.5f\t-> %g  %s\n",                               \
Mark Wielaard 0ad11a
+          opcode, src, dst, rtext(round));                      \
Mark Wielaard 3e15c8
+} while (0)
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
 #define cfebr(value, round) \
Mark Wielaard 3e15c8
         convert_to_int("cfebr",float,int32_t,PRId32,round,value)
Mark Wielaard 3e15c8
@@ -54,6 +68,11 @@ do { \
Mark Wielaard 3e15c8
 #define cgdbr(value, round) \
Mark Wielaard 3e15c8
         convert_to_int("cgdbr",double,int64_t,PRId64,round,value)
Mark Wielaard 3e15c8
 
Mark Wielaard 0ad11a
+#define fiebr(value, round) \
Mark Wielaard 0ad11a
+        round_to_int("fiebr",float,round,value)
Mark Wielaard 0ad11a
+#define fidbr(value, round) \
Mark Wielaard 0ad11a
+        round_to_int("fidbr",double,round,value)
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
 void
Mark Wielaard 3e15c8
 set_rounding_mode(unsigned mode)
Mark Wielaard 3e15c8
 {
Mark Wielaard 3e15c8
@@ -117,5 +136,25 @@ int main(void)
Mark Wielaard 3e15c8
       cgdbr(dval[j], M3_BFP_ROUND_NEGINF);
Mark Wielaard 3e15c8
    }
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
+   /* f32 -> f32, round to int */
Mark Wielaard 3e15c8
+   for (j = 0; j < sizeof dval / sizeof dval[0]; ++j) {
Mark Wielaard 3e15c8
+      set_rounding_mode(FPC_BFP_ROUND_ZERO);
Mark Wielaard 0ad11a
+      fiebr(dval[j], M3_BFP_ROUND_NEAREST_EVEN);
Mark Wielaard 3e15c8
+      set_rounding_mode(FPC_BFP_ROUND_NEAREST_EVEN);
Mark Wielaard 0ad11a
+      fiebr(dval[j], M3_BFP_ROUND_ZERO);
Mark Wielaard 0ad11a
+      fiebr(dval[j], M3_BFP_ROUND_POSINF);
Mark Wielaard 0ad11a
+      fiebr(dval[j], M3_BFP_ROUND_NEGINF);
Mark Wielaard 3e15c8
+   }
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   /* f64 -> f64, round to int */
Mark Wielaard 3e15c8
+   for (j = 0; j < sizeof dval / sizeof dval[0]; ++j) {
Mark Wielaard 3e15c8
+      set_rounding_mode(FPC_BFP_ROUND_ZERO);
Mark Wielaard 0ad11a
+      fidbr(dval[j], M3_BFP_ROUND_NEAREST_EVEN);
Mark Wielaard 3e15c8
+      set_rounding_mode(FPC_BFP_ROUND_NEAREST_EVEN);
Mark Wielaard 0ad11a
+      fidbr(dval[j], M3_BFP_ROUND_ZERO);
Mark Wielaard 0ad11a
+      fidbr(dval[j], M3_BFP_ROUND_POSINF);
Mark Wielaard 0ad11a
+      fidbr(dval[j], M3_BFP_ROUND_NEGINF);
Mark Wielaard 3e15c8
+   }
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
    return 0;
Mark Wielaard 3e15c8
 }
Mark Wielaard 3e15c8
Index: valgrind/none/tests/s390x/rounding-6.stdout.exp
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/none/tests/s390x/rounding-6.stdout.exp
Mark Wielaard 0ad11a
+++ valgrind/none/tests/s390x/rounding-6.stdout.exp
Mark Wielaard 3e15c8
@@ -142,3 +142,75 @@ cgdbr 0.000000	-> 0	cc = 0  [-> nearest
Mark Wielaard 3e15c8
 cgdbr 0.000000	-> 0	cc = 0  [-> 0]
Mark Wielaard 3e15c8
 cgdbr 0.000000	-> 0	cc = 0  [-> +inf]
Mark Wielaard 3e15c8
 cgdbr 0.000000	-> 0	cc = 0  [-> -inf]
Mark Wielaard 0ad11a
+fiebr 1.25000	-> 1  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr 1.25000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fiebr 1.25000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fiebr 1.25000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fiebr 1.50000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr 1.50000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fiebr 1.50000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fiebr 1.50000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fiebr 2.50000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr 2.50000	-> 2  [-> 0]
Mark Wielaard 0ad11a
+fiebr 2.50000	-> 3  [-> +inf]
Mark Wielaard 0ad11a
+fiebr 2.50000	-> 2  [-> -inf]
Mark Wielaard 0ad11a
+fiebr 1.75000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr 1.75000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fiebr 1.75000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fiebr 1.75000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fiebr -1.25000	-> -1  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr -1.25000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fiebr -1.25000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fiebr -1.25000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fiebr -1.50000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr -1.50000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fiebr -1.50000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fiebr -1.50000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fiebr -2.50000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr -2.50000	-> -2  [-> 0]
Mark Wielaard 0ad11a
+fiebr -2.50000	-> -2  [-> +inf]
Mark Wielaard 0ad11a
+fiebr -2.50000	-> -3  [-> -inf]
Mark Wielaard 0ad11a
+fiebr -1.75000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr -1.75000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fiebr -1.75000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fiebr -1.75000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fiebr 0.00000	-> 0  [-> nearest even]
Mark Wielaard 0ad11a
+fiebr 0.00000	-> 0  [-> 0]
Mark Wielaard 0ad11a
+fiebr 0.00000	-> 0  [-> +inf]
Mark Wielaard 0ad11a
+fiebr 0.00000	-> 0  [-> -inf]
Mark Wielaard 0ad11a
+fidbr 1.25000	-> 1  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr 1.25000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fidbr 1.25000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fidbr 1.25000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fidbr 1.50000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr 1.50000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fidbr 1.50000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fidbr 1.50000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fidbr 2.50000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr 2.50000	-> 2  [-> 0]
Mark Wielaard 0ad11a
+fidbr 2.50000	-> 3  [-> +inf]
Mark Wielaard 0ad11a
+fidbr 2.50000	-> 2  [-> -inf]
Mark Wielaard 0ad11a
+fidbr 1.75000	-> 2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr 1.75000	-> 1  [-> 0]
Mark Wielaard 0ad11a
+fidbr 1.75000	-> 2  [-> +inf]
Mark Wielaard 0ad11a
+fidbr 1.75000	-> 1  [-> -inf]
Mark Wielaard 0ad11a
+fidbr -1.25000	-> -1  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr -1.25000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fidbr -1.25000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fidbr -1.25000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fidbr -1.50000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr -1.50000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fidbr -1.50000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fidbr -1.50000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fidbr -2.50000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr -2.50000	-> -2  [-> 0]
Mark Wielaard 0ad11a
+fidbr -2.50000	-> -2  [-> +inf]
Mark Wielaard 0ad11a
+fidbr -2.50000	-> -3  [-> -inf]
Mark Wielaard 0ad11a
+fidbr -1.75000	-> -2  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr -1.75000	-> -1  [-> 0]
Mark Wielaard 0ad11a
+fidbr -1.75000	-> -1  [-> +inf]
Mark Wielaard 0ad11a
+fidbr -1.75000	-> -2  [-> -inf]
Mark Wielaard 0ad11a
+fidbr 0.00000	-> 0  [-> nearest even]
Mark Wielaard 0ad11a
+fidbr 0.00000	-> 0  [-> 0]
Mark Wielaard 0ad11a
+fidbr 0.00000	-> 0  [-> +inf]
Mark Wielaard 0ad11a
+fidbr 0.00000	-> 0  [-> -inf]
Mark Wielaard 3e15c8
Index: valgrind/VEX/priv/guest_s390_toIR.c
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/VEX/priv/guest_s390_toIR.c
Mark Wielaard 0ad11a
+++ valgrind/VEX/priv/guest_s390_toIR.c
Mark Wielaard 0ad11a
@@ -12384,6 +12384,32 @@ s390_irgen_LXEB(UChar r1, IRTemp op2addr
Mark Wielaard 3e15c8
 }
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
 static const HChar *
Mark Wielaard 3e15c8
+s390_irgen_FIEBRA(UChar m3, UChar m4 __attribute__((unused)),
Mark Wielaard 3e15c8
+		  UChar r1, UChar r2)
Mark Wielaard 3e15c8
+{
Mark Wielaard 3e15c8
+   IRTemp result = newTemp(Ity_F32);
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   assign(result, binop(Iop_RoundF32toInt, mkexpr(encode_bfp_rounding_mode(m3)),
Mark Wielaard 3e15c8
+                        get_fpr_w0(r2)));
Mark Wielaard 3e15c8
+   put_fpr_w0(r1, mkexpr(result));
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   return "fiebra";
Mark Wielaard 3e15c8
+}
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+static const HChar *
Mark Wielaard 3e15c8
+s390_irgen_FIDBRA(UChar m3, UChar m4 __attribute__((unused)),
Mark Wielaard 3e15c8
+		  UChar r1, UChar r2)
Mark Wielaard 3e15c8
+{
Mark Wielaard 3e15c8
+   IRTemp result = newTemp(Ity_F64);
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   assign(result, binop(Iop_RoundF64toInt, mkexpr(encode_bfp_rounding_mode(m3)),
Mark Wielaard 3e15c8
+                        get_fpr_dw0(r2)));
Mark Wielaard 3e15c8
+   put_fpr_dw0(r1, mkexpr(result));
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   return "fidbra";
Mark Wielaard 3e15c8
+}
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+static const HChar *
Mark Wielaard 3e15c8
 s390_irgen_LNEBR(UChar r1, UChar r2)
Mark Wielaard 3e15c8
 {
Mark Wielaard 3e15c8
    IRTemp result = newTemp(Ity_F32);
Mark Wielaard 0ad11a
@@ -14520,11 +14546,15 @@ s390_decode_4byte_and_irgen(const UChar
Mark Wielaard 3e15c8
    case 0xb350: /* TBEDR */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb351: /* TBDR */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb353: /* DIEBR */ goto unimplemented;
Mark Wielaard 3e15c8
-   case 0xb357: /* FIEBR */ goto unimplemented;
Mark Wielaard 3e15c8
+   case 0xb357: s390_format_RRF_UUFF(s390_irgen_FIEBRA, ovl.fmt.RRF2.m3,
Mark Wielaard 3e15c8
+                                     ovl.fmt.RRF2.m4, ovl.fmt.RRF2.r1,
Mark Wielaard 3e15c8
+                                     ovl.fmt.RRF2.r2);  goto ok;
Mark Wielaard 3e15c8
    case 0xb358: /* THDER */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb359: /* THDR */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb35b: /* DIDBR */ goto unimplemented;
Mark Wielaard 3e15c8
-   case 0xb35f: /* FIDBR */ goto unimplemented;
Mark Wielaard 3e15c8
+   case 0xb35f: s390_format_RRF_UUFF(s390_irgen_FIDBRA, ovl.fmt.RRF2.m3,
Mark Wielaard 3e15c8
+                                     ovl.fmt.RRF2.m4, ovl.fmt.RRF2.r1,
Mark Wielaard 3e15c8
+                                     ovl.fmt.RRF2.r2);  goto ok;
Mark Wielaard 3e15c8
    case 0xb360: /* LPXR */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb361: /* LNXR */ goto unimplemented;
Mark Wielaard 3e15c8
    case 0xb362: /* LTXR */ goto unimplemented;
Mark Wielaard 3e15c8
Index: valgrind/VEX/priv/host_s390_defs.c
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/VEX/priv/host_s390_defs.c
Mark Wielaard 0ad11a
+++ valgrind/VEX/priv/host_s390_defs.c
Mark Wielaard 3e15c8
@@ -3939,6 +3939,40 @@ s390_emit_LEXBRA(UChar *p, UChar m3, UCh
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
 static UChar *
Mark Wielaard 3e15c8
+s390_emit_FIEBRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2)
Mark Wielaard 3e15c8
+{
Mark Wielaard 3e15c8
+   vassert(m3 == 0 || s390_host_has_fpext);
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) {
Mark Wielaard 3e15c8
+      if (m4 == 0)
Mark Wielaard 0ad11a
+         s390_disasm(ENC4(MNM, FPR, UINT, FPR), "fiebr", r1, m3, r2);
Mark Wielaard 3e15c8
+      else
Mark Wielaard 3e15c8
+         s390_disasm(ENC5(MNM, FPR, UINT, FPR, UINT),
Mark Wielaard 3e15c8
+                     "fiebra", r1, m3, r2, m4);
Mark Wielaard 3e15c8
+   }
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   return emit_RRF2(p, 0xb3570000, m3, m4, r1, r2);
Mark Wielaard 3e15c8
+}
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+static UChar *
Mark Wielaard 3e15c8
+s390_emit_FIDBRA(UChar *p, UChar m3, UChar m4, UChar r1, UChar r2)
Mark Wielaard 3e15c8
+{
Mark Wielaard 3e15c8
+   vassert(m3 == 0 || s390_host_has_fpext);
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM)) {
Mark Wielaard 3e15c8
+      if (m4 == 0)
Mark Wielaard 0ad11a
+         s390_disasm(ENC4(MNM, FPR, UINT, FPR), "fidbr", r1, m3, r2);
Mark Wielaard 3e15c8
+      else
Mark Wielaard 3e15c8
+         s390_disasm(ENC5(MNM, FPR, UINT, FPR, UINT),
Mark Wielaard 3e15c8
+                     "fidbra", r1, m3, r2, m4);
Mark Wielaard 3e15c8
+   }
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+   return emit_RRF2(p, 0xb35f0000, m3, m4, r1, r2);
Mark Wielaard 3e15c8
+}
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
+static UChar *
Mark Wielaard 3e15c8
 s390_emit_MEEBR(UChar *p, UChar r1, UChar r2)
Mark Wielaard 3e15c8
 {
Mark Wielaard 3e15c8
    if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM))
Mark Wielaard 3e15c8
@@ -6693,6 +6727,8 @@ s390_insn_as_string(const s390_insn *ins
Mark Wielaard 3e15c8
       case S390_BFP_F64_TO_F128:
Mark Wielaard 3e15c8
       case S390_BFP_F128_TO_F32:
Mark Wielaard 3e15c8
       case S390_BFP_F128_TO_F64: op = "v-f2f"; break;
Mark Wielaard 3e15c8
+      case S390_BFP_F32_TO_F32I:
Mark Wielaard 3e15c8
+      case S390_BFP_F64_TO_F64I: op = "v-f2fi"; break;
Mark Wielaard 3e15c8
       default: goto fail;
Mark Wielaard 3e15c8
       }
Mark Wielaard 3e15c8
       s390_sprintf(buf, "%M %R,%R", op, insn->variant.bfp_convert.dst_hi,
Mark Wielaard 3e15c8
@@ -8964,6 +9000,10 @@ s390_insn_bfp_convert_emit(UChar *buf, c
Mark Wielaard 3e15c8
    case S390_BFP_F128_TO_F32: return s390_emit_LEXBRA(buf, m3, m4, r1, r2);
Mark Wielaard 3e15c8
    case S390_BFP_F128_TO_F64: return s390_emit_LDXBRA(buf, m3, m4, r1, r2);
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
+      /* Load FP integer */
Mark Wielaard 3e15c8
+   case S390_BFP_F32_TO_F32I: return s390_emit_FIEBRA(buf, m3, m4, r1, r2);
Mark Wielaard 3e15c8
+   case S390_BFP_F64_TO_F64I: return s390_emit_FIDBRA(buf, m3, m4, r1, r2);
Mark Wielaard 3e15c8
+
Mark Wielaard 3e15c8
    default: goto fail;
Mark Wielaard 3e15c8
    }
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
Index: valgrind/VEX/priv/host_s390_defs.h
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/VEX/priv/host_s390_defs.h
Mark Wielaard 0ad11a
+++ valgrind/VEX/priv/host_s390_defs.h
Mark Wielaard 3e15c8
@@ -242,7 +242,9 @@ typedef enum {
Mark Wielaard 3e15c8
    S390_BFP_F128_TO_U32,
Mark Wielaard 3e15c8
    S390_BFP_F128_TO_U64,
Mark Wielaard 3e15c8
    S390_BFP_F128_TO_F32,
Mark Wielaard 3e15c8
-   S390_BFP_F128_TO_F64
Mark Wielaard 3e15c8
+   S390_BFP_F128_TO_F64,
Mark Wielaard 3e15c8
+   S390_BFP_F32_TO_F32I,
Mark Wielaard 3e15c8
+   S390_BFP_F64_TO_F64I
Mark Wielaard 3e15c8
 } s390_bfp_conv_t;
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
 /* Type conversion operations: to and/or from decimal floating point */
Mark Wielaard 3e15c8
Index: valgrind/VEX/priv/host_s390_isel.c
Mark Wielaard 3e15c8
===================================================================
Mark Wielaard 0ad11a
--- valgrind.orig/VEX/priv/host_s390_isel.c
Mark Wielaard 0ad11a
+++ valgrind/VEX/priv/host_s390_isel.c
Mark Wielaard 3e15c8
@@ -2378,6 +2378,8 @@ s390_isel_float_expr_wrk(ISelEnv *env, I
Mark Wielaard 3e15c8
          return dst;
Mark Wielaard 3e15c8
 
Mark Wielaard 3e15c8
       case Iop_F64toF32:  conv = S390_BFP_F64_TO_F32; goto convert_float;
Mark Wielaard 3e15c8
+      case Iop_RoundF32toInt: conv = S390_BFP_F32_TO_F32I; goto convert_float;
Mark Wielaard 3e15c8
+      case Iop_RoundF64toInt: conv = S390_BFP_F64_TO_F64I; goto convert_float;
Mark Wielaard 3e15c8
       case Iop_I32StoF32: conv = S390_BFP_I32_TO_F32; goto convert_int;
Mark Wielaard 3e15c8
       case Iop_I32UtoF32: conv = S390_BFP_U32_TO_F32; goto convert_int;
Mark Wielaard 3e15c8
       case Iop_I64StoF32: conv = S390_BFP_I64_TO_F32; goto convert_int;