Skip to content

Commit d997c30

Browse files
committed
remove miri _mm256_permute2f128 fallback implementation
it is no longer used (and was also incorrect)
1 parent b57d858 commit d997c30

File tree

1 file changed

+0
-44
lines changed
  • src/tools/miri/src/shims/x86

1 file changed

+0
-44
lines changed

src/tools/miri/src/shims/x86/avx.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -217,50 +217,6 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
217217
)?;
218218
}
219219
}
220-
// Used to implement the _mm256_permute2f128_ps, _mm256_permute2f128_pd and
221-
// _mm256_permute2f128_si256 functions. Regardless of the suffix in the name
222-
// thay all can be considered to operate on vectors of 128-bit elements.
223-
// For each 128-bit element of `dest`, copies one from `left`, `right` or
224-
// zero, according to `imm`.
225-
"vperm2f128.ps.256" | "vperm2f128.pd.256" | "vperm2f128.si.256" => {
226-
let [left, right, imm] =
227-
this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;
228-
229-
assert_eq!(dest.layout, left.layout);
230-
assert_eq!(dest.layout, right.layout);
231-
assert_eq!(dest.layout.size.bits(), 256);
232-
233-
// Transmute to `[u128; 2]` to process each 128-bit chunk independently.
234-
let u128x2_layout =
235-
this.layout_of(Ty::new_array(this.tcx.tcx, this.tcx.types.u128, 2))?;
236-
let left = left.transmute(u128x2_layout, this)?;
237-
let right = right.transmute(u128x2_layout, this)?;
238-
let dest = dest.transmute(u128x2_layout, this)?;
239-
240-
let imm = this.read_scalar(imm)?.to_u8()?;
241-
242-
for i in 0..2 {
243-
let dest = this.project_index(&dest, i)?;
244-
245-
let imm = match i {
246-
0 => imm & 0xF,
247-
1 => imm >> 4,
248-
_ => unreachable!(),
249-
};
250-
if imm & 0b100 != 0 {
251-
this.write_scalar(Scalar::from_u128(0), &dest)?;
252-
} else {
253-
let src = match imm {
254-
0b00 => this.project_index(&left, 0)?,
255-
0b01 => this.project_index(&left, 1)?,
256-
0b10 => this.project_index(&right, 0)?,
257-
0b11 => this.project_index(&right, 1)?,
258-
_ => unreachable!(),
259-
};
260-
this.copy_op(&src, &dest)?;
261-
}
262-
}
263-
}
264220
// Used to implement the _mm_maskload_ps, _mm_maskload_pd, _mm256_maskload_ps
265221
// and _mm256_maskload_pd functions.
266222
// For the element `i`, if the high bit of the `i`-th element of `mask`

0 commit comments

Comments
 (0)