Integer Subtraction Arithmetic
Subtract one integer operand from another of matching or implied width.
Vendor-Neutral Definition
d = a - b, evaluated at the operand's integer width.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both compute d = a - b; AMDGPU again splits scalar (whole-wavefront) and per-lane vector forms where PTX has one generic sub.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | sub | v_sub_u32, s_sub_u32 |
| ISA Layer | Virtual | Native |
| Data Types | f32, f64, s16, s32, s64, u16, u32, u64 | u32 |
| Version / Target Introduced | PTX ISA 1.0 | gfx942/gfx1100 |
Important Differences
- AMDGPU exposes separate scalar (s_sub_u32) and vector (v_sub_u32) instructions, each fixed to a specific bit-width; PTX's sub is one family covering s16/s32/s64/u16/u32/u64/f32/f64 via a type modifier.
- Borrow-out is read from SCC (scalar) or VCC (vector) on AMDGPU rather than a PTX '.cc' carry-out modifier.
Source Evidence
- Parallel Thread Execution ISA ↗ - NVIDIA Corporation
- User Guide for AMDGPU Backend ↗ - LLVM Project
Verification method: documentation