Skip to content

Commit 79a4109

Browse files
eduardosmAmanieu
authored andcommitted
Remove unneeded transmutes
(or replace them with safe versions)
1 parent d06eda8 commit 79a4109

File tree

8 files changed

+237
-378
lines changed

8 files changed

+237
-378
lines changed

crates/core_arch/src/x86/avx512bitalg.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub unsafe fn _mm_mask_popcnt_epi8(src: __m128i, k: __mmask16, a: __m128i) -> __
311311
#[target_feature(enable = "avx512bitalg")]
312312
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
313313
pub unsafe fn _mm512_bitshuffle_epi64_mask(b: __m512i, c: __m512i) -> __mmask64 {
314-
transmute(bitshuffle_512(b.as_i8x64(), c.as_i8x64(), !0))
314+
bitshuffle_512(b.as_i8x64(), c.as_i8x64(), !0)
315315
}
316316

317317
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
@@ -326,7 +326,7 @@ pub unsafe fn _mm512_bitshuffle_epi64_mask(b: __m512i, c: __m512i) -> __mmask64
326326
#[target_feature(enable = "avx512bitalg")]
327327
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
328328
pub unsafe fn _mm512_mask_bitshuffle_epi64_mask(k: __mmask64, b: __m512i, c: __m512i) -> __mmask64 {
329-
transmute(bitshuffle_512(b.as_i8x64(), c.as_i8x64(), k))
329+
bitshuffle_512(b.as_i8x64(), c.as_i8x64(), k)
330330
}
331331

332332
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
@@ -338,7 +338,7 @@ pub unsafe fn _mm512_mask_bitshuffle_epi64_mask(k: __mmask64, b: __m512i, c: __m
338338
#[target_feature(enable = "avx512bitalg,avx512vl")]
339339
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
340340
pub unsafe fn _mm256_bitshuffle_epi64_mask(b: __m256i, c: __m256i) -> __mmask32 {
341-
transmute(bitshuffle_256(b.as_i8x32(), c.as_i8x32(), !0))
341+
bitshuffle_256(b.as_i8x32(), c.as_i8x32(), !0)
342342
}
343343

344344
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
@@ -353,7 +353,7 @@ pub unsafe fn _mm256_bitshuffle_epi64_mask(b: __m256i, c: __m256i) -> __mmask32
353353
#[target_feature(enable = "avx512bitalg,avx512vl")]
354354
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
355355
pub unsafe fn _mm256_mask_bitshuffle_epi64_mask(k: __mmask32, b: __m256i, c: __m256i) -> __mmask32 {
356-
transmute(bitshuffle_256(b.as_i8x32(), c.as_i8x32(), k))
356+
bitshuffle_256(b.as_i8x32(), c.as_i8x32(), k)
357357
}
358358

359359
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
@@ -365,7 +365,7 @@ pub unsafe fn _mm256_mask_bitshuffle_epi64_mask(k: __mmask32, b: __m256i, c: __m
365365
#[target_feature(enable = "avx512bitalg,avx512vl")]
366366
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
367367
pub unsafe fn _mm_bitshuffle_epi64_mask(b: __m128i, c: __m128i) -> __mmask16 {
368-
transmute(bitshuffle_128(b.as_i8x16(), c.as_i8x16(), !0))
368+
bitshuffle_128(b.as_i8x16(), c.as_i8x16(), !0)
369369
}
370370

371371
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
@@ -380,7 +380,7 @@ pub unsafe fn _mm_bitshuffle_epi64_mask(b: __m128i, c: __m128i) -> __mmask16 {
380380
#[target_feature(enable = "avx512bitalg,avx512vl")]
381381
#[cfg_attr(test, assert_instr(vpshufbitqmb))]
382382
pub unsafe fn _mm_mask_bitshuffle_epi64_mask(k: __mmask16, b: __m128i, c: __m128i) -> __mmask16 {
383-
transmute(bitshuffle_128(b.as_i8x16(), c.as_i8x16(), k))
383+
bitshuffle_128(b.as_i8x16(), c.as_i8x16(), k)
384384
}
385385

386386
#[cfg(test)]

0 commit comments

Comments
 (0)