# Intrinsics for Arithmetic Operations

Parent topic: Intrinsics for Intel® Advanced Vector Extensions 2 (Intel® AVX2)

- _mm256_abs_epi8/16/32
  Computes the absolute value of the signed packed integer data elements of a given vector. The corresponding Intel® AVX2 instruction is VPABSB, VPABSW, or VPABSD.
- _mm256_add_epi8/16/32/64
  Adds signed/unsigned packed 8/16/32/64-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPADDB, VPADDW, VPADDD, or VPADDQ.
- _mm256_adds_epi8/16
  Adds the signed 8/16-bit integer data elements with saturation of two vectors. The corresponding Intel® AVX2 instruction is VPADDSB or VPADDSW.
- _mm256_adds_epu8/16
  Adds the unsigned 8/16-bit integer data elements with saturation of two vectors. The corresponding Intel® AVX2 instruction is VPADDUSB or VPADDUSW.
- _mm256_sub_epi8/16/32/64
  Subtracts signed/unsigned packed 8/16/32/64-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPSUBB, VPSUBW, VPADDD, or VPSUBQ.
- _mm256_subs_epi8/16
  Subtracts the signed 8/16-bit integer data elements with saturation of two vectors. The corresponding Intel® AVX2 instruction is VPSUBSB or VPSUBSW.
- _mm256_subs_epu8/16
  Subtracts the unsigned 8/16-bit integer data elements with saturation of two vectors. The corresponding Intel® AVX2 instruction is VPSUBUSB or VPSUBUSW.
- _mm256_avg_epu8/16
  Computes the average of unsigned 8/16-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPAVGB or VPAVGW.
- _mm256_hadd_epi16/32
  Horizontally adds adjacent signed packed 16/32-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPHADDW or VPHADDD.
- _mm256_hadds_epi16
  Horizontally adds adjacent signed packed 16-bit integer data elements of two vectors with saturation. The corresponding Intel® AVX2 instruction is VPHADDSW.
- _mm256_hsub_epi16/32
  Horizontally subtracts adjacent signed packed 16/32-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPHSUBW or VPHSUBD.
- _mm256_hsubs_epi16
  Horizontally subtracts adjacent signed packed 16-bit integer data elements of two vectors with saturation. The corresponding Intel® AVX2 instruction is VPHSUBSW.
- _mm256_madd_epi16
  Multiplies signed packed 16-bit integer data elements of two vectors. The corresponding Intel® AVX2 instruction is VPMADDW.
- _mm256_maddubs_epi16
  Multiplies unsigned packed 16-bit integer data elements of one vector with signed elements of second vector. The corresponding Intel® AVX2 instruction is VPMADDUBSW.
- _mm256_mul_epi32
  Multiplies two vectors with packed doubleword signed integer values. The corresponding Intel® AVX2 instruction is VPMULDQ.
- _mm256_mul_epu32
  Multiplies two vectors with packed doubleword unsigned integer values. The corresponding Intel® AVX2 instruction is VPMULUDQ.
- _mm256_mulhi_epi16
  Multiplies signed packed 16/32-bit integer data elements of two vectors and stores high bits. The corresponding Intel® AVX2 instruction is VPMULHW.
- _mm256_mulhi_epu16
  Multiplies unsigned packed 16/32-bit integer data elements of two vectors and stores high bits. The corresponding Intel® AVX2 instruction is VPMULHUW.
- _mm256_mullo_epi16/32
  Multiplies signed packed 16/32-bit integer data elements of two vectors and stores low bits. The corresponding Intel® AVX2 instruction is VPMULLW or VPMULLD.
- _mm256_mulhrs_epi16
  Multiplies extended packed unsigned integers of two vectors with round and scale. The corresponding Intel® AVX2 instruction is VPMULHRSW.
- _mm256_sign_epi8/16/32
  Changes the sign of elements in one source vector depending on the sign of corresponding element in other source vector. The corresponding Intel® AVX2 instruction is VPSIGNB, VPSIGNW, or VPSIGND.
- _mm256_mpsadbw_epu8
  Performs multiple sum of absolute differences on extended packed unsigned integer values ofs two vectors. The corresponding Intel® AVX2 instruction is VMPSADBW.
- _mm256_sad_epu8
  Computes sum of absolute differences between extended packed unsigned values of two vectors. The corresponding Intel® AVX2 instruction is VPSADBW.