[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 61/76] target/riscv: rvv-0.9: floating-point/integer type-co
From: |
Richard Henderson |
Subject: |
Re: [RFC v2 61/76] target/riscv: rvv-0.9: floating-point/integer type-convert instructions |
Date: |
Fri, 31 Jul 2020 09:32:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/22/20 2:16 AM, frank.chang@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~
- [RFC v2 56/76] target/riscv: rvv-0.9: widening integer reduction instructions, (continued)
- [RFC v2 56/76] target/riscv: rvv-0.9: widening integer reduction instructions, frank . chang, 2020/07/22
- [RFC v2 57/76] target/riscv: rvv-0.9: mask-register logical instructions, frank . chang, 2020/07/22
- [RFC v2 58/76] target/riscv: rvv-0.9: slide instructions, frank . chang, 2020/07/22
- [RFC v2 59/76] target/riscv: rvv-0.9: floating-point slide instructions, frank . chang, 2020/07/22
- [RFC v2 60/76] target/riscv: rvv-0.9: narrowing fixed-point clip instructions, frank . chang, 2020/07/22
- [RFC v2 61/76] target/riscv: rvv-0.9: floating-point/integer type-convert instructions, frank . chang, 2020/07/22
- Re: [RFC v2 61/76] target/riscv: rvv-0.9: floating-point/integer type-convert instructions,
Richard Henderson <=
- [RFC v2 62/76] target/riscv: rvv-0.9: single-width floating-point reduction, frank . chang, 2020/07/22
- [RFC v2 63/76] target/riscv: rvv-0.9: widening floating-point reduction instructions, frank . chang, 2020/07/22
- [RFC v2 64/76] target/riscv: rvv-0.9: single-width scaling shift instructions, frank . chang, 2020/07/22
- [RFC v2 65/76] target/riscv: rvv-0.9: remove widening saturating scaled multiply-add, frank . chang, 2020/07/22
- [RFC v2 66/76] target/riscv: rvv-0.9: remove vmford.vv and vmford.vf, frank . chang, 2020/07/22
- [RFC v2 67/76] target/riscv: rvv-0.9: remove integer extract instruction, frank . chang, 2020/07/22