本文整理汇总了C++中UNION_TYPE函数的典型用法代码示例。如果您正苦于以下问题:C++ UNION_TYPE函数的具体用法?C++ UNION_TYPE怎么用?C++ UNION_TYPE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UNION_TYPE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST
void
TEST (void)
{
int i, sign;
UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3;
UNION_TYPE (128, i_q) src;
MASK_TYPE mask = SIZE | 123;
long long res_ref[SIZE];
sign = -1;
for (i = 0; i < 2; i++)
{
src.a[i] = 34 * i * sign;
sign = sign * -1;
}
for (i = 0; i < SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
res1.x = INTRINSIC (_broadcast_i64x2) (src.x);
res2.x = INTRINSIC (_mask_broadcast_i64x2) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_broadcast_i64x2) (mask, src.x);
CALC (res_ref, src.a);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}
示例2: TEST
static void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, d) s;
UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
unsigned res_ref[DST_SIZE] = { 0 };
int i;
for (i = 0; i < SRC_SIZE; i++)
{
s.a[i] = 123.456 * (i + 2000);
}
for (i = 0; i < DST_SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
res1.x = INTRINSIC (_cvtpd_epu32) (s.x);
res2.x = INTRINSIC (_mask_cvtpd_epu32) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvtpd_epu32) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref))
abort ();
MASK_MERGE (i_d) (res_ref, mask, SRC_SIZE);
if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref))
abort ();
MASK_ZERO (i_d) (res_ref, mask, SRC_SIZE);
if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref))
abort ();
}
示例3: TEST
void
TEST (void)
{
UNION_TYPE (AVX512F_LEN_HALF, i_d) s;
UNION_TYPE (AVX512F_LEN, d) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
double res_ref[DST_SIZE];
int i, sign = 1;
for (i = 0; i < SRC_SIZE; i++)
{
s.a[i] = 123456 * (i + 2000) * sign;
sign = -sign;
}
for (i = 0; i < DST_SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
res1.x = INTRINSIC (_cvtepi32_pd) (s.x);
res2.x = INTRINSIC (_mask_cvtepi32_pd) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvtepi32_pd) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
abort ();
MASK_MERGE (d) (res_ref, mask, DST_SIZE);
if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
abort ();
MASK_ZERO (d) (res_ref, mask, DST_SIZE);
if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
abort ();
}
示例4: TEST
void
TEST (void)
{
int i, sign;
UNION_TYPE (AVX512F_LEN, d) res1, res2, res3;
UNION_TYPE (128, d) src;
MASK_TYPE mask = MASK_VALUE;
double res_ref[SIZE];
sign = -1;
for (i = 0; i < 2; i++)
{
src.a[i] = 1.5 + 34.67 * i * sign;
sign = sign * -1;
}
for (i = 0; i < SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
res1.x = INTRINSIC (_broadcastsd_pd) (src.x);
res2.x = INTRINSIC (_mask_broadcastsd_pd) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_broadcastsd_pd) (mask, src.x);
CALC (res_ref, src.a);
if (UNION_CHECK (AVX512F_LEN, d) (res1, res_ref))
abort ();
MASK_MERGE (d) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, d) (res2, res_ref))
abort ();
MASK_ZERO (d) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, d) (res3, res_ref))
abort ();
}
示例5: TEST
static void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, i_d) s1, s2;
UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
unsigned long long res_ref[DST_SIZE];
int i, sign = 1;
for (i = 0; i < SRC_SIZE; i++)
{
s1.a[i] = i * 20;
s2.a[i] = i + 20;
}
for (i = 0; i < DST_SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
CALC (s1.a, s2.a, res_ref);
res1.x = INTRINSIC (_mul_epu32) (s1.x, s2.x);
res2.x = INTRINSIC (_mask_mul_epu32) (res2.x, mask, s1.x, s2.x);
res3.x = INTRINSIC (_maskz_mul_epu32) (mask, s1.x, s2.x);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, DST_SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, DST_SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}
示例6: TEST
void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, d) s;
UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
unsigned long long res_ref[SIZE];
int i;
for (i = 0; i < SIZE; i++)
{
s.a[i] = 123.456 * (i + 2000);
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_cvttpd_epu64) (s.x);
res2.x = INTRINSIC (_mask_cvttpd_epu64) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvttpd_epu64) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}
示例7: TEST
void
TEST (void)
{
UNION_TYPE (AVX512F_LEN_HALF, i_w) s;
UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
int res_ref[SIZE];
int i, sign = 1;
for (i = 0; i < SIZE; i++)
{
s.a[i] = 2000 * i * sign;
res2.a[i] = DEFAULT_VALUE;
sign = -sign;
}
res1.x = INTRINSIC (_cvtepi16_epi32) (s.x);
res2.x = INTRINSIC (_mask_cvtepi16_epi32) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvtepi16_epi32) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref))
abort ();
MASK_MERGE (i_d) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref))
abort ();
MASK_ZERO (i_d) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref))
abort ();
}
示例8: TEST
void static
TEST (void)
{
int i, sign;
UNION_TYPE (128, i_b) res1, res2, res3;
UNION_TYPE (AVX512F_LEN, i_d) src;
MASK_TYPE mask = MASK_VALUE;
char res_ref[16];
sign = -1;
for (i = 0; i < SIZE; i++)
{
src.a[i] = 1 + 34 * i * sign;
sign = sign * -1;
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_cvtepi32_epi8) (src.x);
res2.x = INTRINSIC (_mask_cvtepi32_epi8) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_cvtepi32_epi8) (mask, src.x);
CALC (res_ref, src.a);
if (UNION_CHECK (128, i_b) (res1, res_ref))
abort ();
MASK_MERGE (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_b) (res2, res_ref))
abort ();
MASK_ZERO (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_b) (res3, res_ref))
abort ();
}
示例9: TEST
void
TEST (void)
{
int i, sign;
UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3;
UNION_TYPE (128, i_w) src;
MASK_TYPE mask = SIZE | 123;
short res_ref[SIZE];
sign = -1;
for (i = 0; i < 8; i++)
{
src.a[i] = 1 + 3 * i * sign;
sign = sign * -1;
}
for (i = 0; i < SIZE; i++)
res2.a[i] = DEFAULT_VALUE;
CALC (res_ref, src.a);
if (AVX512F_LEN == 512)
{
res1.x = INTRINSIC (_broadcastw_epi16) (src.x);
if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref))
abort ();
}
res2.x = INTRINSIC (_mask_broadcastw_epi16) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_broadcastw_epi16) (mask, src.x);
MASK_MERGE (i_w) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref))
abort ();
MASK_ZERO (i_w) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref))
abort ();
CALC (res_ref, src.a);
if (AVX512F_LEN == 512)
{
res1.x = INTRINSIC (_set1_epi16) (src.a[0]);
if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref))
abort ();
}
res2.x = INTRINSIC (_mask_set1_epi16) (res2.x, mask, src.a[0]);
res3.x = INTRINSIC (_maskz_set1_epi16) (mask, src.a[0]);
MASK_MERGE (i_w) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref))
abort ();
MASK_ZERO (i_w) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref))
abort ();
}
示例10: TEST
void
TEST (void)
{
int i, sign;
UNION_TYPE (128, i_b) res1, res2, res3;
char res4[16];
UNION_TYPE (AVX512F_LEN, i_d) src;
MASK_TYPE mask = MASK_VALUE;
char res_ref[16];
char res_ref2[16];
sign = -1;
for (i = 0; i < SIZE; i++)
{
src.a[i] = 1 + 34 * i * sign;
sign = sign * -1;
res2.a[i] = DEFAULT_VALUE;
res4[i] = DEFAULT_VALUE;
}
for (i = SIZE; i < 16; i++)
{
res4[i] = DEFAULT_VALUE * 2;
res_ref2[i] = DEFAULT_VALUE * 2;
}
res1.x = INTRINSIC (_cvtepi32_epi8) (src.x);
res2.x = INTRINSIC (_mask_cvtepi32_epi8) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_cvtepi32_epi8) (mask, src.x);
CALC (res_ref, src.a, 0);
if (UNION_CHECK (128, i_b) (res1, res_ref))
abort ();
MASK_MERGE (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_b) (res2, res_ref))
abort ();
MASK_ZERO (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_b) (res3, res_ref))
abort ();
INTRINSIC (_mask_cvtepi32_storeu_epi8) (res4, mask, src.x);
CALC (res_ref2, src.a, 1);
MASK_MERGE (i_b) (res_ref2, mask, SIZE);
if (checkVc (res4, res_ref2, 16))
abort ();
}
示例11: TEST
void
TEST (void)
{
int i;
UNION_TYPE (128, i_uw) res1, res2, res3;
unsigned short res4[8];
UNION_TYPE (AVX512F_LEN, i_uq) src;
MASK_TYPE mask = MASK_VALUE;
unsigned short res_ref[8];
unsigned short res_ref2[8];
for (i = 0; i < SIZE; i++)
{
src.a[i] = 1 + 34 * i;
res2.a[i] = DEFAULT_VALUE;
res4[i] = DEFAULT_VALUE;
}
for (i = SIZE; i < 8; i++)
{
res_ref2[i] = DEFAULT_VALUE * 2;
res4[i] = DEFAULT_VALUE * 2;
}
res1.x = INTRINSIC (_cvtusepi64_epi16) (src.x);
res2.x = INTRINSIC (_mask_cvtusepi64_epi16) (res2.x, mask, src.x);
res3.x = INTRINSIC (_maskz_cvtusepi64_epi16) (mask, src.x);
CALC (res_ref, src.a, 0);
if (UNION_CHECK (128, i_uw) (res1, res_ref))
abort ();
MASK_MERGE (i_uw) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_uw) (res2, res_ref))
abort ();
MASK_ZERO (i_uw) (res_ref, mask, SIZE);
if (UNION_CHECK (128, i_uw) (res3, res_ref))
abort ();
INTRINSIC (_mask_cvtusepi64_storeu_epi16) (res4, mask, src.x);
CALC (res_ref2, src.a, 1);
MASK_MERGE (i_w) (res_ref2, mask, SIZE);
if (checkVs (res4, res_ref2, 8))
abort ();
}
示例12: TEST
void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, i_b) s1, s2, res1, res2 ,res3;
MASK_TYPE mask = MASK_VALUE;
char res_ref[SIZE];
int i;
for (i = 0; i < SIZE; i++)
{
s1.a[i] = i + 15;
s2.a[i] = i + 14;
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_avg_epu8) (s1.x, s2.x);
res2.x = INTRINSIC (_mask_avg_epu8) (res2.x, mask, s1.x, s2.x);
res3.x = INTRINSIC (_maskz_avg_epu8) (mask, s1.x, s2.x);
CALC (s1.a, s2.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref))
abort ();
MASK_MERGE (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref))
abort ();
MASK_ZERO (i_b) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref))
abort ();
}
示例13: TEST
void static
TEST (void)
{
UNION_TYPE (AVX512F_LEN, i_q) s1, s2, res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
long long res_ref[SIZE];
int i, sign = 1;
for (i = 0; i < SIZE; i++)
{
s1.a[i] = i * sign;
s2.a[i] = (i + 20) * sign;
sign = -sign;
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_andnot_epi64) (s1.x, s2.x);
res2.x = INTRINSIC (_mask_andnot_epi64) (res2.x, mask, s1.x, s2.x);
res3.x = INTRINSIC (_maskz_andnot_epi64) (mask, s1.x, s2.x);
CALC (s1.a, s2.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}
示例14: TEST
static void
TEST (void)
{
UNION_TYPE (AVX512F_LEN, i_q) s, res1, res2, res3;
long long res_ref[SIZE];
MASK_TYPE mask = MASK_VALUE;
int i;
for (i = 0; i < SIZE; i++)
{
s.a[i] = 12345678 * (i % 5);
res1.a[i] = DEFAULT_VALUE;
res2.a[i] = DEFAULT_VALUE;
res3.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_conflict_epi64) (s.x);
res2.x = INTRINSIC (_mask_conflict_epi64) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_conflict_epi64) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}
示例15: TEST
static void
TEST (void)
{
union128i_w s;
UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3;
MASK_TYPE mask = MASK_VALUE;
long long int res_ref[SIZE];
int i;
for (i = 0; i < SIZE; i++)
{
s.a[i] = 2000 * i;
res2.a[i] = DEFAULT_VALUE;
}
res1.x = INTRINSIC (_cvtepu16_epi64) (s.x);
res2.x = INTRINSIC (_mask_cvtepu16_epi64) (res2.x, mask, s.x);
res3.x = INTRINSIC (_maskz_cvtepu16_epi64) (mask, s.x);
CALC (s.a, res_ref);
if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref))
abort ();
MASK_MERGE (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref))
abort ();
MASK_ZERO (i_q) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref))
abort ();
}