sad GPU Virtual ISA NVIDIA
sad Integer Arithmetic Instructions
sad.type d, a, b, c;
Adds the absolute value of a-b to c and writes the resulting value into d.
Encoding
PTX is a virtual instruction set. It has no single, stable native
binary encoding - the compiler lowers this instruction to different native machine
code depending on the selected NVIDIA target architecture (compute capability).
This page intentionally shows no bit-diagram; see the target/version requirements
below for what governs how this instruction compiles.
Syntax Forms
One mnemonic covers many type / state-space / scope / modifier combinations - each row below is an independently valid form.
| Syntax | Data Types | State Space(s) | Modifiers | Min. Target | Description |
|---|---|---|---|---|---|
| sad.type d, a, b, c; | sm_10 | Adds the absolute value of a-b to c and writes the resulting value into d. |
Operands
-
d
Destination register -
a
Source operand -
b
Source operand -
c
Source operand
Reference
NVIDIA PTX ISA
Semantics
d = c + ((a<b) ? b-a : a-b);
Examples
sad.s32 d,a,b,c;
sad.u32 d,a,b,d; // running sumReproduced from NVIDIA's official PTX ISA documentation for technical accuracy.
Sources
-
Parallel Thread Execution ISA ↗
- NVIDIA Corporation, Chapter 9 - Instruction Set
Deep-linked directly to this instruction's section.