target/i386: use host SSE2 for pack and unpack
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
@@ -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
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.candtest-mmx.calready 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