@@ -25327,7 +25327,7 @@ pub unsafe fn _mm512_cvtsi512_si32(a: __m512i) -> i32 {
25327
25327
#[inline]
25328
25328
#[target_feature(enable = "avx512f")]
25329
25329
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
25330
- #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovd ))]
25330
+ #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovss ))]
25331
25331
pub unsafe fn _mm512_cvtss_f32(a: __m512) -> f32 {
25332
25332
simd_extract!(a, 0)
25333
25333
}
@@ -25338,7 +25338,7 @@ pub unsafe fn _mm512_cvtss_f32(a: __m512) -> f32 {
25338
25338
#[inline]
25339
25339
#[target_feature(enable = "avx512f")]
25340
25340
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
25341
- #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovd ))]
25341
+ #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovsd ))]
25342
25342
pub unsafe fn _mm512_cvtsd_f64(a: __m512d) -> f64 {
25343
25343
simd_extract!(a, 0)
25344
25344
}
@@ -27276,6 +27276,26 @@ pub unsafe fn _mm512_andnot_si512(a: __m512i, b: __m512i) -> __m512i {
27276
27276
_mm512_and_epi64(_mm512_xor_epi64(a, _mm512_set1_epi64(u64::MAX as i64)), b)
27277
27277
}
27278
27278
27279
+ /// Convert 16-bit mask a into an integer value, and store the result in dst.
27280
+ ///
27281
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_cvtmask16_u32)
27282
+ #[inline]
27283
+ #[target_feature(enable = "avx512f")]
27284
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27285
+ pub unsafe fn _cvtmask16_u32(a: __mmask16) -> u32 {
27286
+ a as u32
27287
+ }
27288
+
27289
+ /// Convert 32-bit integer value a to an 16-bit mask and store the result in dst.
27290
+ ///
27291
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_cvtu32_mask16)
27292
+ #[inline]
27293
+ #[target_feature(enable = "avx512f")]
27294
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27295
+ pub unsafe fn _cvtu32_mask16(a: u32) -> __mmask16 {
27296
+ a as __mmask16
27297
+ }
27298
+
27279
27299
/// Compute the bitwise AND of 16-bit masks a and b, and store the result in k.
27280
27300
///
27281
27301
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=kand_mask16&expand=3212)
@@ -27406,6 +27426,83 @@ pub unsafe fn _mm512_kxnor(a: __mmask16, b: __mmask16) -> __mmask16 {
27406
27426
_mm512_knot(_mm512_kxor(a, b))
27407
27427
}
27408
27428
27429
+ /// Compute the bitwise OR of 16-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
27430
+ /// store 0 in dst. If the result is all ones, store 1 in all_ones, otherwise store 0 in all_ones.
27431
+ ///
27432
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortest_mask16_u8)
27433
+ #[inline]
27434
+ #[target_feature(enable = "avx512f")]
27435
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27436
+ pub unsafe fn _kortest_mask16_u8(a: __mmask16, b: __mmask16, all_ones: *mut u8) -> u8 {
27437
+ let tmp = _kor_mask16(a, b);
27438
+ *all_ones = (tmp == 0xff) as u8;
27439
+ (tmp == 0) as u8
27440
+ }
27441
+
27442
+ /// Compute the bitwise OR of 16-bit masks a and b. If the result is all ones, store 1 in dst, otherwise
27443
+ /// store 0 in dst.
27444
+ ///
27445
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestc_mask16_u8)
27446
+ #[inline]
27447
+ #[target_feature(enable = "avx512f")]
27448
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27449
+ pub unsafe fn _kortestc_mask16_u8(a: __mmask16, b: __mmask16) -> u8 {
27450
+ (_kor_mask16(a, b) == 0xff) as u8
27451
+ }
27452
+
27453
+ /// Compute the bitwise OR of 16-bit masks a and b. If the result is all zeros, store 1 in dst, otherwise
27454
+ /// store 0 in dst.
27455
+ ///
27456
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kortestz_mask16_u8)
27457
+ #[inline]
27458
+ #[target_feature(enable = "avx512f")]
27459
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27460
+ pub unsafe fn _kortestz_mask16_u8(a: __mmask16, b: __mmask16) -> u8 {
27461
+ (_kor_mask16(a, b) == 0) as u8
27462
+ }
27463
+
27464
+ /// Shift 16-bit mask a left by count bits while shifting in zeros, and store the result in dst.
27465
+ ///
27466
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftli_mask16)
27467
+ #[inline]
27468
+ #[target_feature(enable = "avx512f")]
27469
+ #[rustc_legacy_const_generics(1)]
27470
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27471
+ pub unsafe fn _kshiftli_mask16<const COUNT: u32>(a: __mmask16) -> __mmask16 {
27472
+ a << COUNT
27473
+ }
27474
+
27475
+ /// Shift 16-bit mask a right by count bits while shifting in zeros, and store the result in dst.
27476
+ ///
27477
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_kshiftri_mask16)
27478
+ #[inline]
27479
+ #[target_feature(enable = "avx512f")]
27480
+ #[rustc_legacy_const_generics(1)]
27481
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27482
+ pub unsafe fn _kshiftri_mask16<const COUNT: u32>(a: __mmask16) -> __mmask16 {
27483
+ a >> COUNT
27484
+ }
27485
+
27486
+ /// Load 16-bit mask from memory
27487
+ ///
27488
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_load_mask16)
27489
+ #[inline]
27490
+ #[target_feature(enable = "avx512f")]
27491
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27492
+ pub unsafe fn _load_mask16(mem_addr: *const __mmask16) -> __mmask16 {
27493
+ *mem_addr
27494
+ }
27495
+
27496
+ /// Store 16-bit mask to memory
27497
+ ///
27498
+ /// [Intel's Documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_store_mask16)
27499
+ #[inline]
27500
+ #[target_feature(enable = "avx512f")]
27501
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27502
+ pub unsafe fn _store_mask16(mem_addr: *mut __mmask16, a: __mmask16) {
27503
+ *mem_addr = a;
27504
+ }
27505
+
27409
27506
/// Copy 16-bit mask a to k.
27410
27507
///
27411
27508
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=mm512_kmov&expand=3228)
@@ -27465,6 +27562,22 @@ pub unsafe fn _mm512_kortestc(a: __mmask16, b: __mmask16) -> i32 {
27465
27562
}
27466
27563
}
27467
27564
27565
+ /// Performs bitwise OR between k1 and k2, storing the result in dst. ZF flag is set if dst is 0.
27566
+ ///
27567
+ /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=512_kortestz)
27568
+ #[inline]
27569
+ #[target_feature(enable = "avx512f")]
27570
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
27571
+ #[cfg_attr(test, assert_instr(xor))] // generate normal and code instead of kortestw
27572
+ pub unsafe fn _mm512_kortestz(a: __mmask16, b: __mmask16) -> i32 {
27573
+ let r = a | b;
27574
+ if r == 0 {
27575
+ 1
27576
+ } else {
27577
+ 0
27578
+ }
27579
+ }
27580
+
27468
27581
/// Compute the bitwise AND of packed 32-bit integers in a and b, producing intermediate 32-bit values, and set the corresponding bit in result mask k if the intermediate value is non-zero.
27469
27582
///
27470
27583
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_test_epi32_mask&expand=5890)
@@ -54081,6 +54194,22 @@ mod tests {
54081
54194
assert_eq_m128i(r, e);
54082
54195
}
54083
54196
54197
+ #[simd_test(enable = "avx512f")]
54198
+ unsafe fn test_cvtmask16_u32() {
54199
+ let a: __mmask16 = 0b11001100_00110011;
54200
+ let r = _cvtmask16_u32(a);
54201
+ let e: u32 = 0b11001100_00110011;
54202
+ assert_eq!(r, e);
54203
+ }
54204
+
54205
+ #[simd_test(enable = "avx512f")]
54206
+ unsafe fn test_cvtu32_mask16() {
54207
+ let a: u32 = 0b11001100_00110011;
54208
+ let r = _cvtu32_mask16(a);
54209
+ let e: __mmask16 = 0b11001100_00110011;
54210
+ assert_eq!(r, e);
54211
+ }
54212
+
54084
54213
#[simd_test(enable = "avx512f")]
54085
54214
unsafe fn test_mm512_kand() {
54086
54215
let a: u16 = 0b11001100_00110011;
@@ -54187,6 +54316,65 @@ mod tests {
54187
54316
assert_eq!(r, e);
54188
54317
}
54189
54318
54319
+ #[simd_test(enable = "avx512dq")]
54320
+ unsafe fn test_kortest_mask16_u8() {
54321
+ let a: __mmask16 = 0b0110100101101001;
54322
+ let b: __mmask16 = 0b1011011010110110;
54323
+ let mut all_ones: u8 = 0;
54324
+ let r = _kortest_mask16_u8(a, b, &mut all_ones);
54325
+ assert_eq!(r, 0);
54326
+ assert_eq!(all_ones, 1);
54327
+ }
54328
+
54329
+ #[simd_test(enable = "avx512dq")]
54330
+ unsafe fn test_kortestc_mask16_u8() {
54331
+ let a: __mmask16 = 0b0110100101101001;
54332
+ let b: __mmask16 = 0b1011011010110110;
54333
+ let r = _kortestc_mask16_u8(a, b);
54334
+ assert_eq!(r, 1);
54335
+ }
54336
+
54337
+ #[simd_test(enable = "avx512dq")]
54338
+ unsafe fn test_kortestz_mask16_u8() {
54339
+ let a: __mmask16 = 0b0110100101101001;
54340
+ let b: __mmask16 = 0b1011011010110110;
54341
+ let r = _kortestz_mask16_u8(a, b);
54342
+ assert_eq!(r, 0);
54343
+ }
54344
+
54345
+ #[simd_test(enable = "avx512dq")]
54346
+ unsafe fn test_kshiftli_mask16() {
54347
+ let a: __mmask16 = 0b1001011011000011;
54348
+ let r = _kshiftli_mask16::<3>(a);
54349
+ let e: __mmask16 = 0b1011011000011000;
54350
+ assert_eq!(r, e);
54351
+ }
54352
+
54353
+ #[simd_test(enable = "avx512dq")]
54354
+ unsafe fn test_kshiftri_mask16() {
54355
+ let a: __mmask16 = 0b0110100100111100;
54356
+ let r = _kshiftri_mask16::<3>(a);
54357
+ let e: __mmask16 = 0b0000110100100111;
54358
+ assert_eq!(r, e);
54359
+ }
54360
+
54361
+ #[simd_test(enable = "avx512f")]
54362
+ unsafe fn test_load_mask16() {
54363
+ let a: __mmask16 = 0b1001011011000011;
54364
+ let r = _load_mask16(&a);
54365
+ let e: __mmask16 = 0b1001011011000011;
54366
+ assert_eq!(r, e);
54367
+ }
54368
+
54369
+ #[simd_test(enable = "avx512f")]
54370
+ unsafe fn test_store_mask16() {
54371
+ let a: __mmask16 = 0b0110100100111100;
54372
+ let mut r = 0;
54373
+ _store_mask16(&mut r, a);
54374
+ let e: __mmask16 = 0b0110100100111100;
54375
+ assert_eq!(r, e);
54376
+ }
54377
+
54190
54378
#[simd_test(enable = "avx512f")]
54191
54379
unsafe fn test_mm512_kmov() {
54192
54380
let a: u16 = 0b11001100_00110011;
@@ -54231,6 +54419,16 @@ mod tests {
54231
54419
assert_eq!(r, 1);
54232
54420
}
54233
54421
54422
+ #[simd_test(enable = "avx512f")]
54423
+ unsafe fn test_mm512_kortestz() {
54424
+ let a: u16 = 0b11001100_00110011;
54425
+ let b: u16 = 0b00101110_00001011;
54426
+ let r = _mm512_kortestz(a, b);
54427
+ assert_eq!(r, 0);
54428
+ let r = _mm512_kortestz(0, 0);
54429
+ assert_eq!(r, 1);
54430
+ }
54431
+
54234
54432
#[simd_test(enable = "avx512f")]
54235
54433
unsafe fn test_mm512_test_epi32_mask() {
54236
54434
let a = _mm512_set1_epi32(1 << 0);
0 commit comments