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.
PTX ISA Version Introduced PTX ISA 1.0
Minimum Target sm_10

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

At a Glance

Data Types -

Related AMDGPU Concepts

Sum of Absolute Differences ↗
equivalent with restrictions
v_sad_u32 (AMDGPU)

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 sum

Reproduced from NVIDIA's official PTX ISA documentation for technical accuracy.

Sources