Skip to content

hexagon: add missing HVX float instructions

Matheus Tavares Bernardino qemu-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest16 patches 4 repliesIn review
  2. v416 patches 2 repliesSuperseded
  3. v316 patches 15 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v216 patches5 repliesSuperseded
v113 patches29 repliesSuperseded

Changes in v5 from the cover letter

- patch 11: fixed copy-and-paste error (s/vmax/vmin)
- patch 16: replaced float16 value for BF_* constants for clearity

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16tests/docker: Update hexagon cross toolchain to 22.1.0tests/docker/dockerfiles/debian-hexagon-cross.docker+7 -31 reply
2/16target/hexagon: fix incorrect/too-permissive HVX encodingstarget/hexagon/imported/mmvec/encode_ext.def+24 -240 replies
3/16target/hexagon/cpu: add HVX IEEE FP extensiontarget/hexagon/attribs_def.h.inc target/hexagon/cpu.c target/hexagon/cpu.h +4 more+43 -00 replies
4/16hexagon: group cpu configurations in their own structtarget/hexagon/cpu.c target/hexagon/cpu.h target/hexagon/cpu_bits.h +1 more+20 -171 reply
5/16hexagon: print info on "-d in_asm" for disabled IEEE FP instructionsdisas/hexagon.c target/hexagon/cpu.c target/hexagon/cpu_bits.h +3 more+15 -61 reply
6/16target/hexagon: add v68 HVX IEEE float arithmetic insnstarget/hexagon/arch.c target/hexagon/attribs_def.h.inc target/hexagon/cpu.c +9 more+179 -00 replies
7/16target/hexagon: add v68 HVX IEEE float min/max insnstarget/hexagon/attribs_def.h.inc target/hexagon/hex_common.py target/hexagon/imported/mmvec/encode_ext.def +3 more+104 -10 replies
8/16target/hexagon: add v68 HVX IEEE float misc insnstarget/hexagon/imported/mmvec/encode_ext.def target/hexagon/imported/mmvec/ext.idef+19 -00 replies
9/16target/hexagon: add v68 HVX IEEE float conversion insnstarget/hexagon/imported/mmvec/encode_ext.def target/hexagon/imported/mmvec/ext.idef target/hexagon/mmvec/hvx_ieee_fp.c +1 more+137 -00 replies
10/16target/hexagon: add v68 HVX IEEE float compare insnstarget/hexagon/imported/mmvec/encode_ext.def target/hexagon/imported/mmvec/ext.idef target/hexagon/mmvec/hvx_ieee_fp.c +2 more+126 -00 replies
11/16target/hexagon: add v73 HVX IEEE bfloat16 insnstarget/hexagon/imported/mmvec/encode_ext.def target/hexagon/imported/mmvec/ext.idef target/hexagon/mmvec/hvx_ieee_fp.h +2 more+119 -00 replies
12/16tests/hexagon: add tests for v68 HVX IEEE float arithmeticstests/tcg/hexagon/Makefile.target tests/tcg/hexagon/fp_hvx.c tests/tcg/hexagon/fp_hvx_disabled.c +2 more+265 -00 replies
13/16tests/hexagon: add tests for v68 HVX IEEE float min/maxtests/tcg/hexagon/fp_hvx.c+30 -00 replies
14/16tests/hexagon: add tests for v68 HVX IEEE float conversionstests/tcg/hexagon/Makefile.target tests/tcg/hexagon/fp_hvx_cvt.c tests/tcg/hexagon/hex_test.h +1 more+207 -00 replies
15/16tests/hexagon: add tests for v68 HVX IEEE float comparisonstests/tcg/hexagon/Makefile.target tests/tcg/hexagon/fp_hvx_cmp.c tests/tcg/hexagon/hex_test.h+228 -00 replies
16/16tests/hexagon: add tests for HVX bfloattests/tcg/hexagon/fp_hvx.c tests/tcg/hexagon/fp_hvx_cmp.c tests/tcg/hexagon/fp_hvx_cvt.c +2 more+166 -00 replies

Reviews trailers per patch

15 of 16 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPierrick BouvierTaylor SimpsonPhilippe Mathieu-DaudéBrian Cain
SeriesR-b
1/16R-b
2/16R-b
3/16
4/16R-b R-b
5/16R-b R-b
6/16R-b
7/16R-b
8/16R-b
9/16R-b
10/16R-b
11/16R-b
12/16R-b
13/16R-b
14/16R-b
15/16R-b
16/16R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/16] hexagon: add missing HVX float instructions

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.

