Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
56d04f0
Implement `simd_fma` and `simd_relaxed_fma` in const-eval
sayantn Oct 9, 2025
382e850
Merge ref '73e6c9ebd912' from rust-lang/rust
Kobzol Nov 2, 2025
5f13ef8
Merge pull request #1950 from Kobzol/pull-nov-2025
folkertdev Nov 2, 2025
1cfc1c7
remove `unsafe` from `_mm_pause` uses
folkertdev Nov 2, 2025
abd2b52
fix `_mm256_permute2f128` miri tests
folkertdev Nov 2, 2025
38ff9f3
remove miri `_mm256_permute2f128` fallback implementation
folkertdev Nov 2, 2025
352bb6c
Rollup merge of #148232 - cuviper:ci-llvm-21, r=Mark-Simulacrum
Zalathar Nov 3, 2025
9c9b66c
Rollup merge of #148240 - InvalidPathException:master, r=WaffleLapkin
Zalathar Nov 3, 2025
34eca5f
Rollup merge of #148247 - bjorn3:minor_symbol_export_cleanup, r=Waffl…
Zalathar Nov 3, 2025
8577c20
Rollup merge of #148370 - estebank:outer-param, r=JonathanBrouwer
Zalathar Nov 3, 2025
3affe26
Auto merge of #148420 - Zalathar:rollup-1rrbzk7, r=Zalathar
bors Nov 3, 2025
6839451
Rollup merge of #146260 - Qelxiros:146179-sliceindex-wrappers, r=jhpratt
matthiaskrgr Nov 3, 2025
b1ea577
Rollup merge of #148394 - jieyouxu:remark-typeid-no-layout-guarantees…
matthiaskrgr Nov 3, 2025
7bb267f
Rollup merge of #148402 - folkertdev:stdarch-sync-nov-2025, r=sayantn
matthiaskrgr Nov 3, 2025
3056bf7
Auto merge of #148425 - matthiaskrgr:rollup-pwibmxt, r=matthiaskrgr
bors Nov 3, 2025
2c449a4
Add Miri tests for f16/f128 SIMD operations
sayantn Oct 10, 2025
18669dc
Auto merge of #147728 - Enselic:gdbt-check-typo, r=Zalathar
bors Nov 3, 2025
8ca93f7
Rollup merge of #135099 - Shunpoco:116971-mir-opt-copy-prop, r=davidtwco
GuillaumeGomez Nov 3, 2025
8313e9b
Rollup merge of #145903 - Kivooeo:c-style-pointer, r=davidtwco
GuillaumeGomez Nov 3, 2025
374cc5e
Rollup merge of #147520 - sayantn:simd-const-eval, r=RalfJung
GuillaumeGomez Nov 3, 2025
0fa9ba4
Rollup merge of #148068 - tmiasko:doctest-target-modifiers, r=Guillau…
GuillaumeGomez Nov 3, 2025
1850781
Rollup merge of #148099 - Zalathar:debuggers, r=jieyouxu
GuillaumeGomez Nov 3, 2025
2ed3bdb
Rollup merge of #148268 - notriddle:emit-scraped-examples, r=Guillaum…
GuillaumeGomez Nov 3, 2025
ec78522
Rollup merge of #148306 - zetanumbers:expn_id_decode, r=nnethercote
GuillaumeGomez Nov 3, 2025
6712800
Rollup merge of #148378 - ilai-deutel:update_hook-doc, r=joboet
GuillaumeGomez Nov 3, 2025
a2f0023
Auto merge of #148446 - GuillaumeGomez:rollup-lxwlqol, r=GuillaumeGomez
bors Nov 3, 2025
0498b26
Auto merge of #148350 - scottmcm:slice-range-attributes, r=JonathanBr…
bors Nov 3, 2025
f20407d
Prepare for merging from rust-lang/rust
Nov 4, 2025
cc9c7ad
Merge ref '5f9dd05862d2' from rust-lang/rust
Nov 4, 2025
c38128b
wasi is too strange of a target, remove it for now
RalfJung Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ degree documented below):
- `solaris` / `illumos`: maintained by @devnexen. Supports the entire test suite.
- `freebsd`: maintained by @YohDeadfall and @LorrensP-2158466. Supports the entire test suite.
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
- `wasi`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works.
- For targets on other operating systems, Miri might fail before even reaching the `main` function.

