On 7/22/20 2:16 AM, frank.ch...@sifive.com wrote: > @@ -994,6 +994,12 @@ DEF_HELPER_5(vfcvt_f_xu_v_d, void, ptr, ptr, ptr, env, > i32) > DEF_HELPER_5(vfcvt_f_x_v_h, void, ptr, ptr, ptr, env, i32) > DEF_HELPER_5(vfcvt_f_x_v_w, void, ptr, ptr, ptr, env, i32) > DEF_HELPER_5(vfcvt_f_x_v_d, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_xu_f_v_h, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_xu_f_v_w, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_xu_f_v_d, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_x_f_v_h, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_x_f_v_w, void, ptr, ptr, ptr, env, i32) > +DEF_HELPER_5(vfcvt_rtz_x_f_v_d, void, ptr, ptr, ptr, env, i32)
You do not need new rtz helpers. What you need to do is adjust the translator to set the correct rounding mode. At present we've got > #define GEN_OPFV_TRANS(NAME, CHECK) \ > static bool trans_##NAME(DisasContext *s, arg_rmr *a) \ > { \ > if (CHECK(s, a)) { \ > uint32_t data = 0; \ > static gen_helper_gvec_3_ptr * const fns[3] = { \ > gen_helper_##NAME##_h, \ > gen_helper_##NAME##_w, \ > gen_helper_##NAME##_d, \ > }; \ > TCGLabel *over = gen_new_label(); \ > gen_set_rm(s, 7); \ were we set the rounding mode to "dynamic", i.e. pull the mode out of FRM. And will in fact raise SIGILL if FRM has been set to an illegal value. Which, I'm sure, should not happen for this instruction. For these insns, you want to use gen_set_rm(s, 1), which will set the rounding mode to float_round_to_zero. (As a separate patch, it would be nice to add an enumeration for the various settings of FRM, replacing the integer constants that are currently scattered about the code.) r~