PTX ISA v9.4

9.7.1.19. Integer Arithmetic Instructions: brev

brev

Bit reverse.

Syntax

ptx
brev.type  d, a;

.type = { .b32, .b64 };

Description

Perform bitwise reversal of input.

Semantics

ptx
msb = (.type==.b32) ? 31 : 63;

for (i=0; i<=msb; i++) {
    d[i] = a[msb-i];
}

PTX ISA Notes

Introduced in PTX ISA version 2.0.

Target ISA Notes

brev requires sm_20 or higher.

Examples

ptx
brev.b32  d, a;
esc
Type to search across all documentation