PSRLW
/ VPSRLWShift 16-bit elements right
Shift each 16-bit element right, filling the vacated high bits with zeros.
Similar operations on Arm64:USHRvshrq_n_u16
| Form | Bits | Requires | Encoding |
|---|---|---|---|
PSRLW xmm, imm8 | 128 | SSE2 | 66 0F 71 /2 ib |
VPSRLW xmm1, xmm2, imm8 | 128 | AVX | VEX.L0.66.0F.WIG 71 /2 ib |
VPSRLW ymm1, ymm2, imm8 | 256 | AVX2 | VEX.L1.66.0F.WIG 71 /2 ib |
Explore the operation
The interactive explorer is loading. The operation and reference details are available below.
Operation#
dst[i] = count >= 16 ? 0 : a[i] >>> countExact upstream semantics
Standard variant
let elements := register_size / element_size;
var result := Zero(register_size);
for i := 0 to elements-1 do
let op1 := src1[i *: element_size];
let count := if shift_size > 64 then Unsigned(shift_distance[0 +: 64]) else Unsigned(shift_distance);
let r := Shift_Right_Logical(op1, count);
result[i *: element_size] := r;
endfor;What to watch for
- This sample covers immediate-count forms.
- The shift is logical, so it does not extend the sign bit.
Corresponding intrinsics#
Architectural details#
- Flags
- Arithmetic flags unchanged.
- Destination
- Writes the low 128 bits; upper vector-register bits are preserved.
- Encoding
66 0F 71 /2 ib- Operands
xmmread / writeimm8read
- Coverage
- Selected register-only 128/256-bit forms. Memory operands, MMX, and EVEX/AVX-512 forms are outside this sample.
- Immediate
- 0 to 255.
Exception information & execution requirements
#NM#UD
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 · PSRLW-PSRLD-PSRLQ-Shift-Packed-Data-Right-Logical.xml
- Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7- SHA-256
0b7faf1ba3d9b6635cd70cc51716f315aeb678dcebddfe66dd868a6443885c77- Terms
- Intel SDM terms; see License.md
Intel · intrinsics.xml
- Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7- SHA-256
6762a50652a35ef663fd532ed83b789d19bbc2ac7e94b1771f19d666d96c2c30- Terms
- Intel SDM terms; see License.md