core/simd/x86

simd_x86

Types

21

Constants

90

Procedures

673

_mm256_hadd_pd

_mm256_hadd_pd :: proc(a: __m256d, b: __m256d) -> (__m256d)Source

Horizontal addition of adjacent pairs in the two packed vectors of 4 64-bit floating points a and b. In the result, sums of elements from a are returned in even locations, while sums of elements from b are returned in odd locations.

_mm256_hadd_ps

_mm256_hadd_ps :: proc(a: __m256, b: __m256) -> (__m256)Source

Horizontal addition of adjacent pairs in the two packed vectors of 8 32-bit floating points a and b. In the result, sums of elements from a are returned in locations of indices 0, 1, 4, 5; while sums of elements from b are locations 2, 3, 6, 7.

_mm256_hsub_pd

_mm256_hsub_pd :: proc(a: __m256d, b: __m256d) -> (__m256d)Source

Horizontal subtraction of adjacent pairs in the two packed vectors of 4 64-bit floating points a and b. In the result, sums of elements from a are returned in even locations, while sums of elements from b are returned in odd locations.

_mm256_hsub_ps

_mm256_hsub_ps :: proc(a: __m256, b: __m256) -> (__m256)Source

Horizontal subtraction of adjacent pairs in the two packed vectors of 8 32-bit floating points a and b. In the result, sums of elements from a are returned in locations of indices 0, 1, 4, 5; while sums of elements from b are locations 2, 3, 6, 7.

_mm256_loadu2_m128

_mm256_loadu2_m128 :: proc(hiaddr: ^f32, loaddr: ^f32) -> (__m256)Source

Loads two 128-bit values (composed of 4 packed single-precision (32-bit) floating-point elements) from memory, and combine them into a 256-bit value. hiaddr and loaddr do not need to be aligned on any particular boundary.

_mm256_loadu2_m128d

_mm256_loadu2_m128d :: proc(hiaddr: ^f64, loaddr: ^f64) -> (__m256d)Source

Loads two 128-bit values (composed of 2 packed double-precision (64-bit) floating-point elements) from memory, and combine them into a 256-bit value. hiaddr and loaddr do not need to be aligned on any particular boundary.

_mm256_loadu_pd

_mm256_loadu_pd :: proc(mem_addr: ^f64) -> (__m256d)Source

Loads 256-bits (composed of 4 packed double-precision (64-bit) floating-point elements) from memory into result. mem_addr does not need to be aligned on any particular boundary.

_mm256_loadu_ps

_mm256_loadu_ps :: proc(mem_addr: ^f32) -> (__m256)Source

Loads 256-bits (composed of 8 packed single-precision (32-bit) floating-point elements) from memory into result. mem_addr does not need to be aligned on any particular boundary.

_mm256_rcp_ps

_mm256_rcp_ps :: proc(a: __m256) -> (__m256)Source

// Moves integer data from a 256-bit integer vector to a 32-byte // aligned memory location. To minimize caching, the data is flagged as // non-temporal (unlikely to be used again soon) // // Intel's documentation // // # Safety of non-temporal stores // // After using this intrinsic, but before any other access to the memory that this intrinsic // mutates, a call to [_mm_sfence] must be performed by the thread that used the intrinsic. In // particular, functions that call this intrinsic should generally call _mm_sfence before they // return. // // See [_mm_sfence] for details. @(enable_target_feature="avx") _mm256_stream_si256 :: #force_inline proc "c" (mem_addr: ^__m256i, a: __m256i) {

panic_contextless("TODO: _mm256_stream_si256")
}

// Moves double-precision values from a 256-bit vector of `[4 x double]`
// to a 32-byte aligned memory location. To minimize caching, the data is
// flagged as non-temporal (unlikely to be used again soon).
//
// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_stream_pd)
//
// # Safety of non-temporal stores
//
// After using this intrinsic, but before any other access to the memory that this intrinsic
// mutates, a call to [`_mm_sfence`] must be performed by the thread that used the intrinsic. In
// particular, functions that call this intrinsic should generally call `_mm_sfence` before they
// return.
//
// See [`_mm_sfence`] for details.
@(enable_target_feature="avx")
_mm256_stream_pd :: #force_inline proc "c" (mem_addr: ^f64, a: __m256d) {
	panic_contextless("TODO: _mm256_stream_pd")
}

