14. SIMD Intrinsics
This section describes SIMD intrinsic functions that are only supported in device code.
To use these functions, you do not need to include any additional header file in your program.
Functions
- __device__ unsigned int __vabs2(unsigned int a)
-
Computes per-halfword absolute value: |a|.
- __device__ unsigned int __vabs4(unsigned int a)
-
Computes per-byte absolute value: |a|.
- __device__ unsigned int __vabsdiffs2(unsigned int a, unsigned int b)
-
Computes per-halfword absolute difference of signed integer: |a - b|.
- __device__ unsigned int __vabsdiffs4(unsigned int a, unsigned int b)
-
Computes per-byte absolute difference of signed integer: |a - b|.
- __device__ unsigned int __vabsdiffu2(unsigned int a, unsigned int b)
-
Computes per-halfword absolute difference of unsigned integer: |a - b|.
- __device__ unsigned int __vabsdiffu4(unsigned int a, unsigned int b)
-
Computes per-byte absolute difference of unsigned integer: |a - b|.
- __device__ unsigned int __vabsss2(unsigned int a)
-
Computes per-halfword absolute value with signed saturation: |a|.
- __device__ unsigned int __vabsss4(unsigned int a)
-
Computes per-byte absolute value with signed saturation: |a|.
- __device__ unsigned int __vadd2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned addition with wrap-around: a + b.
- __device__ unsigned int __vadd4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned addition with wrap-around: a + b.
- __device__ unsigned int __vaddss2(unsigned int a, unsigned int b)
-
Performs per-halfword addition with signed saturation: a + b.
- __device__ unsigned int __vaddss4(unsigned int a, unsigned int b)
-
Performs per-byte addition with signed saturation: a + b.
- __device__ unsigned int __vaddus2(unsigned int a, unsigned int b)
-
Performs per-halfword addition with unsigned saturation: a + b.
- __device__ unsigned int __vaddus4(unsigned int a, unsigned int b)
-
Performs per-byte addition with unsigned saturation: a + b.
- __device__ unsigned int __vavgs2(unsigned int a, unsigned int b)
-
Computes per-halfword signed average, rounded away from zero.
- __device__ unsigned int __vavgs4(unsigned int a, unsigned int b)
-
Computes per-byte signed average, rounded away from zero.
- __device__ unsigned int __vavgu2(unsigned int a, unsigned int b)
-
Computes per-halfword unsigned average, rounded up.
- __device__ unsigned int __vavgu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned average, rounded up.
- __device__ unsigned int __vcmpeq2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a == b ? 0xffff : 0.
- __device__ unsigned int __vcmpeq4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a == b ? 0xff : 0.
- __device__ unsigned int __vcmpges2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a >= b ? 0xffff : 0.
- __device__ unsigned int __vcmpges4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a >= b ? 0xff : 0.
- __device__ unsigned int __vcmpgeu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a >= b ? 0xffff : 0.
- __device__ unsigned int __vcmpgeu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a >= b ? 0xff : 0.
- __device__ unsigned int __vcmpgts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a > b ? 0xffff : 0.
- __device__ unsigned int __vcmpgts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a > b ? 0xff : 0.
- __device__ unsigned int __vcmpgtu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a > b ? 0xffff : 0.
- __device__ unsigned int __vcmpgtu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a > b ? 0xff : 0.
- __device__ unsigned int __vcmples2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a <= b ? 0xffff : 0.
- __device__ unsigned int __vcmples4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a <= b ? 0xff : 0.
- __device__ unsigned int __vcmpleu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a <= b ? 0xffff : 0.
- __device__ unsigned int __vcmpleu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a <= b ? 0xff : 0.
- __device__ unsigned int __vcmplts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a < b ? 0xffff : 0.
- __device__ unsigned int __vcmplts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a < b ? 0xff : 0.
- __device__ unsigned int __vcmpltu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a < b ? 0xffff : 0.
- __device__ unsigned int __vcmpltu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a < b ? 0xff : 0.
- __device__ unsigned int __vcmpne2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a != b ? 0xffff : 0.
- __device__ unsigned int __vcmpne4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a != b ? 0xff : 0.
- __device__ unsigned int __vhaddu2(unsigned int a, unsigned int b)
-
Computes per-halfword unsigned average, rounded toward zero.
- __device__ unsigned int __vhaddu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned average, rounded toward zero.
- __host__ __device__ unsigned int __viaddmax_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword signed max(a + b, c)
- __host__ __device__ unsigned int __viaddmax_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a + b, c), 0)
- __host__ __device__ int __viaddmax_s32(const int a, const int b, const int c)
-
Computes max(a + b, c)
- __host__ __device__ int __viaddmax_s32_relu(const int a, const int b, const int c)
-
Computes max(max(a + b, c), 0)
- __host__ __device__ unsigned int __viaddmax_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(a + b, c)
- __host__ __device__ unsigned int __viaddmax_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes max(a + b, c)
- __host__ __device__ unsigned int __viaddmin_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(a + b, c)
- __host__ __device__ unsigned int __viaddmin_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(min(a + b, c), 0)
- __host__ __device__ int __viaddmin_s32(const int a, const int b, const int c)
-
Computes min(a + b, c)
- __host__ __device__ int __viaddmin_s32_relu(const int a, const int b, const int c)
-
Computes max(min(a + b, c), 0)
- __host__ __device__ unsigned int __viaddmin_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(a + b, c)
- __host__ __device__ unsigned int __viaddmin_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes min(a + b, c)
- __host__ __device__ unsigned int __vibmax_s16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword max(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b).
- __host__ __device__ int __vibmax_s32(const int a, const int b, bool *const pred)
-
Computes max(a, b) and also sets the value pointed to by pred to (a >= b).
- __host__ __device__ unsigned int __vibmax_u16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword max(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b).
- __host__ __device__ unsigned int __vibmax_u32(const unsigned int a, const unsigned int b, bool *const pred)
-
Computes max(a, b) and also sets the value pointed to by pred to (a >= b).
- __host__ __device__ unsigned int __vibmin_s16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword min(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b).
- __host__ __device__ int __vibmin_s32(const int a, const int b, bool *const pred)
-
Computes min(a, b) and also sets the value pointed to by pred to (a <= b).
- __host__ __device__ unsigned int __vibmin_u16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword min(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b).
- __host__ __device__ unsigned int __vibmin_u32(const unsigned int a, const unsigned int b, bool *const pred)
-
Computes min(a, b) and also sets the value pointed to by pred to (a <= b).
- __host__ __device__ unsigned int __vimax3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a, b), c)
- __host__ __device__ unsigned int __vimax3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(max(a, b), c), 0)
- __host__ __device__ int __vimax3_s32(const int a, const int b, const int c)
-
Computes max(max(a, b), c)
- __host__ __device__ int __vimax3_s32_relu(const int a, const int b, const int c)
-
Computes max(max(max(a, b), c), 0)
- __host__ __device__ unsigned int __vimax3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a, b), c)
- __host__ __device__ unsigned int __vimax3_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes max(max(a, b), c)
- __host__ __device__ unsigned int __vimax_s16x2_relu(const unsigned int a, const unsigned int b)
-
Performs per-halfword max(max(a, b), 0)
- __host__ __device__ int __vimax_s32_relu(const int a, const int b)
-
Computes max(max(a, b), 0)
- __host__ __device__ unsigned int __vimin3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(min(a, b), c)
- __host__ __device__ unsigned int __vimin3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(min(min(a, b), c), 0)
- __host__ __device__ int __vimin3_s32(const int a, const int b, const int c)
-
Computes min(min(a, b), c)
- __host__ __device__ int __vimin3_s32_relu(const int a, const int b, const int c)
-
Computes max(min(min(a, b), c), 0)
- __host__ __device__ unsigned int __vimin3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(min(a, b), c)
- __host__ __device__ unsigned int __vimin3_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes min(min(a, b), c)
- __host__ __device__ unsigned int __vimin_s16x2_relu(const unsigned int a, const unsigned int b)
-
Performs per-halfword max(min(a, b), 0)
- __host__ __device__ int __vimin_s32_relu(const int a, const int b)
-
Computes max(min(a, b), 0)
- __device__ unsigned int __vmaxs2(unsigned int a, unsigned int b)
-
Performs per-halfword signed maximum computation.
- __device__ unsigned int __vmaxs4(unsigned int a, unsigned int b)
-
Computes per-byte signed maximum.
- __device__ unsigned int __vmaxu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned maximum computation.
- __device__ unsigned int __vmaxu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned maximum.
- __device__ unsigned int __vmins2(unsigned int a, unsigned int b)
-
Performs per-halfword signed minimum computation.
- __device__ unsigned int __vmins4(unsigned int a, unsigned int b)
-
Computes per-byte signed minimum.
- __device__ unsigned int __vminu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned minimum computation.
- __device__ unsigned int __vminu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned minimum.
- __device__ unsigned int __vneg2(unsigned int a)
-
Computes per-halfword negation with wrap-around.
- __device__ unsigned int __vneg4(unsigned int a)
-
Performs per-byte negation with wrap-around.
- __device__ unsigned int __vnegss2(unsigned int a)
-
Computes per-halfword negation with signed saturation.
- __device__ unsigned int __vnegss4(unsigned int a)
-
Performs per-byte negation with signed saturation.
- __device__ unsigned int __vsads2(unsigned int a, unsigned int b)
-
Computes the sum of per-halfword absolute differences of signed values.
- __device__ unsigned int __vsads4(unsigned int a, unsigned int b)
-
Computes the sum of per-byte absolute differences of signed values.
- __device__ unsigned int __vsadu2(unsigned int a, unsigned int b)
-
Computes the sum of per-halfword absolute differences of unsigned values.
- __device__ unsigned int __vsadu4(unsigned int a, unsigned int b)
-
Computes the sum of per-byte absolute differences of unsigned values.
- __device__ unsigned int __vseteq2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a == b ? 0x0001 : 0x0000.
- __device__ unsigned int __vseteq4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a == b ? 0x01 : 0x00.
- __device__ unsigned int __vsetges2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a >= b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetges4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a >= b ? 0x01 : 0x00.
- __device__ unsigned int __vsetgeu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a >= b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetgeu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a >= b ? 0x01 : 0x00.
- __device__ unsigned int __vsetgts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a > b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetgts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a > b ? 0x01 : 0x00.
- __device__ unsigned int __vsetgtu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a > b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetgtu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a > b ? 0x01 : 0x00.
- __device__ unsigned int __vsetles2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a <= b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetles4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a <= b ? 0x01 : 0x00.
- __device__ unsigned int __vsetleu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a <= b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetleu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a <= b ? 0x01 : 0x00.
- __device__ unsigned int __vsetlts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a < b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetlts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a < b ? 0x01 : 0x00.
- __device__ unsigned int __vsetltu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a < b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetltu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a < b ? 0x01 : 0x00.
- __device__ unsigned int __vsetne2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a != b ? 0x0001 : 0x0000.
- __device__ unsigned int __vsetne4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a != b ? 0x01 : 0x00.
- __device__ unsigned int __vsub2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with wrap-around: a - b.
- __device__ unsigned int __vsub4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with wrap-around: a - b.
- __device__ unsigned int __vsubss2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with signed saturation: a - b.
- __device__ unsigned int __vsubss4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with signed saturation: a - b.
- __device__ unsigned int __vsubus2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with unsigned saturation: a - b.
- __device__ unsigned int __vsubus4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with unsigned saturation: a - b.
14.1. Functions
-
__device__ unsigned int __vabs2(unsigned int a)
-
Computes per-halfword absolute value: |a|.
Splits the 4-byte argument into 2 parts, each interpreted as a signed 16-bit integer, then computes each part’s absolute value and represents it as an unsigned 16-bit magnitude in the range 0 to 32768.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vabs2(0x80008000U) returns 0x80008000U.
-
__device__ unsigned int __vabs4(unsigned int a)
-
Computes per-byte absolute value: |a|.
Splits the 4-byte argument into 4 parts, each interpreted as a signed 8-bit integer, then computes each part’s absolute value and represents it as an unsigned 8-bit magnitude in the range 0 to 128.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vabs4(0x80808080U) returns 0x80808080U.
-
__device__ unsigned int __vabsdiffs2(unsigned int a, unsigned int b)
-
Computes per-halfword absolute difference of signed integer: |a - b|.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes absolute difference.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vabsdiffs4(unsigned int a, unsigned int b)
-
Computes per-byte absolute difference of signed integer: |a - b|.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes absolute difference.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vabsdiffu2(unsigned int a, unsigned int b)
-
Computes per-halfword absolute difference of unsigned integer: |a - b|.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes absolute difference.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vabsdiffu4(unsigned int a, unsigned int b)
-
Computes per-byte absolute difference of unsigned integer: |a - b|.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes absolute difference.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vabsss2(unsigned int a)
-
Computes per-halfword absolute value with signed saturation: |a|.
Splits 4 bytes of argument into 2 parts, each consisting of 2 bytes, then computes absolute value with signed saturation for each part.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vabsss2(0x80008000U) returns 0x7fff7fffU.
-
__device__ unsigned int __vabsss4(unsigned int a)
-
Computes per-byte absolute value with signed saturation: |a|.
Splits 4 bytes of argument into 4 parts, each consisting of 1 byte, then computes absolute value with signed saturation for each part.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vabsss4(0x80808080U) returns 0x7f7f7f7fU.
-
__device__ unsigned int __vadd2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned addition with wrap-around: a + b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, then performs unsigned addition with wrap-around on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vadd4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned addition with wrap-around: a + b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte, then performs addition with wrap-around on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vaddss2(unsigned int a, unsigned int b)
-
Performs per-halfword addition with signed saturation: a + b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, then performs addition with signed saturation on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vaddss4(unsigned int a, unsigned int b)
-
Performs per-byte addition with signed saturation: a + b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte, then performs addition with signed saturation on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vaddus2(unsigned int a, unsigned int b)
-
Performs per-halfword addition with unsigned saturation: a + b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, then performs addition with unsigned saturation on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vaddus4(unsigned int a, unsigned int b)
-
Performs per-byte addition with unsigned saturation: a + b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte, then performs addition with unsigned saturation on corresponding parts.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vavgs2(unsigned int a, unsigned int b)
-
Computes per-halfword signed average, rounded away from zero.
Splits each 4-byte argument into 2 parts, each interpreted as a signed 16-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded away from zero.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vavgs4(unsigned int a, unsigned int b)
-
Computes per-byte signed average, rounded away from zero.
Splits each 4-byte argument into 4 parts, each interpreted as a signed 8-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded away from zero.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vavgu2(unsigned int a, unsigned int b)
-
Computes per-halfword unsigned average, rounded up.
Splits each 4-byte argument into 2 parts, each interpreted as an unsigned 16-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded upward.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vavgu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned average, rounded up.
Splits each 4-byte argument into 4 parts, each interpreted as an unsigned 8-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded upward.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vcmpeq2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a == b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if they are equal and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpeq2(0x12345678U, 0x1234abcdU) returns 0xffff0000.
-
__device__ unsigned int __vcmpeq4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a == b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if they are equal and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpeq4(0x807f3302U, 0x7f803301U) returns 0x0000ff00.
-
__device__ unsigned int __vcmpges2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a >= b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part >= ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpges2(0x80007fffU, 0x7fff8000U) returns 0x0000ffff.
-
__device__ unsigned int __vcmpges4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a >= b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part >= ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpges4(0x807f3302U, 0x7f803301U) returns 0x00ffffff.
-
__device__ unsigned int __vcmpgeu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a >= b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part >= ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgeu2(0x80007fffU, 0x7fff8000U) returns 0xffff0000.
-
__device__ unsigned int __vcmpgeu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a >= b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part >= ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgeu4(0x807f3302U, 0x7f803301U) returns 0xff00ffff.
-
__device__ unsigned int __vcmpgts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a > b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part > ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgts2(0x80007fffU, 0x7fff8000U) returns 0x0000ffff.
-
__device__ unsigned int __vcmpgts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a > b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part > ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgts4(0x807f3302U, 0x7f803301U) returns 0x00ff00ff.
-
__device__ unsigned int __vcmpgtu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a > b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part > ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgtu2(0x80007fffU, 0x7fff8000U) returns 0xffff0000.
-
__device__ unsigned int __vcmpgtu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a > b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part > ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpgtu4(0x807f3302U, 0x7f803301U) returns 0xff0000ff.
-
__device__ unsigned int __vcmples2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a <= b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part <= ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmples2(0x80007fffU, 0x7fff8000U) returns 0xffff0000.
-
__device__ unsigned int __vcmples4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a <= b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part <= ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmples4(0x807f3302U, 0x7f803301U) returns 0xff00ff00.
-
__device__ unsigned int __vcmpleu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a <= b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part <= ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpleu2(0x80007fffU, 0x7fff8000U) returns 0x0000ffff.
-
__device__ unsigned int __vcmpleu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a <= b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part <= ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpleu4(0x807f3302U, 0x7f803301U) returns 0x00ffff00.
-
__device__ unsigned int __vcmplts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a < b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part < ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmplts2(0x80007fffU, 0x7fff8000U) returns 0xffff0000.
-
__device__ unsigned int __vcmplts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a < b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part < ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmplts4(0x807f3302U, 0x7f803301U) returns 0xff000000.
-
__device__ unsigned int __vcmpltu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a < b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part < ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpltu2(0x80007fffU, 0x7fff8000U) returns 0x0000ffff.
-
__device__ unsigned int __vcmpltu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a < b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part < ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpltu4(0x807f3302U, 0x7f803301U) returns 0x00ff0000.
-
__device__ unsigned int __vcmpne2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a != b ? 0xffff : 0.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the result is ffff if ‘a’ part != ‘b’ part and 0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpne2(0x12345678U, 0x1234abcdU) returns 0x0000ffff.
-
__device__ unsigned int __vcmpne4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a != b ? 0xff : 0.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the result is ff if ‘a’ part != ‘b’ part and 00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vcmpne4(0x807f3302U, 0x7f803301U) returns 0xffff00ff.
-
__device__ unsigned int __vhaddu2(unsigned int a, unsigned int b)
-
Computes per-halfword unsigned average, rounded toward zero.
Splits each 4-byte argument into 2 parts, each interpreted as an unsigned 16-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded toward zero.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vhaddu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned average, rounded toward zero.
Splits each 4-byte argument into 4 parts, each interpreted as an unsigned 8-bit integer. For each part position, the function computes the average of the part from
aand the part fromb, with ties rounded toward zero.- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __viaddmax_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword signed max(a + b, c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the signed maximum of that sum and c_part: max(a_part + b_part, c_part).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __viaddmax_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a + b, c), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the signed maximum of that sum and c_part and applies ReLU: max(max(a_part + b_part, c_part), 0).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __viaddmax_s32(const int a, const int b, const int c)
-
Computes max(a + b, c)
Computes the 32-bit wrap-around sum of signed integers
aandb, then takes the signed maximum of that sum andc.- Returns
-
Returns computed value.
-
__host__ __device__ int __viaddmax_s32_relu(const int a, const int b, const int c)
-
Computes max(max(a + b, c), 0)
Computes the 32-bit wrap-around sum of signed integers
aandb, then takes the signed maximum of that sum andc. ReLU is then applied to the result.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __viaddmax_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(a + b, c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the unsigned maximum of that sum and c_part: max(a_part + b_part, c_part).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __viaddmax_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes max(a + b, c)
Computes the 32-bit wrap-around sum of unsigned integers
aandb, then takes the unsigned maximum of that sum andc.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __viaddmin_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(a + b, c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the signed minimum of that sum and c_part: min(a_part + b_part, c_part).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __viaddmin_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(min(a + b, c), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the signed minimum of that sum and c_part and applies ReLU: max(min(a_part + b_part, c_part), 0).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __viaddmin_s32(const int a, const int b, const int c)
-
Computes min(a + b, c)
Computes the 32-bit wrap-around sum of signed integers
aandb, then takes the signed minimum of that sum andc.- Returns
-
Returns computed value.
-
__host__ __device__ int __viaddmin_s32_relu(const int a, const int b, const int c)
-
Computes max(min(a + b, c), 0)
Computes the 32-bit wrap-around sum of signed integers
aandb, then takes the signed minimum of that sum andc. ReLU is then applied to the result.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __viaddmin_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(a + b, c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function computes the 16-bit wrap-around sum of a_part and b_part, then takes the unsigned minimum of that sum and c_part: min(a_part + b_part, c_part).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __viaddmin_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes min(a + b, c)
Computes the 32-bit wrap-around sum of unsigned integers
aandb, then takes the unsigned minimum of that sum andc.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vibmax_s16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword max(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b).
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function performs a maximum ( = max(a_part, b_part) ). Partial results are recombined and returned as an unsigned int. Sets the value pointed to by
pred_hito the value (a_high_part >= b_high_part). Sets the value pointed to bypred_loto the value (a_low_part >= b_low_part).- Returns
-
Returns computed values.
-
__host__ __device__ int __vibmax_s32(const int a, const int b, bool *const pred)
-
Computes max(a, b) and also sets the value pointed to by pred to (a >= b).
Calculates the maximum of
aandbof two signed ints. Also sets the value pointed to bypredto the value (a >= b).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vibmax_u16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword max(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b).
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function performs a maximum ( = max(a_part, b_part) ). Partial results are recombined and returned as an unsigned int. Sets the value pointed to by
pred_hito the value (a_high_part >= b_high_part). Sets the value pointed to bypred_loto the value (a_low_part >= b_low_part).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vibmax_u32(const unsigned int a, const unsigned int b, bool *const pred)
-
Computes max(a, b) and also sets the value pointed to by pred to (a >= b).
Calculates the maximum of
aandbof two unsigned ints. Also sets the value pointed to bypredto the value (a >= b).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vibmin_s16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword min(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b).
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function performs a minimum ( = min(a_part, b_part) ). Partial results are recombined and returned as an unsigned int. Sets the value pointed to by
pred_hito the value (a_high_part <= b_high_part). Sets the value pointed to bypred_loto the value (a_low_part <= b_low_part).- Returns
-
Returns computed values.
-
__host__ __device__ int __vibmin_s32(const int a, const int b, bool *const pred)
-
Computes min(a, b) and also sets the value pointed to by pred to (a <= b).
Calculates the minimum of
aandbof two signed ints. Also sets the value pointed to bypredto the value (a <= b).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vibmin_u16x2(const unsigned int a, const unsigned int b, bool *const pred_hi, bool *const pred_lo)
-
Performs per-halfword min(a, b) and also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b).
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function performs a minimum ( = min(a_part, b_part) ). Partial results are recombined and returned as an unsigned int. Sets the value pointed to by
pred_hito the value (a_high_part <= b_high_part). Sets the value pointed to bypred_loto the value (a_low_part <= b_low_part).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vibmin_u32(const unsigned int a, const unsigned int b, bool *const pred)
-
Computes min(a, b) and also sets the value pointed to by pred to (a <= b).
Calculates the minimum of
aandbof two unsigned ints. Also sets the value pointed to bypredto the value (a <= b).- Returns
-
Returns computed values.
-
__host__ __device__ unsigned int __vimax3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a, b), c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function performs a 3-way max ( = max(max(a_part, b_part), c_part) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __vimax3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(max(a, b), c), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the three-way signed maximum, then applies ReLU ( = max(a_part, b_part, c_part, 0) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __vimax3_s32(const int a, const int b, const int c)
-
Computes max(max(a, b), c)
Calculates the 3-way max of signed integers
a,b, andc.- Returns
-
Returns computed value.
-
__host__ __device__ int __vimax3_s32_relu(const int a, const int b, const int c)
-
Computes max(max(max(a, b), c), 0)
Computes the maximum of signed integers
a,b, andc, then applies ReLU.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vimax3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(max(a, b), c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function performs a 3-way max ( = max(max(a_part, b_part), c_part) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __vimax3_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes max(max(a, b), c)
Calculates the 3-way max of unsigned integers
a,b, andc.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vimax_s16x2_relu(const unsigned int a, const unsigned int b)
-
Performs per-halfword max(max(a, b), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the signed maximum, then applies ReLU ( = max(a_part, b_part, 0) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __vimax_s32_relu(const int a, const int b)
-
Computes max(max(a, b), 0)
Computes the maximum of signed integers
aandb, then applies ReLU.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vimin3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(min(a, b), c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function performs a 3-way min ( = min(min(a_part, b_part), c_part) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __vimin3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword max(min(min(a, b), c), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the three-way signed minimum, then applies ReLU ( = max(min(a_part, b_part, c_part), 0) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __vimin3_s32(const int a, const int b, const int c)
-
Computes min(min(a, b), c)
Calculates the 3-way min of signed integers
a,b, andc.- Returns
-
Returns computed value.
-
__host__ __device__ int __vimin3_s32_relu(const int a, const int b, const int c)
-
Computes max(min(min(a, b), c), 0)
Computes the minimum of signed integers
a,b, andc, then applies ReLU.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vimin3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c)
-
Performs per-halfword min(min(a, b), c)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as unsigned shorts. For corresponding parts, the function performs a 3-way min ( = min(min(a_part, b_part), c_part) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ unsigned int __vimin3_u32(const unsigned int a, const unsigned int b, const unsigned int c)
-
Computes min(min(a, b), c)
Calculates the 3-way min of unsigned integers
a,b, andc.- Returns
-
Returns computed value.
-
__host__ __device__ unsigned int __vimin_s16x2_relu(const unsigned int a, const unsigned int b)
-
Performs per-halfword max(min(a, b), 0)
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. These 2 byte parts are interpreted as signed shorts. For corresponding parts, the function computes the signed minimum, then applies ReLU ( = max(min(a_part, b_part), 0) ).
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__host__ __device__ int __vimin_s32_relu(const int a, const int b)
-
Computes max(min(a, b), 0)
Computes the minimum of signed integers
aandb, then applies ReLU.- Returns
-
Returns computed value.
-
__device__ unsigned int __vmaxs2(unsigned int a, unsigned int b)
-
Performs per-halfword signed maximum computation.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes signed maximum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vmaxs4(unsigned int a, unsigned int b)
-
Computes per-byte signed maximum.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes signed maximum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vmaxu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned maximum computation.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes unsigned maximum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vmaxu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned maximum.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes unsigned maximum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vmins2(unsigned int a, unsigned int b)
-
Performs per-halfword signed minimum computation.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes signed minimum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vmins4(unsigned int a, unsigned int b)
-
Computes per-byte signed minimum.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes signed minimum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vminu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned minimum computation.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function computes unsigned minimum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vminu4(unsigned int a, unsigned int b)
-
Computes per-byte unsigned minimum.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function computes unsigned minimum.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vneg2(unsigned int a)
-
Computes per-halfword negation with wrap-around.
Splits the 4-byte argument into 2 parts, each interpreted as a signed 16-bit integer, then negates each part with 16-bit wrap-around.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vneg2(0x80008000U) returns 0x80008000U.
-
__device__ unsigned int __vneg4(unsigned int a)
-
Performs per-byte negation with wrap-around.
Splits the 4-byte argument into 4 parts, each interpreted as a signed 8-bit integer, then negates each part with 8-bit wrap-around.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vneg4(0x80808080U) returns 0x80808080U.
-
__device__ unsigned int __vnegss2(unsigned int a)
-
Computes per-halfword negation with signed saturation.
Splits the 4-byte argument into 2 parts, each interpreted as a signed 16-bit integer, then negates each part with signed saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vnegss2(0x80008000U) returns 0x7fff7fffU.
-
__device__ unsigned int __vnegss4(unsigned int a)
-
Performs per-byte negation with signed saturation.
Splits the 4-byte argument into 4 parts, each interpreted as a signed 8-bit integer, then negates each part with signed saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vnegss4(0x80808080U) returns 0x7f7f7f7fU.
-
__device__ unsigned int __vsads2(unsigned int a, unsigned int b)
-
Computes the sum of per-halfword absolute differences of signed values.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes treated as signed values. For corresponding parts, the function computes absolute differences and returns sum of those differences.
- Returns
-
Returns computed value.
-
__device__ unsigned int __vsads4(unsigned int a, unsigned int b)
-
Computes the sum of per-byte absolute differences of signed values.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte treated as signed values. For corresponding parts, the function computes absolute differences and returns sum of those differences.
- Returns
-
Returns computed value.
-
__device__ unsigned int __vsadu2(unsigned int a, unsigned int b)
-
Computes the sum of per-halfword absolute differences of unsigned values.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes treated as unsigned values. For corresponding parts, the function computes absolute differences and returns sum of those differences.
- Returns
-
Returns computed value.
-
__device__ unsigned int __vsadu4(unsigned int a, unsigned int b)
-
Computes the sum of per-byte absolute differences of unsigned values.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte treated as unsigned values. For corresponding parts, the function computes absolute differences and returns sum of those differences.
- Returns
-
Returns computed value.
-
__device__ unsigned int __vseteq2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a == b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part == ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vseteq2(0x12345678U, 0x1234abcdU) returns 0x00010000.
-
__device__ unsigned int __vseteq4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a == b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part == ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vseteq4(0x807f3302U, 0x7f803301U) returns 0x00000100.
-
__device__ unsigned int __vsetges2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a >= b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part >= ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetges2(0x80007fffU, 0x7fff8000U) returns 0x00000001.
-
__device__ unsigned int __vsetges4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a >= b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part >= ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetges4(0x807f3302U, 0x7f803301U) returns 0x00010101.
-
__device__ unsigned int __vsetgeu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a >= b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part >= ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgeu2(0x80007fffU, 0x7fff8000U) returns 0x00010000.
-
__device__ unsigned int __vsetgeu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a >= b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part >= ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgeu4(0x807f3302U, 0x7f803301U) returns 0x01000101.
-
__device__ unsigned int __vsetgts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a > b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part > ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgts2(0x80007fffU, 0x7fff8000U) returns 0x00000001.
-
__device__ unsigned int __vsetgts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a > b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part > ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgts4(0x807f3302U, 0x7f803301U) returns 0x00010001.
-
__device__ unsigned int __vsetgtu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a > b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part > ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgtu2(0x80007fffU, 0x7fff8000U) returns 0x00010000.
-
__device__ unsigned int __vsetgtu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a > b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part > ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetgtu4(0x807f3302U, 0x7f803301U) returns 0x01000001.
-
__device__ unsigned int __vsetles2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a <= b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part <= ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetles2(0x80007fffU, 0x7fff8000U) returns 0x00010000.
-
__device__ unsigned int __vsetles4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a <= b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part <= ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetles4(0x807f3302U, 0x7f803301U) returns 0x01000100.
-
__device__ unsigned int __vsetleu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a <= b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part <= ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetleu2(0x80007fffU, 0x7fff8000U) returns 0x00000001.
-
__device__ unsigned int __vsetleu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a <= b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part <= ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetleu4(0x807f3302U, 0x7f803301U) returns 0x00010100.
-
__device__ unsigned int __vsetlts2(unsigned int a, unsigned int b)
-
Performs per-halfword signed comparison: a < b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part < ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetlts2(0x80007fffU, 0x7fff8000U) returns 0x00010000.
-
__device__ unsigned int __vsetlts4(unsigned int a, unsigned int b)
-
Performs per-byte signed comparison: a < b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part < ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetlts4(0x807f3302U, 0x7f803301U) returns 0x01000000.
-
__device__ unsigned int __vsetltu2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a < b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part < ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetltu2(0x80007fffU, 0x7fff8000U) returns 0x00000001.
-
__device__ unsigned int __vsetltu4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a < b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part < ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetltu4(0x807f3302U, 0x7f803301U) returns 0x00010000.
-
__device__ unsigned int __vsetne2(unsigned int a, unsigned int b)
-
Performs per-halfword unsigned comparison: a != b ? 0x0001 : 0x0000.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs comparison ‘a’ part != ‘b’ part, delivering 0x0001 if true and 0x0000 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetne2(0x12345678U, 0x1234abcdU) returns 0x00000001.
-
__device__ unsigned int __vsetne4(unsigned int a, unsigned int b)
-
Performs per-byte unsigned comparison: a != b ? 0x01 : 0x00.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs comparison ‘a’ part != ‘b’ part, delivering 0x01 if true and 0x00 otherwise.
- Returns
-
Partial results are recombined and returned as an unsigned int.
__vsetne4(0x807f3302U, 0x7f803301U) returns 0x01010001.
-
__device__ unsigned int __vsub2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with wrap-around: a - b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs subtraction with wrap-around.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vsub4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with wrap-around: a - b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs subtraction with wrap-around.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vsubss2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with signed saturation: a - b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs subtraction with signed saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vsubss4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with signed saturation: a - b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs subtraction with signed saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vsubus2(unsigned int a, unsigned int b)
-
Performs per-halfword subtraction with unsigned saturation: a - b.
Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. For corresponding parts, the function performs subtraction with unsigned saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.
-
__device__ unsigned int __vsubus4(unsigned int a, unsigned int b)
-
Performs per-byte subtraction with unsigned saturation: a - b.
Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. For corresponding parts, the function performs subtraction with unsigned saturation.
- Returns
-
Partial results are recombined and returned as an unsigned int.