@@ -6,7 +6,7 @@ use rustc_target::callconv::FnAbi;
66
77use super :: {
88 ShiftOp , horizontal_bin_op, mask_load, mask_store, mpsadbw, packssdw, packsswb, packusdw,
9- packuswb, pmaddbw, pmulhrsw, psadbw, psign, shift_simd_by_scalar, shift_simd_by_simd,
9+ packuswb, permute , pmaddbw, pmulhrsw, psadbw, psign, shift_simd_by_scalar, shift_simd_by_simd,
1010} ;
1111use crate :: * ;
1212
@@ -189,28 +189,12 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
189189
190190 packusdw ( this, left, right, dest) ?;
191191 }
192- // Used to implement the _mm256_permutevar8x32_epi32 and
193- // _mm256_permutevar8x32_ps function.
194- // Shuffles `left` using the three low bits of each element of `right`
195- // as indices.
192+ // Used to implement _mm256_permutevar8x32_epi32 and _mm256_permutevar8x32_ps.
196193 "permd" | "permps" => {
197194 let [ left, right] =
198195 this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
199196
200- let ( left, left_len) = this. project_to_simd ( left) ?;
201- let ( right, right_len) = this. project_to_simd ( right) ?;
202- let ( dest, dest_len) = this. project_to_simd ( dest) ?;
203-
204- assert_eq ! ( dest_len, left_len) ;
205- assert_eq ! ( dest_len, right_len) ;
206-
207- for i in 0 ..dest_len {
208- let dest = this. project_index ( & dest, i) ?;
209- let right = this. read_scalar ( & this. project_index ( & right, i) ?) ?. to_u32 ( ) ?;
210- let left = this. project_index ( & left, ( right & 0b111 ) . into ( ) ) ?;
211-
212- this. copy_op ( & left, & dest) ?;
213- }
197+ permute ( this, left, right, dest) ?;
214198 }
215199 // Used to implement the _mm256_sad_epu8 function.
216200 "psad.bw" => {
0 commit comments