// Moves single-precision floating point values from a 256-bit vector
// of `[8 x float]` to a 32-byte aligned memory location. To minimize
// caching, the data is flagged as non-temporal (unlikely to be used again
// soon).
//
// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_stream_ps)
//
// # Safety of non-temporal stores
//
// After using this intrinsic, but before any other access to the memory that this intrinsic
// mutates, a call to [`_mm_sfence`] must be performed by the thread that used the intrinsic. In
// particular, functions that call this intrinsic should generally call `_mm_sfence` before they
// return.
//
// See [`_mm_sfence`] for details.
@(enable_target_feature="avx")
_mm256_stream_ps :: #force_inline proc "c" (mem_addr: ^f32, a: __m256) {
	panic_contextless("TODO: _mm256_stream_ps")
}
Computes the approximate reciprocal of packed single-precision (32-bit) floating-point elements in `a`, and returns the results. The maximum
relative error for this approximation is less than 1.5*2^-12.

[Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_rcp_ps)

_mm256_round_pd

_mm256_round_pd :: proc(a: __m256d, ROUNDING: u8) -> (__m256d)Source

Rounds packed double-precision (64-bit) floating point elements in a according to the flag ROUNDING. The value of ROUNDING may be as follows:

  • 0x00: Round to the nearest whole number.
  • 0x01: Round down, toward negative infinity.
  • 0x02: Round up, toward positive infinity.
  • 0x03: Truncate the values.

For a complete list of options, check [the LLVM docs][llvm_docs].

[llvm_docs]: https://github.com/llvm-mirror/clang/blob/dcd8d797b20291f1a6b3e0ddda085aa2bbb382a8/lib/Headers/avxintrin.h#L382

Intel's documentation

_mm256_round_ps

_mm256_round_ps :: proc(a: __m256, ROUNDING: u8) -> (__m256)Source

Rounds packed single-precision (32-bit) floating point elements in a according to the flag ROUNDING. The value of ROUNDING may be as follows:

  • 0x00: Round to the nearest whole number.
  • 0x01: Round down, toward negative infinity.
  • 0x02: Round up, toward positive infinity.
  • 0x03: Truncate the values.

For a complete list of options, check [the LLVM docs][llvm_docs].

[llvm_docs]: https://github.com/llvm-mirror/clang/blob/dcd8d797b20291f1a6b3e0ddda085aa2bbb382a8/lib/Headers/avxintrin.h#L382

Intel's documentation

_mm256_storeu2_m128

_mm256_storeu2_m128 :: proc(hiaddr: ^f32, loaddr: ^f32, a: __m256)Source

Stores the high and low 128-bit halves (each composed of 4 packed single-precision (32-bit) floating-point elements) from a into memory two different 128-bit locations. hiaddr and loaddr do not need to be aligned on any particular boundary.

_mm256_storeu2_m128d

_mm256_storeu2_m128d :: proc(hiaddr: ^f64, loaddr: ^f64, a: __m256d)Source

Stores the high and low 128-bit halves (each composed of 2 packed double-precision (64-bit) floating-point elements) from a into memory two different 128-bit locations. hiaddr and loaddr do not need to be aligned on any particular boundary.

_mm256_storeu_pd

_mm256_storeu_pd :: proc(mem_addr: ^f64, a: __m256d)Source

Stores 256-bits (composed of 4 packed double-precision (64-bit) floating-point elements) from a into memory. mem_addr does not need to be aligned on any particular boundary.

_mm256_storeu_ps

_mm256_storeu_ps :: proc(mem_addr: ^f32, a: __m256)Source

Stores 256-bits (composed of 8 packed single-precision (32-bit) floating-point elements) from a into memory. mem_addr does not need to be aligned on any particular boundary.

_mm256_testc_pd

_mm256_testc_pd :: proc(a: __m256d, b: __m256d) -> (i32)Source

Computes the bitwise AND of 256 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return the CF value.

Intel's documentation

_mm256_testc_ps

_mm256_testc_ps :: proc(a: __m256, b: __m256) -> (i32)Source

Computes the bitwise AND of 256 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return the CF value.

Intel's documentation

_mm256_testc_si256

_mm256_testc_si256 :: proc(a: __m256i, b: __m256i) -> (i32)Source

Computes the bitwise AND of 256 bits (representing integer data) in a and b, and set ZF to 1 if the result is zero, otherwise set ZF to 0. Computes the bitwise NOT of a and then AND with b, and set CF to 1 if the result is zero, otherwise set CF to 0. Return the CF value.

_mm256_testnzc_pd

_mm256_testnzc_pd :: proc(a: __m256d, b: __m256d) -> (i32)Source

