Skip to content

Lower TCG vector ops to LSX

Jiajie Chen qemu-arm qemu-devel qemu-riscv 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest16 patches 3 repliesIn review
  2. v316 patches 7 repliesSuperseded
  3. v214 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v111 patches13 repliesSuperseded

Changes in v4 from the cover letter

- Refactor add/sub_vec handling code to use a helper function
- Only use vldx/vstx for MO_128 load/store, otherwise fallback to two ld/st

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16tcg/loongarch64: Import LSX instructionstcg/loongarch64/tcg-insn-defs.c.inc+6134 -1170 replies
2/16tcg/loongarch64: Lower basic tcg vec ops to LSXtcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target-con-str.h tcg/loongarch64/tcg-target.c.inc +2 more+270 -20 replies
3/16tcg: pass vece to tcg_target_const_match()tcg/aarch64/tcg-target.c.inc tcg/arm/tcg-target.c.inc tcg/i386/tcg-target.c.inc +8 more+12 -121 reply
4/16tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslttcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target-con-str.h tcg/loongarch64/tcg-target.c.inc+67 -00 replies
5/16tcg/loongarch64: Lower add/sub_vec to vadd/vsubtcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target-con-str.h tcg/loongarch64/tcg-target.c.inc+63 -01 reply
6/16tcg/loongarch64: Lower vector bitwise operationstcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+50 -40 replies
7/16tcg/loongarch64: Lower neg_vec to vnegtcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+9 -10 replies
8/16tcg/loongarch64: Lower mul_vec to vmultcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+9 -10 replies
9/16tcg/loongarch64: Lower vector min max opstcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+33 -10 replies
10/16tcg/loongarch64: Lower vector saturated opstcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+33 -10 replies
11/16tcg/loongarch64: Lower vector shift vector opstcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+25 -10 replies
12/16tcg/loongarch64: Lower bitsel_vec to vbitseltcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+12 -20 replies
13/16tcg/loongarch64: Lower vector shift integer opstcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+22 -10 replies
14/16tcg/loongarch64: Lower rotv_vec ops to LSXtcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+15 -10 replies
15/16tcg/loongarch64: Lower rotli_vec to vrotritcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+22 -10 replies
16/16tcg/loongarch64: Implement 128-bit load & storetcg/loongarch64/tcg-target-con-set.h tcg/loongarch64/tcg-target.c.inc tcg/loongarch64/tcg-target.h+62 -11 reply

Reviews trailers per patch

All 16 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonPhilippe Mathieu-Daudé
1/16A-b
2/16R-b
3/16R-b R-b
4/16R-b
5/16R-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.

Read the v4 thread

Cover letter [PATCH v4 00/16] Lower TCG vector ops to LSX

This patch series allows qemu to utilize LSX instructions on LoongArch machines to execute TCG vector ops.

Passed tcg tests with x86_64 and aarch64 cross compilers.

Changes since v3:

- Refactor add/sub_vec handling code to use a helper function
- Only use vldx/vstx for MO_128 load/store, otherwise fallback to two ld/st

Changes since v2:

- Add vece argument to tcg_target_const_match() for const args of vector ops
- Use custom constraint for cmp_vec/add_vec/sub_vec for better const arg handling
- Implement 128-bit load & store using vldx/vstx

Changes since v1:

- Optimize dupi_vec/st_vec/ld_vec/cmp_vec/add_vec/sub_vec generation
- Lower not_vec/shi_vec/roti_vec/rotv_vec

Jiajie Chen (16):
tcg/loongarch64: Import LSX instructions tcg/loongarch64: Lower basic tcg vec ops to LSX
tcg: pass vece to tcg_target_const_match() tcg/loongarch64: Lower cmp_vec to vseq/vsle/vslt tcg/loongarch64: Lower add/sub_vec to vadd/vsub tcg/loongarch64: Lower vector bitwise operations tcg/loongarch64: Lower neg_vec to vneg tcg/loongarch64: Lower mul_vec to vmul tcg/loongarch64: Lower vector min max ops tcg/loongarch64: Lower vector saturated ops tcg/loongarch64: Lower vector shift vector ops tcg/loongarch64: Lower bitsel_vec to vbitsel tcg/loongarch64: Lower vector shift integer ops tcg/loongarch64: Lower rotv_vec ops to LSX tcg/loongarch64: Lower rotli_vec to vrotri tcg/loongarch64: Implement 128-bit load & store

 tcg/aarch64/tcg-target.c.inc         |    2 +-
 tcg/arm/tcg-target.c.inc             |    2 +-
 tcg/i386/tcg-target.c.inc            |    2 +-
 tcg/loongarch64/tcg-insn-defs.c.inc  | 6251 +++++++++++++++++++++++++-
 tcg/loongarch64/tcg-target-con-set.h |    9 +
 tcg/loongarch64/tcg-target-con-str.h |    3 +
 tcg/loongarch64/tcg-target.c.inc     |  619 ++-
 tcg/loongarch64/tcg-target.h         |   40 +-
 tcg/loongarch64/tcg-target.opc.h     |   12 +
 tcg/mips/tcg-target.c.inc            |    2 +-
 tcg/ppc/tcg-target.c.inc             |    2 +-
 tcg/riscv/tcg-target.c.inc           |    2 +-
 tcg/s390x/tcg-target.c.inc           |    2 +-
 tcg/sparc64/tcg-target.c.inc         |    2 +-
 tcg/tcg.c                            |    4 +-
 tcg/tci/tcg-target.c.inc             |    2 +-
 16 files changed, 6824 insertions(+), 132 deletions(-)
 create mode 100644 tcg/loongarch64/tcg-target.opc.h
Signature · 1 line
2.42.0