PACKSSDW
/ VPACKSSDWPack to signed 16-bit elements with saturation
Clamp signed 32-bit inputs to the signed 16-bit range and pack the results.
Similar operations on Arm64:SQXTNvqmovn_s16
| Form | Bits | Requires | Encoding |
|---|---|---|---|
PACKSSDW xmm1, xmm2 | 128 | SSE2 | 66 0F 6B /r |
VPACKSSDW xmm1, xmm2, xmm3 | 128 | AVX | VEX.L0.66.0F.WIG 6B /r |
VPACKSSDW ymm1, ymm2, ymm3 | 256 | AVX2 | VEX.L1.66.0F.WIG 6B /r |
Operation#
Pseudo-C · selected form
for each 128-bit lane:
dst = concatenate(clamp_each(a, -32768, 32767),
clamp_each(b, -32768, 32767))What to watch for
- Both inputs are signed. Saturation does not set an integer or SIMD saturation flag.
- The AVX2 form packs separately within each 128-bit lane; it does not concatenate two whole 256-bit inputs in order.
Corresponding intrinsics#
__m128i _mm_packs_epi32(__m128i a, __m128i b)Documented mapping
PACKSSDW xmm, xmm
Architectural details#
- Flags
- RFLAGS unchanged.
- Destination
- Writes the low 128 bits; upper vector-register bits are preserved.
- Encoding
66 0F 6B /r- Operands
xmm1read / write · 128 bits (4 × 32) · signedxmm2read · 128 bits (4 × 32) · signed
- Coverage
- Selected register-only 128/256-bit legacy and VEX forms. Memory, MMX, EVEX/AVX-512 and scalar floating-point forms are outside this selection.
Exception information & execution requirements
#NM#UD
Feature availability, operating-system vector-state enablement and applicable floating-point exception controls still apply.
Feature availability alone does not guarantee execution: OS state and execution-level controls also apply. Use the linked architecture documentation for the full exception conditions.
Sources & provenance#
Technical fields are imported from pinned upstream files. Explanations and explorer behavior are maintained separately.
Intel · PACKSSWB-PACKSSDW-Pack-With-Signed-Saturation.xml
- Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7- SHA-256
b5582478a461c4fb5f79cd2d96494d21471aabb29fa24dca95dbe57a4c616149- Terms
- Intel SDM terms; see License.md
Intel · intrinsics.xml
- Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7- SHA-256
6762a50652a35ef663fd532ed83b789d19bbc2ac7e94b1771f19d666d96c2c30- Terms
- Intel SDM terms; see License.md