However, even for targets that we do support, the degree of support for accessing platform APIs
Expand Down
1 change: 0 additions & 1 deletion ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ case $HOST_TARGET in
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC hello wasm
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
;;
Expand Down
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c5dabe8cf798123087d094f06417f5a767ca73e8
5f9dd05862d2e4bceb3be1031b6c936e35671501
58 changes: 0 additions & 58 deletions src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use rand::Rng;
use rustc_apfloat::Float;
use rustc_middle::ty;
use rustc_middle::ty::FloatTy;

Expand Down Expand Up @@ -83,62 +81,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
this.write_scalar(val, &dest)?;
}
}
"fma" | "relaxed_fma" => {
let [a, b, c] = check_intrinsic_arg_count(args)?;
let (a, a_len) = this.project_to_simd(a)?;
let (b, b_len) = this.project_to_simd(b)?;
let (c, c_len) = this.project_to_simd(c)?;
let (dest, dest_len) = this.project_to_simd(dest)?;

assert_eq!(dest_len, a_len);
assert_eq!(dest_len, b_len);
assert_eq!(dest_len, c_len);

for i in 0..dest_len {
let a = this.read_scalar(&this.project_index(&a, i)?)?;
let b = this.read_scalar(&this.project_index(&b, i)?)?;
let c = this.read_scalar(&this.project_index(&c, i)?)?;
let dest = this.project_index(&dest, i)?;

let fuse: bool = intrinsic_name == "fma"
|| (this.machine.float_nondet && this.machine.rng.get_mut().random());

// Works for f32 and f64.
// FIXME: using host floats to work around https://github.com/rust-lang/miri/issues/2468.
let ty::Float(float_ty) = dest.layout.ty.kind() else {
span_bug!(this.cur_span(), "{} operand is not a float", intrinsic_name)
};
let val = match float_ty {
FloatTy::F16 => unimplemented!("f16_f128"),
FloatTy::F32 => {
let a = a.to_f32()?;
let b = b.to_f32()?;
let c = c.to_f32()?;
let res = if fuse {
a.mul_add(b, c).value
} else {
((a * b).value + c).value
};
let res = this.adjust_nan(res, &[a, b, c]);
Scalar::from(res)
}
FloatTy::F64 => {
let a = a.to_f64()?;
let b = b.to_f64()?;
let c = c.to_f64()?;
let res = if fuse {
a.mul_add(b, c).value
} else {
((a * b).value + c).value
};
let res = this.adjust_nan(res, &[a, b, c]);
Scalar::from(res)
}
FloatTy::F128 => unimplemented!("f16_f128"),
};
this.write_scalar(val, &dest)?;
}
}
"expose_provenance" => {
let [op] = check_intrinsic_arg_count(args)?;
let (op, op_len) = this.project_to_simd(op)?;
Expand Down
4 changes: 2 additions & 2 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,8 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
}

