Skip to content

Commit c840ddc

Browse files
committed
Fix expected intructions for AVX512 _kadd_mask32 and _kadd_mask64 after removing dedup guard code.
1 parent 7940c0e commit c840ddc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/core_arch/src/x86/avx512bw.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8216,8 +8216,9 @@ pub unsafe fn _mm_movm_epi8(k: __mmask16) -> __m128i {
82168216
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kadd_mask32&expand=3207)
82178217
#[inline]
82188218
#[target_feature(enable = "avx512bw")]
8219-
#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kaddd
8220-
//llvm.x86.avx512.kadd.d
8219+
#[cfg_attr(all(test, target_arch = "x86"), assert_instr(add))]
8220+
#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(lea))] // generate normal lea/add code instead of kaddd
8221+
//llvm.x86.avx512.kadd.d
82218222
pub unsafe fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
82228223
transmute(a + b)
82238224
}
@@ -8227,7 +8228,9 @@ pub unsafe fn _kadd_mask32(a: __mmask32, b: __mmask32) -> __mmask32 {
82278228
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_kadd_mask64&expand=3208)
82288229
#[inline]
82298230
#[target_feature(enable = "avx512bw")]
8230-
#[cfg_attr(test, assert_instr(mov))] // generate normal and code instead of kaddq
8231+
#[cfg_attr(all(test, target_arch = "x86"), assert_instr(add))]
8232+
#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(lea))] // generate normal lea/add code instead of kaddd
8233+
//llvm.x86.avx512.kadd.d
82318234
pub unsafe fn _kadd_mask64(a: __mmask64, b: __mmask64) -> __mmask64 {
82328235
transmute(a + b)
82338236
}

0 commit comments

Comments
 (0)