[PATCH v4 0/6] hexagon: fix HVX scatter gather, BE host

Brian Cain posted 6 patches 2 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260905195955.2001304-1-brian.cain@oss.qualcomm.com
Maintainers: Brian Cain <brian.cain@oss.qualcomm.com>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
target/hexagon/gen_tcg_hvx.h            |  10 +-
target/hexagon/mmvec/macros.h           | 116 +++++++++++---------
target/hexagon/mmvec/mmvec.h            |  18 ++++
target/hexagon/cpu.c                    |  17 +--
target/hexagon/genptr.c                 |   3 +-
target/hexagon/mmvec/system_ext_mmvec.c |   2 +-
target/hexagon/op_helper.c              |  17 ++-
tests/tcg/hexagon/hvx_misc.c            |  45 ++++++++
tests/tcg/hexagon/scatter_gather.c      | 137 +++++++++++++++++++++++-
9 files changed, 297 insertions(+), 68 deletions(-)
[PATCH v4 0/6] hexagon: fix HVX scatter gather, BE host
Posted by Brian Cain 2 weeks, 6 days ago
Anton pointed out this endianness issue with HVX,
and found this region length issue along the way.

v4:
* Added a 'rename LEN to OFFS_REG_END in VTCM macros' patch

v3:
* Changed the region-length test to be more consistent between scatter
and gather and focusing on just inside, outside, beyond the boundary.

Fixed in v2:
* byte access helpers now all use hexagon_ prefix.
* Predicate bytes are extracted from 32-bit words rather than 64-bit words,
  matching the host-native predicate layout.
* Gather only reads memory for lanes that are both in range and predicate
  enabled.  So dropped lanes cannot fault or otherwise access memory.
* The gather region-length test now places an out-of-range offset on an
  inaccessible page, verifying that a dropped lane performs no read.

Added v2 commits:
* fix for histogram predicates - were using the wrong size
* test to cover predicate byte permutation

Brian Cain (6):
  target/hexagon: fix HVX big-endian byte access
  target/hexagon: fix HVX scatter/gather region-length check
  tests/tcg/hexagon: add vgather/vscatter region-length tests
  target/hexagon: fix HVX predicate save size for histogram ops
  tests/tcg/hexagon: check the two HVX predicate build paths agree
  target/hexagon: rename LEN to OFFS_REG_END in VTCM macros

 target/hexagon/gen_tcg_hvx.h            |  10 +-
 target/hexagon/mmvec/macros.h           | 116 +++++++++++---------
 target/hexagon/mmvec/mmvec.h            |  18 ++++
 target/hexagon/cpu.c                    |  17 +--
 target/hexagon/genptr.c                 |   3 +-
 target/hexagon/mmvec/system_ext_mmvec.c |   2 +-
 target/hexagon/op_helper.c              |  17 ++-
 tests/tcg/hexagon/hvx_misc.c            |  45 ++++++++
 tests/tcg/hexagon/scatter_gather.c      | 137 +++++++++++++++++++++++-
 9 files changed, 297 insertions(+), 68 deletions(-)

-- 
2.34.1