PTX ISA v9.4

9.7.9.8. Logic and Shift Instructions: shl

shl

Shift bits left, zero-fill on right.

Syntax

ptx
shl.type d, a, b;

.type = { .b16, .b32, .b64 };

Description

Shift a left by the amount specified by unsigned 32-bit value in b.

Semantics

ptx
d = a << b;

Notes

Shift amounts greater than the register width N are clamped to N.

The sizes of the destination and first source operand must match, but not necessarily the type. The b operand must be a 32-bit value, regardless of the instruction type.

PTX ISA Notes

Introduced in PTX ISA version 1.0.

Target ISA Notes

Supported on all target architectures.

Example

ptx
shl.b32  q,a,2;
esc
Type to search across all documentation