v4: https://lore.kernel.org/qemu-devel/[email protected]/
v3: https://lore.kernel.org/qemu-devel/[email protected]/
v2: https://lore.kernel.org/qemu-devel/[email protected]/
v1: https://lore.kernel.org/qemu-devel/[email protected]/

Changes in v5:
- patch 11: fixed copy-and-paste error (s/vmax/vmin)
- patch 16: replaced float16 value for BF_* constants for clearity

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            |  69 ++++
 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            | 137 +++++++
 target/hexagon/printinsn.c                    |   7 +-
 target/hexagon/translate.c                    |   5 +-
 tests/tcg/hexagon/fp_hvx.c                    | 226 +++++++++++
 tests/tcg/hexagon/fp_hvx_cmp.c                | 275 +++++++++++++
 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                  |  27 ++
 target/hexagon/imported/mmvec/encode_ext.def  | 126 ++++--
 target/hexagon/imported/mmvec/ext.idef        | 369 +++++++++++++++++-
 target/hexagon/meson.build                    |   1 +
 .../dockerfiles/debian-hexagon-cross.docker   |  10 +-
 tests/tcg/hexagon/Makefile.target             |  14 +
 28 files changed, 1686 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

Range-diff against v4:

 1:  1440dd86da =  1:  e94d57178d tests/docker: Update hexagon cross toolchain to 22.1.0
 2:  b9a5a46b82 =  2:  1fe4b8a0fc target/hexagon: fix incorrect/too-permissive HVX encodings
 3:  7889db953a =  3:  10fb5b86db target/hexagon/cpu: add HVX IEEE FP extension
 4:  ac72a36fd8 =  4:  8f9a2e2ccf hexagon: group cpu configurations in their own struct
 5:  e24b76d95a =  5:  1bdc772e4a hexagon: print info on "-d in_asm" for disabled IEEE FP instructions
 6:  8c9ded658c =  6:  8923b6c6bc target/hexagon: add v68 HVX IEEE float arithmetic insns
 7:  a89b231b2c =  7:  8e274a7a10 target/hexagon: add v68 HVX IEEE float min/max insns
 8:  27a5ca1ce3 =  8:  0bd3279ca0 target/hexagon: add v68 HVX IEEE float misc insns
 9:  7fecae322c =  9:  beca620d2e target/hexagon: add v68 HVX IEEE float conversion insns
10:  ebc920dfcf = 10:  96e27588ad target/hexagon: add v68 HVX IEEE float compare insns
11:  d408ee2b2c ! 11:  1a25337356 target/hexagon: add v73 HVX IEEE bfloat16 insns

@@ target/hexagon/imported/mmvec/ext.idef: ITERATOR_INSN_SHIFT_SLOT_FLT(16, vconv_h
+ "Vector IEEE max: bf", VdV.bf[i] = fp_max_bf(VuV.bf[i], VvV.bf[i]);
+ fBFLOAT())
+ITERATOR_INSN_IEEE_FP_16_32_LATE(16, vmin_bf, "Vd32.bf=vmin(Vu32.bf,Vv32.bf)",
-+ "Vector IEEE max: bf", VdV.bf[i] = fp_min_bf(VuV.bf[i], VvV.bf[i]);
++ "Vector IEEE min: bf", VdV.bf[i] = fp_min_bf(VuV.bf[i], VvV.bf[i]);
+ fBFLOAT())

/******************************************************************************

12:  cde613d444 = 12:  791f122bfd tests/hexagon: add tests for v68 HVX IEEE float arithmetics
13:  08abae5ee5 = 13:  7fdbc12ed4 tests/hexagon: add tests for v68 HVX IEEE float min/max
14:  c20a21aad6 = 14:  ec6af07a28 tests/hexagon: add tests for v68 HVX IEEE float conversions
15:  6b473acaf5 = 15:  53e7370709 tests/hexagon: add tests for v68 HVX IEEE float comparisons
16:  10ebb63b81 ! 16:  392114c4c1 tests/hexagon: add tests for HVX bfloat
    @@ tests/tcg/hexagon/fp_hvx_cmp.c: static void test_cmp_hf(void)
     +
     +    /* Common numbers */
     +    PREP_TEST();
    -+    TEST_CMP_GT(bf, raw_hf((_Float16)2.2),  raw_hf((_Float16)2.1));
    -+    TEST_CMP_GT(bf, raw_hf((_Float16)0),    raw_hf((_Float16)-2.2));
    ++    TEST_CMP_GT(bf, BF_two, BF_one);
    ++    TEST_CMP_GT(bf, BF_one, BF_zero);
     +    CHECK(bf, 2);
     +
     +    /* Infinity vs Infinity/NaN */
Signature · 1 line
2.37.2