Computes the bitwise AND of 256 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return 1 if both the ZF and CF values are zero, otherwise return 0.

Intel's documentation

_mm256_testnzc_ps

_mm256_testnzc_ps :: proc(a: __m256, b: __m256) -> (i32)Source

Computes the bitwise AND of 256 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return 1 if both the ZF and CF values are zero, otherwise return 0.

Intel's documentation

_mm256_testnzc_si256

_mm256_testnzc_si256 :: proc(a: __m256i, b: __m256i) -> (i32)Source

Computes the bitwise AND of 256 bits (representing integer data) in a and b, and set ZF to 1 if the result is zero, otherwise set ZF to 0. Computes the bitwise NOT of a and then AND with b, and set CF to 1 if the result is zero, otherwise set CF to 0. Return 1 if both the ZF and CF values are zero, otherwise return 0.

Intel's documentation

_mm256_testz_pd

_mm256_testz_pd :: proc(a: __m256d, b: __m256d) -> (i32)Source

Computes the bitwise AND of 256 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return the ZF value.

Intel's documentation

_mm256_testz_ps

_mm256_testz_ps :: proc(a: __m256, b: __m256) -> (i32)Source

Computes the bitwise AND of 256 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 256-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return the ZF value.

Intel's documentation

_mm256_testz_si256

_mm256_testz_si256 :: proc(a: __m256i, b: __m256i) -> (i32)Source

Computes the bitwise AND of 256 bits (representing integer data) in a and b, and set ZF to 1 if the result is zero, otherwise set ZF to 0. Computes the bitwise NOT of a and then AND with b, and set CF to 1 if the result is zero, otherwise set CF to 0. Return the ZF value.

_mm_cmp_sd

_mm_cmp_sd :: proc(a: __m128d, b: __m128d, IMM5: u8) -> (__m128d)Source

Compares the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by IMM5, store the result in the lower element of returned vector, and copies the upper element from a to the upper element of returned vector.

Intel's documentation

_mm_cmp_ss

_mm_cmp_ss :: proc(a: __m128, b: __m128, IMM5: u8) -> (__m128)Source

Compares the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by IMM5, store the result in the lower element of returned vector, and copies the upper 3 packed elements from a to the upper elements of returned vector.

Intel's documentation

_mm_maskload_pd

_mm_maskload_pd :: proc(mem_addr: ^f64, mask: __m128i) -> (__m128d)Source

Loads packed double-precision (64-bit) floating-point elements from memory into result using mask (elements are zeroed out when the high bit of the corresponding element is not set).

_mm_maskload_ps

_mm_maskload_ps :: proc(mem_addr: ^f32, mask: __m128i) -> (__m128)Source

Loads packed single-precision (32-bit) floating-point elements from memory into result using mask (elements are zeroed out when the high bit of the corresponding element is not set).

_mm_testc_pd

_mm_testc_pd :: proc(a: __m128d, b: __m128d) -> (i32)Source

Computes the bitwise AND of 128 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return the CF value.

_mm_testc_ps

_mm_testc_ps :: proc(a: __m128, b: __m128) -> (i32)Source

Computes the bitwise AND of 128 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return the CF value.

_mm_testnzc_pd

_mm_testnzc_pd :: proc(a: __m128d, b: __m128d) -> (i32)Source

Computes the bitwise AND of 128 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return 1 if both the ZF and CF values are zero, otherwise return 0.

Intel's documentation

_mm_testnzc_ps

_mm_testnzc_ps :: proc(a: __m128, b: __m128) -> (i32)Source

Computes the bitwise AND of 128 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return 1 if both the ZF and CF values are zero, otherwise return 0.

Intel's documentation

_mm_testz_pd

_mm_testz_pd :: proc(a: __m128d, b: __m128d) -> (i32)Source

Computes the bitwise AND of 128 bits (representing double-precision (64-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 64-bit element in the intermediate value is zero, otherwise set CF to 0. Return the ZF value.

_mm_testz_ps

_mm_testz_ps :: proc(a: __m128, b: __m128) -> (i32)Source

Computes the bitwise AND of 128 bits (representing single-precision (32-bit) floating-point elements) in a and b, producing an intermediate 128-bit value, and set ZF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set ZF to 0. Compute the bitwise NOT of a and then AND with b, producing an intermediate value, and set CF to 1 if the sign bit of each 32-bit element in the intermediate value is zero, otherwise set CF to 0. Return the ZF value.

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.