/* These are just some skeletons I've been using to speed up the process of creating new tests for SSE functions. */ static int test_simde_mm_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float32 a[4]; const simde_float32 b[4]; const simde_float32 r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128 a = simde_mm_loadu_ps(test_vec[i].a); simde__m128 b = simde_mm_loadu_ps(test_vec[i].b); simde__m128 r = simde_mm_xxx_ps(a, b); simde_test_x86_assert_equal_f32x4(r, simde_mm_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128 a = simde_test_x86_random_f32x4(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m128 b = simde_test_x86_random_f32x4(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m128 r = simde_mm_xxx_ps(a, b); simde_test_x86_write_f32x4(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float32 a[4]; const simde_float32 b[4]; const simde_float32 r[4]; } test_vec[] = { #if !defined(SIMDE_FAST_NANS) #endif }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128 a = simde_mm_loadu_ps(test_vec[i].a); simde__m128 b = simde_mm_loadu_ps(test_vec[i].b); simde__m128 r = simde_mm_xxx_ps(a, b); simde_test_x86_assert_equal_f32x4(r, simde_mm_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); simde_float32 values[8 * 2 * sizeof(simde__m128)]; simde_test_x86_random_f32x4_full(8, 2, values, -1000.0f, 1000.0f, SIMDE_TEST_VEC_FLOAT_NAN); for (size_t i = 0 ; i < 8 ; i++) { simde__m128 a = simde_test_x86_random_extract_f32x4(i, 2, 0, values); simde__m128 b = simde_test_x86_random_extract_f32x4(i, 2, 1, values); simde__m128 r = simde_mm_xxx_ps(a, b); simde_test_x86_write_f32x4(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float64 a[2]; const simde_float64 b[2]; const simde_float64 r[2]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128d a = simde_mm_loadu_pd(test_vec[i].a); simde__m128d b = simde_mm_loadu_pd(test_vec[i].b); simde__m128d r = simde_mm_xxx_pd(a, b); simde_test_x86_assert_equal_f64x2(r, simde_mm_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128d a = simde_test_x86_random_f64x2(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m128d b = simde_test_x86_random_f64x2(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m128d r = simde_mm_xxx_pd(a, b); simde_test_x86_write_f64x2(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f64x2(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x2(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float64 a[2]; const simde_float64 b[2]; const simde_float64 r[2]; } test_vec[] = { #if !defined(SIMDE_FAST_NANS) #endif }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128d a = simde_mm_loadu_pd(test_vec[i].a); simde__m128d b = simde_mm_loadu_pd(test_vec[i].b); simde__m128d r = simde_mm_xxx_pd(a, b); simde_test_x86_assert_equal_f64x2(r, simde_mm_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); simde_float64 values[8 * 2 * sizeof(simde__m128d)]; simde_test_x86_random_f64x2_full(8, 2, values, -1000.0, 1000.0, SIMDE_TEST_VEC_FLOAT_NAN); for (size_t i = 0 ; i < 8 ; i++) { simde__m128d a = simde_test_x86_random_extract_f64x2(i, 2, 0, values); simde__m128d b = simde_test_x86_random_extract_f64x2(i, 2, 1, values); simde__m128d r = simde_mm_xxx_pd(a, b); simde_test_x86_write_f64x2(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f64x2(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x2(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t a[16]; const int8_t b[16]; const int8_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi8(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi8(test_vec[i].b); simde__m128i r = simde_mm_xxx_epi8(a, b); simde_test_x86_assert_equal_i8x16(r, simde_x_mm_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i a = simde_test_x86_random_i8x16(); simde__m128i b = simde_test_x86_random_i8x16(); simde__m128i r = simde_mm_xxx_epi8(a, b); simde_test_x86_write_i8x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_mask_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t src[16]; const simde__mmask16 k; const int8_t a[16]; const int8_t b[16]; const int8_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i src = simde_mm_loadu_epi8(test_vec[i].src); simde__m128i a = simde_mm_loadu_epi8(test_vec[i].a); simde__m128i b = simde_mm_loadu_epi8(test_vec[i].b); simde__m128i r = simde_mm_mask_xxx_epi8(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x16(r, simde_mm_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i src = simde_test_x86_random_i8x16(); simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m128i a = simde_test_x86_random_i8x16(); simde__m128i b = simde_test_x86_random_i8x16(); simde__m128i r = simde_mm_mask_xxx_epi8(src, k, a, b); simde_test_x86_write_i8x16(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_maskz_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask16 k; const int8_t a[16]; const int8_t b[16]; const int8_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi8(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi8(test_vec[i].b); simde__m128i r = simde_mm_maskz_xxx_epi8(test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x16(r, simde_x_mm_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m128i a = simde_test_x86_random_i8x16(); simde__m128i b = simde_test_x86_random_i8x16(); simde__m128i r = simde_mm_maskz_xxx_epi8(k, a, b); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t a[8]; const int16_t b[8]; const int16_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi16(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi16(test_vec[i].b); simde__m128i r = simde_mm_xxx_epi16(a, b); simde_test_x86_assert_equal_i16x8(r, simde_x_mm_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i a = simde_test_x86_random_i16x8(); simde__m128i b = simde_test_x86_random_i16x8(); simde__m128i r = simde_mm_xxx_epi16(a, b); simde_test_x86_write_i16x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_mask_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t src[8]; const simde__mmask8 k; const int16_t a[8]; const int16_t b[8]; const int16_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i src = simde_mm_loadu_epi16(test_vec[i].src); simde__m128i a = simde_mm_loadu_epi16(test_vec[i].a); simde__m128i b = simde_mm_loadu_epi16(test_vec[i].b); simde__m128i r = simde_mm_mask_xxx_epi16(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x8(r, simde_mm_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i src = simde_test_x86_random_i16x8(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i16x8(); simde__m128i b = simde_test_x86_random_i16x8(); simde__m128i r = simde_mm_mask_xxx_epi16(src, k, a, b); simde_test_x86_write_i16x8(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_maskz_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const int16_t a[8]; const int16_t b[8]; const int16_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi16(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi16(test_vec[i].b); simde__m128i r = simde_mm_maskz_xxx_epi16(test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x8(r, simde_x_mm_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i16x8(); simde__m128i b = simde_test_x86_random_i16x8(); simde__m128i r = simde_mm_maskz_xxx_epi16(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t a[4]; const int32_t b[4]; const int32_t r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi32(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi32(test_vec[i].b); simde__m128i r = simde_mm_xxx_epi32(a, b); simde_test_x86_assert_equal_i32x4(r, simde_x_mm_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i a = simde_test_x86_random_i32x4(); simde__m128i b = simde_test_x86_random_i32x4(); simde__m128i r = simde_mm_xxx_epi32(a, b); simde_test_x86_write_i32x4(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_mask_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t src[4]; const simde__mmask8 k; const int32_t a[4]; const int32_t b[4]; const int32_t r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i src = simde_x_mm_loadu_epi32(test_vec[i].src); simde__m128i a = simde_x_mm_loadu_epi32(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi32(test_vec[i].b); simde__m128i r = simde_mm_mask_xxx_epi32(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i32x4(r, simde_x_mm_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i src = simde_test_x86_random_i32x4(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i32x4(); simde__m128i b = simde_test_x86_random_i32x4(); simde__m128i r = simde_mm_mask_xxx_epi32(src, k, a, b); simde_test_x86_write_i32x4(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_maskz_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const int32_t a[4]; const int32_t b[4]; const int32_t r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi32(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi32(test_vec[i].b); simde__m128i r = simde_mm_maskz_xxx_epi32(test_vec[i].k, a, b); simde_test_x86_assert_equal_i32x4(r, simde_x_mm_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i32x4(); simde__m128i b = simde_test_x86_random_i32x4(); simde__m128i r = simde_mm_maskz_xxx_epi32(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x4(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t a[2]; const int64_t b[2]; const int64_t r[2]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi64(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi64(test_vec[i].b); simde__m128i r = simde_mm_xxx_epi64(a, b); simde_test_x86_assert_equal_i64x2(r, simde_x_mm_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i a = simde_test_x86_random_i64x2(); simde__m128i b = simde_test_x86_random_i64x2(); simde__m128i r = simde_mm_xxx_epi64(a, b); simde_test_x86_write_i64x2(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x2(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_mask_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t src[2]; const simde__mmask8 k; const int64_t a[2]; const int64_t b[2]; const int64_t r[2]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i src = simde_x_mm_loadu_epi64(test_vec[i].src); simde__m128i a = simde_x_mm_loadu_epi64(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi64(test_vec[i].b); simde__m128i r = simde_mm_mask_xxx_epi64(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i64x2(r, simde_x_mm_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m128i src = simde_test_x86_random_i64x2(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i64x2(); simde__m128i b = simde_test_x86_random_i64x2(); simde__m128i r = simde_mm_mask_xxx_epi64(src, k, a, b); simde_test_x86_write_i64x2(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm_maskz_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const int64_t a[2]; const int64_t b[2]; const int64_t r[2]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m128i a = simde_x_mm_loadu_epi64(test_vec[i].a); simde__m128i b = simde_x_mm_loadu_epi64(test_vec[i].b); simde__m128i r = simde_mm_maskz_xxx_epi64(test_vec[i].k, a, b); simde_test_x86_assert_equal_i64x2(r, simde_x_mm_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m128i a = simde_test_x86_random_i64x2(); simde__m128i b = simde_test_x86_random_i64x2(); simde__m128i r = simde_mm_maskz_xxx_epi64(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x2(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x2(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float32 a[8]; const simde_float32 b[8]; const simde_float32 r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256 a = simde_mm256_loadu_ps(test_vec[i].a); simde__m256 b = simde_mm256_loadu_ps(test_vec[i].b); simde__m256 r = simde_mm256_xxx_ps(a, b); simde_test_x86_assert_equal_f32x8(r, simde_mm256_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256 a = simde_test_x86_random_f32x8(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m256 b = simde_test_x86_random_f32x8(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m256 r = simde_mm256_xxx_ps(a, b); simde_test_x86_write_f32x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float64 a[4]; const simde_float64 b[4]; const simde_float64 r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256d a = simde_mm256_loadu_pd(test_vec[i].a); simde__m256d b = simde_mm256_loadu_pd(test_vec[i].b); simde__m256d r = simde_mm256_xxx_pd(a, b); simde_test_x86_assert_equal_f64x4(r, simde_mm256_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256d a = simde_test_x86_random_f64x4(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m256d b = simde_test_x86_random_f64x4(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m256d r = simde_mm256_xxx_pd(a, b); simde_test_x86_write_f64x4(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f64x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t a[32]; const int8_t b[32]; const int8_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi8(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi8(test_vec[i].b); simde__m256i r = simde_mm256_xxx_epi8(a, b); simde_test_x86_assert_equal_i8x32(r, simde_x_mm256_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i a = simde_test_x86_random_i8x32(); simde__m256i b = simde_test_x86_random_i8x32(); simde__m256i r = simde_mm256_xxx_epi8(a, b); simde_test_x86_write_i8x32(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_mask_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t src[32]; const simde__mmask32 k; const int8_t a[32]; const int8_t b[32]; const int8_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i src = simde_x_mm256_loadu_epi8(test_vec[i].src); simde__m256i a = simde_x_mm256_loadu_epi8(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi8(test_vec[i].b); simde__m256i r = simde_mm256_mask_xxx_epi8(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x32(r, simde_x_mm256_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i src = simde_test_x86_random_i8x32(); simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m256i a = simde_test_x86_random_i8x32(); simde__m256i b = simde_test_x86_random_i8x32(); simde__m256i r = simde_mm256_mask_xxx_epi8(src, k, a, b); simde_test_x86_write_i8x32(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_maskz_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask32 k; const int8_t a[32]; const int8_t b[32]; const int8_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi8(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi8(test_vec[i].b); simde__m256i r = simde_mm256_maskz_xxx_epi8(test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x32(r, simde_x_mm256_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m256i a = simde_test_x86_random_i8x32(); simde__m256i b = simde_test_x86_random_i8x32(); simde__m256i r = simde_mm256_maskz_xxx_epi8(k, a, b); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t a[16]; const int16_t b[16]; const int16_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi16(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi16(test_vec[i].b); simde__m256i r = simde_mm256_xxx_epi16(a, b); simde_test_x86_assert_equal_i16x16(r, simde_x_mm256_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i a = simde_test_x86_random_i16x16(); simde__m256i b = simde_test_x86_random_i16x16(); simde__m256i r = simde_mm256_xxx_epi16(a, b); simde_test_x86_write_i16x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_mask_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t src[16]; const simde__mmask16 k; const int16_t a[16]; const int16_t b[16]; const int16_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i src = simde_x_mm256_loadu_epi16(test_vec[i].src); simde__m256i a = simde_x_mm256_loadu_epi16(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi16(test_vec[i].b); simde__m256i r = simde_mm256_mask_xxx_epi16(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x16(r, simde_x_mm256_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i src = simde_test_x86_random_i16x16(); simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m256i a = simde_test_x86_random_i16x16(); simde__m256i b = simde_test_x86_random_i16x16(); simde__m256i r = simde_mm256_mask_xxx_epi16(src, k, a, b); simde_test_x86_write_i16x16(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_maskz_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask16 k; const int16_t a[16]; const int16_t b[16]; const int16_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi16(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi16(test_vec[i].b); simde__m256i r = simde_mm256_maskz_xxx_epi16(test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x16(r, simde_x_mm256_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m256i a = simde_test_x86_random_i16x16(); simde__m256i b = simde_test_x86_random_i16x16(); simde__m256i r = simde_mm256_maskz_xxx_epi16(k, a, b); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t a[8]; const int32_t b[8]; const int32_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi32(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi32(test_vec[i].b); simde__m256i r = simde_mm256_xxx_epi32(a, b); simde_test_x86_assert_equal_i32x8(r, simde_x_mm256_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i a = simde_test_x86_random_i32x8(); simde__m256i b = simde_test_x86_random_i32x8(); simde__m256i r = simde_mm256_xxx_epi32(a, b); simde_test_x86_write_i32x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_mask_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t src[8]; const simde__mmask8 k; const int32_t a[8]; const int32_t b[8]; const int32_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i src = simde_x_mm256_loadu_epi32(test_vec[i].src); simde__mmask8 k = test_vec[i].k; simde__m256i a = simde_x_mm256_loadu_epi32(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi32(test_vec[i].b); simde__m256i r = simde_mm256_mask_xxx_epi32(src, k, a, b); simde_test_x86_assert_equal_i32x8(r, simde_x_mm256_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i src = simde_test_x86_random_i32x8(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m256i a = simde_test_x86_random_i32x8(); simde__m256i b = simde_test_x86_random_i32x8(); simde__m256i r = simde_mm256_mask_xxx_epi32(src, k, a); simde_test_x86_write_i32x8(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_maskz_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const int32_t a[8]; const int32_t b[8]; const int32_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__mmask8 k = test_vec[i].k; simde__m256i a = simde_x_mm256_loadu_epi32(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi32(test_vec[i].b); simde__m256i r = simde_mm256_maskz_xxx_epi32(k, a, b); simde_test_x86_assert_equal_i32x8(r, simde_x_mm256_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m256i a = simde_test_x86_random_i32x8(); simde__m256i b = simde_test_x86_random_i32x8(); simde__m256i r = simde_mm256_maskz_xxx_epi32(k, a); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm256_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t a[4]; const int64_t b[4]; const int64_t r[4]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m256i a = simde_x_mm256_loadu_epi64(test_vec[i].a); simde__m256i b = simde_x_mm256_loadu_epi64(test_vec[i].b); simde__m256i r = simde_mm256_xxx_epi64(a, b); simde_test_x86_assert_equal_i64x4(r, simde_x_mm256_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m256i a = simde_test_x86_random_i64x4(); simde__m256i b = simde_test_x86_random_i64x4(); simde__m256i r = simde_mm256_xxx_epi64(a, b); simde_test_x86_write_i64x4(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x4(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x4(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float32 a[16]; const simde_float32 b[16]; const simde_float32 r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512 a = simde_mm512_loadu_ps(test_vec[i].a); simde__m512 b = simde_mm512_loadu_ps(test_vec[i].b); simde__m512 r = simde_mm512_xxx_ps(a, b); simde_test_x86_assert_equal_f32x16(r, simde_mm512_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512 a = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 b = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 r = simde_mm512_xxx_ps(a, b); simde_test_x86_write_f32x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float32 src[16]; const simde__mmask8 k; const simde_float32 a[16]; const simde_float32 b[16]; const simde_float32 r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512 src = simde_mm512_loadu_ps(test_vec[i].src); simde__m512 a = simde_mm512_loadu_ps(test_vec[i].a); simde__m512 b = simde_mm512_loadu_ps(test_vec[i].b); simde__m512 r = simde_mm512_mask_xxx_ps(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_f32x16(r, simde_mm512_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512 src = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512 a = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 b = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 r = simde_mm512_mask_xxx_ps(src, k, a, b); simde_test_x86_write_f32x16(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_ps (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask16 k; const simde_float32 a[16]; const simde_float32 b[16]; const simde_float32 r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512 a = simde_mm512_loadu_ps(test_vec[i].a); simde__m512 b = simde_mm512_loadu_ps(test_vec[i].b); simde__m512 r = simde_mm512_maskz_xxx_ps(test_vec[i].k, a, b); simde_test_x86_assert_equal_f32x16(r, simde_mm512_loadu_ps(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m512 a = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 b = simde_test_x86_random_f32x16(SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde__m512 r = simde_mm512_maskz_xxx_ps(k, a, b); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float64 a[8]; const simde_float64 b[8]; const simde_float64 r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512d a = simde_mm512_loadu_pd(test_vec[i].a); simde__m512d b = simde_mm512_loadu_pd(test_vec[i].b); simde__m512d r = simde_mm512_xxx_pd(a, b); simde_test_x86_assert_equal_f64x8(r, simde_mm512_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512d a = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d b = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d r = simde_mm512_xxx_pd(a, b); simde_test_x86_write_f64x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde_float64 src[8]; const simde__mmask8 k; const simde_float64 a[8]; const simde_float64 b[8]; const simde_float64 r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512d src = simde_mm512_loadu_pd(test_vec[i].src); simde__m512d a = simde_mm512_loadu_pd(test_vec[i].a); simde__m512d b = simde_mm512_loadu_pd(test_vec[i].b); simde__m512d r = simde_mm512_mask_xxx_pd(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_f64x8(r, simde_mm512_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512d src = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512d a = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d b = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d r = simde_mm512_mask_xxx_pd(src, k, a, b); simde_test_x86_write_f64x8(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_pd (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const simde_float64 a[8]; const simde_float64 b[8]; const simde_float64 r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512d a = simde_mm512_loadu_pd(test_vec[i].a); simde__m512d b = simde_mm512_loadu_pd(test_vec[i].b); simde__m512d r = simde_mm512_maskz_xxx_pd(test_vec[i].k, a, b); simde_test_x86_assert_equal_f64x8(r, simde_mm512_loadu_pd(test_vec[i].r), 1); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512d a = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d b = simde_test_x86_random_f64x8(SIMDE_FLOAT64_C(-1000.0), SIMDE_FLOAT64_C(1000.0)); simde__m512d r = simde_mm512_maskz_xxx_pd(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_f64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t a[64]; const int8_t b[64]; const int8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epi8(a, b); simde_test_x86_assert_equal_i8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_i8x64(); simde__m512i b = simde_test_x86_random_i8x64(); simde__m512i r = simde_mm512_xxx_epi8(a, b); simde_test_x86_write_i8x64(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int8_t src[64]; const simde__mmask64 k; const int8_t a[64]; const int8_t b[64]; const int8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi8(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epi8(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_i8x64(); simde__mmask64 k = simde_test_x86_random_mmask64(); simde__m512i a = simde_test_x86_random_i8x64(); simde__m512i b = simde_test_x86_random_i8x64(); simde__m512i r = simde_mm512_mask_xxx_epi8(src, k, a, b); simde_test_x86_write_i8x64(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask64(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epi8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask64 k; const int8_t a[64]; const int8_t b[64]; const int8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epi8(test_vec[i].k, a, b); simde_test_x86_assert_equal_i8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask64 k = simde_test_x86_random_mmask64(); simde__m512i a = simde_test_x86_random_i8x64(); simde__m512i b = simde_test_x86_random_i8x64(); simde__m512i r = simde_mm512_maskz_xxx_epi8(k, a, b); simde_test_x86_write_mmask64(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i8x64(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t a[32]; const int16_t b[32]; const int16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epi16(a, b); simde_test_x86_assert_equal_i16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_i16x32(); simde__m512i b = simde_test_x86_random_i16x32(); simde__m512i r = simde_mm512_xxx_epi16(a, b); simde_test_x86_write_i16x32(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int16_t src[32]; const simde__mmask32 k; const int16_t a[32]; const int16_t b[32]; const int16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi16(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epi16(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_i16x32(); simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m512i a = simde_test_x86_random_i16x32(); simde__m512i b = simde_test_x86_random_i16x32(); simde__m512i r = simde_mm512_mask_xxx_epi16(src, k, a, b); simde_test_x86_write_i16x32(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epi16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask32 k; const int16_t a[32]; const int16_t b[32]; const int16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epi16(test_vec[i].k, a, b); simde_test_x86_assert_equal_i16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m512i a = simde_test_x86_random_i16x32(); simde__m512i b = simde_test_x86_random_i16x32(); simde__m512i r = simde_mm512_maskz_xxx_epi16(k, a, b); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i16x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t a[16]; const int32_t b[16]; const int32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epi32(a, b); simde_test_x86_assert_equal_i32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_i32x16(); simde__m512i b = simde_test_x86_random_i32x16(); simde__m512i r = simde_mm512_xxx_epi32(a, b); simde_test_x86_write_i32x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int32_t src[16]; const simde__mmask16 k; const int32_t a[16]; const int32_t b[16]; const int32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi32(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epi32(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_i32x16(); simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m512i a = simde_test_x86_random_i32x16(); simde__m512i b = simde_test_x86_random_i32x16(); simde__m512i r = simde_mm512_mask_xxx_epi32(src, k, a, b); simde_test_x86_write_i32x16(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epi32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask16 k; const int32_t a[16]; const int32_t b[16]; const int32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epi32(test_vec[i].k, a, b); simde_test_x86_assert_equal_i32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m512i a = simde_test_x86_random_i32x16(); simde__m512i b = simde_test_x86_random_i32x16(); simde__m512i r = simde_mm512_maskz_xxx_epi32(k, a, b); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t a[8]; const int64_t b[8]; const int64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epi64(a, b); simde_test_x86_assert_equal_i64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_i64x8(); simde__m512i b = simde_test_x86_random_i64x8(); simde__m512i r = simde_mm512_xxx_epi64(a, b); simde_test_x86_write_i64x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t src[8]; const simde__mmask8 k; const int64_t a[8]; const int64_t b[8]; const int64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi64(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epi64(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_i64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_i64x8(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512i a = simde_test_x86_random_i64x8(); simde__m512i b = simde_test_x86_random_i64x8(); simde__m512i r = simde_mm512_mask_xxx_epi64(src, k, a, b); simde_test_x86_write_i64x8(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epi64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const int64_t a[8]; const int64_t b[8]; const int64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epi64(test_vec[i].k, a, b); simde_test_x86_assert_equal_i64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512i a = simde_test_x86_random_i64x8(); simde__m512i b = simde_test_x86_random_i64x8(); simde__m512i r = simde_mm512_maskz_xxx_epi64(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_i64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epu8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint8_t a[64]; const uint8_t b[64]; const uint8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epu8(a, b); simde_test_x86_assert_equal_u8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_u8x64(); simde__m512i b = simde_test_x86_random_u8x64(); simde__m512i r = simde_mm512_xxx_epu8(a, b); simde_test_x86_write_u8x64(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epu8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint8_t src[64]; const simde__mmask64 k; const uint8_t a[64]; const uint8_t b[64]; const uint8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi8(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epu8(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_u8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_u8x64(); simde__mmask64 k = simde_test_x86_random_mmask64(); simde__m512i a = simde_test_x86_random_u8x64(); simde__m512i b = simde_test_x86_random_u8x64(); simde__m512i r = simde_mm512_mask_xxx_epu8(src, k, a, b); simde_test_x86_write_u8x64(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask64(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epu8 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask64 k; const uint8_t a[64]; const uint8_t b[64]; const uint8_t r[64]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi8(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi8(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epu8(test_vec[i].k, a, b); simde_test_x86_assert_equal_u8x64(r, simde_mm512_loadu_epi8(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask64 k = simde_test_x86_random_mmask64(); simde__m512i a = simde_test_x86_random_u8x64(); simde__m512i b = simde_test_x86_random_u8x64(); simde__m512i r = simde_mm512_maskz_xxx_epu8(k, a, b); simde_test_x86_write_mmask64(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u8x64(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u8x64(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epu16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint16_t a[32]; const uint16_t b[32]; const uint16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epu16(a, b); simde_test_x86_assert_equal_u16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_u16x32(); simde__m512i b = simde_test_x86_random_u16x32(); simde__m512i r = simde_mm512_xxx_epu16(a, b); simde_test_x86_write_u16x32(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epu16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint16_t src[32]; const simde__mmask32 k; const uint16_t a[32]; const uint16_t b[32]; const uint16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi16(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epu16(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_u16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_u16x32(); simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m512i a = simde_test_x86_random_u16x32(); simde__m512i b = simde_test_x86_random_u16x32(); simde__m512i r = simde_mm512_mask_xxx_epu16(src, k, a, b); simde_test_x86_write_u16x32(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epu16 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask32 k; const uint16_t a[32]; const uint16_t b[32]; const uint16_t r[32]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi16(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi16(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epu16(test_vec[i].k, a, b); simde_test_x86_assert_equal_u16x32(r, simde_mm512_loadu_epi16(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask32 k = simde_test_x86_random_mmask32(); simde__m512i a = simde_test_x86_random_u16x32(); simde__m512i b = simde_test_x86_random_u16x32(); simde__m512i r = simde_mm512_maskz_xxx_epu16(k, a, b); simde_test_x86_write_mmask32(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u16x32(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u16x32(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epu32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint32_t a[16]; const uint32_t b[16]; const uint32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epu32(a, b); simde_test_x86_assert_equal_u32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_u32x16(); simde__m512i b = simde_test_x86_random_u32x16(); simde__m512i r = simde_mm512_xxx_epu32(a, b); simde_test_x86_write_u32x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epu32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint32_t src[16]; const simde__mmask16 k; const uint32_t a[16]; const uint32_t b[16]; const uint32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi32(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epu32(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_u32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_u32x16(); simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m512i a = simde_test_x86_random_u32x16(); simde__m512i b = simde_test_x86_random_u32x16(); simde__m512i r = simde_mm512_mask_xxx_epu32(src, k, a, b); simde_test_x86_write_u32x16(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epu32 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask16 k; const uint32_t a[16]; const uint32_t b[16]; const uint32_t r[16]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi32(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi32(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epu32(test_vec[i].k, a, b); simde_test_x86_assert_equal_u32x16(r, simde_mm512_loadu_epi32(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask16 k = simde_test_x86_random_mmask16(); simde__m512i a = simde_test_x86_random_u32x16(); simde__m512i b = simde_test_x86_random_u32x16(); simde__m512i r = simde_mm512_maskz_xxx_epu32(k, a, b); simde_test_x86_write_mmask16(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u32x16(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u32x16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epu64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint64_t a[8]; const uint64_t b[8]; const uint64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_xxx_epu64(a, b); simde_test_x86_assert_equal_u64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i a = simde_test_x86_random_u64x8(); simde__m512i b = simde_test_x86_random_u64x8(); simde__m512i r = simde_mm512_xxx_epu64(a, b); simde_test_x86_write_u64x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_mask_xxx_epu64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const uint64_t src[8]; const simde__mmask8 k; const uint64_t a[8]; const uint64_t b[8]; const uint64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i src = simde_mm512_loadu_epi64(test_vec[i].src); simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_mask_xxx_epu64(src, test_vec[i].k, a, b); simde_test_x86_assert_equal_u64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__m512i src = simde_test_x86_random_u64x8(); simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512i a = simde_test_x86_random_u64x8(); simde__m512i b = simde_test_x86_random_u64x8(); simde__m512i r = simde_mm512_mask_xxx_epu64(src, k, a, b); simde_test_x86_write_u64x8(2, src, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_maskz_xxx_epu64 (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const simde__mmask8 k; const uint64_t a[8]; const uint64_t b[8]; const uint64_t r[8]; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__m512i r = simde_mm512_maskz_xxx_epu64(test_vec[i].k, a, b); simde_test_x86_assert_equal_u64x8(r, simde_mm512_loadu_epi64(test_vec[i].r)); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde__mmask8 k = simde_test_x86_random_mmask8(); simde__m512i a = simde_test_x86_random_u64x8(); simde__m512i b = simde_test_x86_random_u64x8(); simde__m512i r = simde_mm512_maskz_xxx_epu64(k, a, b); simde_test_x86_write_mmask8(2, k, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_u64x8(2, a, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_u64x8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_epi64_mask (SIMDE_MUNIT_TEST_ARGS) { #if 0 static const struct { const int64_t a[16]; const int64_t b[16]; const simde__mmask8 r; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512i a = simde_mm512_loadu_epi64(test_vec[i].a); simde__m512i b = simde_mm512_loadu_epi64(test_vec[i].b); simde__mmask8 r = simde_mm512_xxx_epi64_mask(a, b); simde_assert_equal_mmask8(r, test_vec[i].r); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { int64_t a_[8]; int64_t b_[8]; simde_test_codegen_random_memory(sizeof(a_), HEDLEY_REINTERPRET_CAST(uint8_t*, a_)); simde_test_codegen_random_memory(sizeof(b_), HEDLEY_REINTERPRET_CAST(uint8_t*, b_)); for (size_t j = 0 ; j < 8 ; j++) if (!(simde_test_codegen_random_i64() & 1)) a_[j] = b_[j]; simde__m512i a = simde_mm512_loadu_epi64(a_); simde__m512i b = simde_mm512_loadu_epi64(b_); simde__mmask16 r = simde_mm512_xxx_epi64_mask(a, b); simde_test_x86_write_i64x8(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_i64x8(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_mmask8(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif } static int test_simde_mm512_xxx_ps_mask (SIMDE_MUNIT_TEST_ARGS) { #if 1 static const struct { const simde_float32 a[16]; const simde_float32 b[16]; const simde__mmask16 r; } test_vec[] = { }; for (size_t i = 0 ; i < (sizeof(test_vec) / sizeof(test_vec[0])) ; i++) { simde__m512 a = simde_mm512_loadu_ps(test_vec[i].a); simde__m512 b = simde_mm512_loadu_ps(test_vec[i].b); simde__mmask16 r = simde_mm512_xxx_ps_mask(a, b); simde_assert_mmask16(r, ==, test_vec[i].r); } return 0; #else fputc('\n', stdout); for (int i = 0 ; i < 8 ; i++) { simde_float32 a_[16]; simde_float32 b_[16]; simde_test_codegen_random_vf32(16, a_, SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); simde_test_codegen_random_vf32(16, b_, SIMDE_FLOAT32_C(-1000.0), SIMDE_FLOAT32_C(1000.0)); for (size_t j = 0 ; j < 16 ; j++) if (!(simde_test_codegen_random_i32() & 1)) a_[j] = b_[j]; simde__m512 a = simde_mm512_loadu_ps(a_); simde__m512 b = simde_mm512_loadu_ps(b_); simde__mmask16 r = simde_mm512_xxx_ps_mask(a, b); simde_test_x86_write_f32x16(2, a, SIMDE_TEST_VEC_POS_FIRST); simde_test_x86_write_f32x16(2, b, SIMDE_TEST_VEC_POS_MIDDLE); simde_test_x86_write_mmask16(2, r, SIMDE_TEST_VEC_POS_LAST); } return 1; #endif }