This patchset adds 59 HVX floating point instructions from Hexagon
revisions v68 and v73 that were missing in qemu. Tests are also added at
the end.
v1: https://lore.kernel.org/qemu-devel/cover.1774271525.git.matheus.bernardino@oss.qualcomm.com/
Changes in v2:
- Renamed kvx_ieee.{c,h} to hvx_ieee_fp.{c,h}
- Dedicated HVX floating-point status: Added a separate hvx_fp_status
field in CPUArchState for HVX IEEE FP operations. This isolates HVX
FP state from scalar FP operations and allows configuring the
correct default NaN pattern for HVX (0x7FFF... instead of
0xFFFF...)
- Disabled IEEE FP behavior: When the HVX IEEE FP extension is
disabled, instructions now zero out their destination registers
instead of being complete no-ops. This matches actual hardware
behavior more closely
- Fixed NaN comparison ordering: Rewrote the comparison functions
(fCMPGT_SF, fCMPGT_HF, fCMPGT_BF) with proper NaN ordering
semantics: QNaN > SNaN > +Inf > numbers > -Inf > SNaN_neg >
QNaN_neg
- Simplified FP helper macros: Removed redundant NaN checks from
DEF_FP_INSN_2/DEF_FP_INSN_3 macros since the softfloat library
handles NaN propagation correctly when default_nan_mode is enabled
- Expanded test coverage:
- Tests to cover NaN vs NaN, NaN vs Inf, and NaN vs regular numbers
- Added tests for vcmp_gtand/vcmp_gtor variants
- Added bfloat tests
- Added .new register usage tests for disabled IEEE FP
Brian Cain (1):
tests/docker: Update hexagon cross toolchain to 22.1.0
Matheus Tavares Bernardino (15):
target/hexagon: fix incorrect/too-permissive HVX encodings
target/hexagon/cpu: add HVX IEEE FP extension
hexagon: group cpu configurations in their own struct
hexagon: print info on "-d in_asm" for disabled IEEE FP instructions
target/hexagon: add v68 HVX IEEE float arithmetic insns
target/hexagon: add v68 HVX IEEE float min/max insns
target/hexagon: add v68 HVX IEEE float misc insns
target/hexagon: add v68 HVX IEEE float conversion insns
target/hexagon: add v68 HVX IEEE float compare insns
target/hexagon: add v73 HVX IEEE bfloat16 insns
tests/hexagon: add tests for v68 HVX IEEE float arithmetics
tests/hexagon: add tests for v68 HVX IEEE float min/max
tests/hexagon: add tests for v68 HVX IEEE float conversions
tests/hexagon: add tests for v68 HVX IEEE float comparisons
tests/hexagon: add tests for HVX bfloat
target/hexagon/cpu.h | 10 +-
target/hexagon/cpu_bits.h | 10 +-
target/hexagon/mmvec/hvx_ieee_fp.h | 128 ++++++
target/hexagon/mmvec/macros.h | 8 +
target/hexagon/mmvec/mmvec.h | 3 +
target/hexagon/printinsn.h | 2 +-
target/hexagon/translate.h | 1 +
tests/tcg/hexagon/hex_test.h | 32 ++
tests/tcg/hexagon/hvx_misc.h | 73 ++++
target/hexagon/attribs_def.h.inc | 9 +
disas/hexagon.c | 3 +-
target/hexagon/arch.c | 8 +
target/hexagon/cpu.c | 18 +-
target/hexagon/decode.c | 4 +-
target/hexagon/mmvec/hvx_ieee_fp.c | 275 +++++++++++++
target/hexagon/printinsn.c | 7 +-
target/hexagon/translate.c | 5 +-
tests/tcg/hexagon/fp_hvx.c | 226 +++++++++++
tests/tcg/hexagon/fp_hvx_cmp.c | 279 ++++++++++++++
tests/tcg/hexagon/fp_hvx_cvt.c | 219 +++++++++++
tests/tcg/hexagon/fp_hvx_disabled.c | 57 +++
target/hexagon/gen_tcg_funcs.py | 11 +
target/hexagon/hex_common.py | 37 ++
target/hexagon/imported/mmvec/encode_ext.def | 126 ++++--
target/hexagon/imported/mmvec/ext.idef | 363 +++++++++++++++++-
target/hexagon/meson.build | 1 +
.../dockerfiles/debian-hexagon-cross.docker | 10 +-
tests/tcg/hexagon/Makefile.target | 14 +
28 files changed, 1891 insertions(+), 48 deletions(-)
create mode 100644 target/hexagon/mmvec/hvx_ieee_fp.h
create mode 100644 target/hexagon/mmvec/hvx_ieee_fp.c
create mode 100644 tests/tcg/hexagon/fp_hvx.c
create mode 100644 tests/tcg/hexagon/fp_hvx_cmp.c
create mode 100644 tests/tcg/hexagon/fp_hvx_cvt.c
create mode 100644 tests/tcg/hexagon/fp_hvx_disabled.c
--
2.37.2