HVX floating point (aka QFloat) is a float representation that can be used
as an alternative to IEEE floating-point. The conventional use case is for
loads/stores to use IEEE single/half precision and computation local to the
DSP uses qfloat.
Also: extended-qfloat semantics are provided for v79 and later.
In v2:
- HVX write conflicts are now logged as guest errors rather than decode
failures. q-reg conflicts now behave like v-regs: only multiple writes
including an unconditional write conflict.
- Updated write-conflict tests: formerly illegal HVX/Q-register cases now
continue w/o exception. Test inputs are tightened to validate behavior.
- HVX stores copy only MAX_VEC_SIZE_BYTES.
- QFloat fixes:
- preserve ext bits when a predicated vector write is not taken.
- vconv_h_hf_rnd always nearest-even, handle NaNs as signed INT16_{MIN,MAX}.
- Added coverage for false-pred ext-bit preservation, USR.FPRND modes, NaN
conversion.
On the v1 thread below, there was some confusion regarding the PRM and
perhaps the text could be clearer. We will follow up with the architecture
team to seek an update to the PRM. Indeed, on the real device,
V6_vconv_h_hf_rnd rounds to nearest even, independent of USR.
v1:
https://lore.kernel.org/qemu-devel/[email protected]/
Brian Cain (10):
target/hexagon: Allow temporary HVX write and future write
tests/tcg/hexagon: Cover HVX vector write conflicts
target/hexagon: add v81 HVX compare, align, and convert instructions
target/hexagon: fix V6_vcmov reserved-bit encoding
target/hexagon: use vector payload size for HVX operations
target/hexagon: reserve internal HVX vector state for QFloat
target/hexagon: add the QFloat logic
target/hexagon: select QFloat inst semantics by rev
linux-user/hexagon: add v75-v81 HWCAPs
tests/tcg/hexagon: add v81, ext-QFloat tests
docs/system/hexagon/emulation.rst | 8 +-
target/hexagon/gen_tcg_hvx.h | 242 +++---
target/hexagon/mmvec/hvx_ieee_fp.h | 3 +
target/hexagon/mmvec/macros.h | 119 ++-
target/hexagon/mmvec/mmvec.h | 90 +-
target/hexagon/mmvec/mmvec_qfloat.h | 133 +++
target/hexagon/translate.h | 20 +-
target/hexagon/reg_fields_def.h.inc | 2 +
hw/hexagon/hexagon_hvx_context.c | 5 +
linux-user/hexagon/elfload.c | 9 +
target/hexagon/genptr.c | 18 +-
target/hexagon/mmvec/hvx_ieee_fp.c | 24 +
target/hexagon/mmvec/hvx_qfloat.c | 831 +++++++++++++++++++
target/hexagon/mmvec/system_ext_mmvec.c | 8 +-
target/hexagon/op_helper.c | 34 +-
target/hexagon/translate.c | 31 +-
tests/tcg/hexagon/check_rev_gating.c | 12 +-
tests/tcg/hexagon/hvx_ext.c | 248 ++++++
tests/tcg/hexagon/multiple-writes.c | 107 ++-
tests/tcg/hexagon/qfloat_v81.c | 119 +++
tests/tcg/hexagon/v81_hvx.c | 259 ++++++
target/hexagon/tag_rev_info.c.inc | 54 ++
target/hexagon/gen_tcg_funcs.py | 2 +-
target/hexagon/hex_common.py | 93 ++-
target/hexagon/imported/mmvec/encode_ext.def | 63 +-
target/hexagon/imported/mmvec/ext.idef | 235 ++++++
target/hexagon/meson.build | 1 +
tests/tcg/hexagon/meson.build | 25 +
28 files changed, 2581 insertions(+), 214 deletions(-)
create mode 100644 target/hexagon/mmvec/mmvec_qfloat.h
create mode 100644 target/hexagon/mmvec/hvx_qfloat.c
create mode 100644 tests/tcg/hexagon/hvx_ext.c
create mode 100644 tests/tcg/hexagon/qfloat_v81.c
create mode 100644 tests/tcg/hexagon/v81_hvx.c
--
2.34.1