#[inline(always)]
fn float_fuse_mul_add(ecx: &mut InterpCx<'tcx, Self>) -> bool {
ecx.machine.float_nondet && ecx.machine.rng.get_mut().random()
fn float_fuse_mul_add(ecx: &InterpCx<'tcx, Self>) -> bool {
ecx.machine.float_nondet && ecx.machine.rng.borrow_mut().random()
}

#[inline(always)]
Expand Down
2 changes: 1 addition & 1 deletion src/shims/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'tcx> EnvVars<'tcx> {
} else if ecx.tcx.sess.target.os == "windows" {
EnvVars::Windows(WindowsEnvVars::new(ecx, env_vars)?)
} else {
// Used e.g. for wasi
// For "none" targets (i.e., without an OS).
EnvVars::Uninit
};
ecx.machine.env_vars = env_vars;
Expand Down
5 changes: 0 additions & 5 deletions src/shims/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let this = self.eval_context_ref();
match this.tcx.sess.target.os.as_ref() {
os if this.target_os_is_unix() => shims::unix::foreign_items::is_dyn_sym(name, os),
"wasi" => shims::wasi::foreign_items::is_dyn_sym(name),
"windows" => shims::windows::foreign_items::is_dyn_sym(name),
_ => false,
}
Expand Down Expand Up @@ -846,10 +845,6 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
shims::unix::foreign_items::EvalContextExt::emulate_foreign_item_inner(
this, link_name, abi, args, dest,
),
"wasi" =>
shims::wasi::foreign_items::EvalContextExt::emulate_foreign_item_inner(
this, link_name, abi, args, dest,
),
"windows" =>
shims::windows::foreign_items::EvalContextExt::emulate_foreign_item_inner(
this, link_name, abi, args, dest,
Expand Down
1 change: 0 additions & 1 deletion src/shims/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ mod math;
#[cfg(all(unix, feature = "native-lib"))]
mod native_lib;
mod unix;
mod wasi;
mod windows;
mod x86;

Expand Down
1 change: 0 additions & 1 deletion src/shims/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ impl<'tcx> TlsDtorsState<'tcx> {
}
_ => {
// No TLS dtor support.
// FIXME: should we do something on wasi?
break 'new_state Done;
}
}
Expand Down
110 changes: 0 additions & 110 deletions src/shims/wasi/foreign_items.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/shims/wasi/mod.rs

This file was deleted.

44 changes: 0 additions & 44 deletions src/shims/x86/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,50 +217,6 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
)?;
}
}
// Used to implement the _mm256_permute2f128_ps, _mm256_permute2f128_pd and
// _mm256_permute2f128_si256 functions. Regardless of the suffix in the name
// thay all can be considered to operate on vectors of 128-bit elements.
// For each 128-bit element of `dest`, copies one from `left`, `right` or
// zero, according to `imm`.
"vperm2f128.ps.256" | "vperm2f128.pd.256" | "vperm2f128.si.256" => {
let [left, right, imm] =
this.check_shim_sig_lenient(abi, CanonAbi::C, link_name, args)?;

assert_eq!(dest.layout, left.layout);
assert_eq!(dest.layout, right.layout);
assert_eq!(dest.layout.size.bits(), 256);

// Transmute to `[u128; 2]` to process each 128-bit chunk independently.
let u128x2_layout =
this.layout_of(Ty::new_array(this.tcx.tcx, this.tcx.types.u128, 2))?;
let left = left.transmute(u128x2_layout, this)?;
let right = right.transmute(u128x2_layout, this)?;
let dest = dest.transmute(u128x2_layout, this)?;

let imm = this.read_scalar(imm)?.to_u8()?;

for i in 0..2 {
let dest = this.project_index(&dest, i)?;

let imm = match i {
0 => imm & 0xF,
1 => imm >> 4,
_ => unreachable!(),
};
if imm & 0b100 != 0 {
this.write_scalar(Scalar::from_u128(0), &dest)?;
} else {
let src = match imm {
0b00 => this.project_index(&left, 0)?,
0b01 => this.project_index(&left, 1)?,
0b10 => this.project_index(&right, 0)?,
0b11 => this.project_index(&right, 1)?,
_ => unreachable!(),
};
this.copy_op(&src, &dest)?;
}
}
}
// Used to implement the _mm_maskload_ps, _mm_maskload_pd, _mm256_maskload_ps
// and _mm256_maskload_pd functions.
// For the element `i`, if the high bit of the `i`-th element of `mask`
Expand Down
Loading