Please enter what you're looking for to continue your search
 

_mm512_maskz_ternarylogic_epi32
ADD TO COMPARE ADDED TO COMPARE

Purpose:
Bitwise ternary logic that provides the capability to implement any three-operand binary function; the specific binary function is specified by value in "imm8". For each bit in each packed 32-bit integer, the corresponding bit from "a", "b", and "c" are used to form a 3 bit index into "imm8", and the value at that bit in "imm8" is written to the corresponding bit in "dst" using zeromask "k" at 32-bit granularity (32-bit elements are zeroed out when the corresponding mask bit is not set).
Result:

__m512i

Example:
#include <immintrin.h>
#include <stdio.h>
int main() {
 __m512i a = _mm512_set_epi32(        0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0,        0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0, 0xFFFFFFFF, 0    );
 __m512i b = _mm512_set1_epi32(0xAAAAAAAA);
 __m512i c = _mm512_set1_epi32(0x55555555);
 __mmask16 k = 0xFF00;
 __m512i result = _mm512_maskz_ternarylogic_epi32(k, a, b, c, 0x96);
 int* res = (int*)&result;
 for (int i = 0; i < 16; i++)
  printf("%08X\n", res[i]);

  return 0;
 }

Prototypes

Assembly Instruction:
VPTERNLOGQ
Usage:
__m512i result = _mm512_maskz_ternarylogic_epi32( __mmask16 a, __m512i b, __m512i c, __m512i d, int e )
Performance Metrics:
📊 Unlock Performance Insights

Get access to detailed performance metrics including latency, throughput, and CPU-specific benchmarks for this intrinsic.

SIMD Intrinsics Summary
SIMD Engines: 6
C Intrinsics: 10444
NEON: 4353
AVX2: 405
AVX512: 4717
SSE4.2: 598
VSX: 192
IBM-Z: 179