Skip to contentSkip to conversation

target/i386: use host SSE2 for pack and unpack

PATCH In review Gareth Lloyd 2 participants 2 messages Oct 28 – Oct 29

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386: use host SSE2 for pack and unpack

These helpers move bytes rather than interpret them, so a host SSE2 instruction gives bit-exact results and needs no gate on the float environment. A host without the routines keeps the portable loops.

tests/tcg/i386/test-avx.c and test-mmx.c already cover these instructions.

---
 MAINTAINERS                          |  1 +
 host/include/generic/host/vec-pack.h | 49 +++++++++++++++++
 host/include/x86_64/host/vec-pack.h  | 78 ++++++++++++++++++++++++++++
 target/i386/ops_sse.h                | 47 +++++++++++++++++
 4 files changed, 175 insertions(+)
 create mode 100644 host/include/generic/host/vec-pack.h
 create mode 100644 host/include/x86_64/host/vec-pack.h
MAINTAINERS +1 -0
index 8884e4177e..2cf806754a 100644
@@ -460,6 +460,7 @@ M: Paolo Bonzini <[email protected]>
 M: Richard Henderson <[email protected]>
 S: Maintained
 F: target/i386/tcg/
+F: host/include/*/host/vec-pack.h
 F: tests/tcg/i386/
 F: tests/tcg/x86_64/
 F: hw/i386/
host/include/generic/host/vec-pack.h new file +49 -0

49 lines not on this page · raw message

host/include/x86_64/host/vec-pack.h new file +78 -0

78 lines not on this page · raw message

target/i386/ops_sse.h +47 -0

89 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Gareth Lloyd

These helpers move bytes rather than interpret them, so a host SSE2 instruction gives bit-exact results and needs no gate on the float environment. A host without the routines keeps the portable loops.

tests/tcg/i386/test-avx.c and test-mmx.c already cover these instructions.

It would be useful to see it also for another host.

Also, have you checked if compiler vectorization can produce PACK/UNPACK instructions?

Thanks,

Paolo