On 26.09.2026 14:23, Brian Cain wrote:
Signed-off-by: Brian Cain <[email protected]>
---
  target/hexagon/mmvec/hvx_ieee_fp.h           |  2 +
  target/hexagon/mmvec/macros.h                |  2 +
  target/hexagon/mmvec/hvx_ieee_fp.c           | 15 ++++
  target/hexagon/tag_rev_info.c.inc            | 13 ++++
  target/hexagon/imported/mmvec/encode_ext.def | 10 +++
  target/hexagon/imported/mmvec/ext.idef       | 74 ++++++++++++++++++++
  6 files changed, 116 insertions(+)

+ITERATOR_INSN_SHIFT_SLOT_FLT(16, vconv_h_hf_rnd,"Vd32.h=Vu32.hf:rnd",
+    "Vector conversion of hf16 format to int hw, round to nearest even",
+    VdV.h[i] = float16_to_int16_scalbn(VuV.hf[i], float_round_nearest_even, 0,
+                                        &env->hvx_fp_status))
+
I think there are two issues with vconv_h_hf_rnd. Because it's using float16_to_int16_scalbn:

- It hard-codes nearest-even instead of using USR.FPRND.
- It uses generic conversion, which returns INT16_MAX for negative NaNs. Hexagon requires INT16_MIN.

Reply via email to