Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fcb6f3a
Merge ref '2c39ff499469' from rust-lang/rust
invalid-email-address Aug 17, 2026
a97bd3d
Merge pull request #23164 from rust-lang/rustc-pull
lnicola Aug 17, 2026
41cb428
Merge pull request #23166 from lnicola/download-faster
lnicola Aug 17, 2026
fe4d794
Merge pull request #23168 from lnicola/rm-zig
lnicola Aug 17, 2026
f29677a
Merge pull request #23147 from kivancgnlp/e0600-unary-op-not-defined
ChayimFriedman2 Aug 17, 2026
53cdf71
Merge pull request #23171 from A4-Tacks/skip-iter-no-intoiter
A4-Tacks Aug 18, 2026
6cef41f
Merge pull request #23186 from MannXo/fix/23143-asm-label-diverges
ChayimFriedman2 Aug 19, 2026
190b173
Merge ref 'f7d782a3be46' from rust-lang/rust
invalid-email-address Aug 20, 2026
8d379df
Merge pull request #23198 from rust-lang/rustc-pull
lnicola Aug 20, 2026
a3de395
Merge pull request #23205 from ChayimFriedman2/fix-clippy
ChayimFriedman2 Aug 20, 2026
fe8840f
Merge pull request #23079 from ChayimFriedman2/optimize-tts
ChayimFriedman2 Aug 21, 2026
642c6c4
Merge pull request #23201 from YUZHEthefool/fix/recursive-layout-stac…
ChayimFriedman2 Aug 21, 2026
a56706c
Merge pull request #23184 from ChayimFriedman2/raw-ref-deref-twice
ShoyuVanilla Aug 26, 2026
45d877d
Merge pull request #23162 from ChayimFriedman2/trait-fn-param
ShoyuVanilla Aug 26, 2026
dea099a
Merge pull request #23176 from ChayimFriedman2/const-is-type-owner
ShoyuVanilla Aug 26, 2026
3452168
Make sin, cos, exp, exp2, log, log2, log10 generic
N1ark Aug 17, 2026
01177f8
Auto merge of #162045 - lnicola:sync-from-ra, r=lnicola
bors Aug 31, 2026
c2b2fd5
Rollup merge of #160551 - Zalathar:inter-pat, r=Nadrieril
JonathanBrouwer Sep 1, 2026
f17e030
Rollup merge of #160989 - N1ark:08-12-generic-float-intrinsincs, r=fo…
JonathanBrouwer Sep 1, 2026
b3040c1
Rollup merge of #161861 - Zalathar:if-then, r=Nadrieril
JonathanBrouwer Sep 1, 2026
68e9f97
Rollup merge of #161929 - khyperia:explicitly-track-inherent-args, r=…
JonathanBrouwer Sep 1, 2026
1e28de9
Rollup merge of #162040 - weihanglo:bump-stage0, r=cuviper
JonathanBrouwer Sep 1, 2026
2f5cd9e
Rollup merge of #162063 - Mark-Simulacrum:aarch64-ec2, r=Kobzol
JonathanBrouwer Sep 1, 2026
84873a6
Rollup merge of #161353 - aerooneqq:static-muts-repr-build-test, r=pe…
JonathanBrouwer Sep 1, 2026
25eec61
Rollup merge of #161937 - jackh726:polonius-cleanups-2, r=lqd
JonathanBrouwer Sep 1, 2026
835b45e
Rollup merge of #162051 - nnethercote:rustc_feature-cleanups, r=Jonat…
JonathanBrouwer Sep 1, 2026
6c60314
Rollup merge of #162055 - mejrs:_style, r=JonathanBrouwer
JonathanBrouwer Sep 1, 2026
1f680f2
Rollup merge of #162075 - mejrs:track_caller_closure_gating, r=Jonath…
JonathanBrouwer Sep 1, 2026
9f0ca43
Rollup merge of #162079 - stlankes:sync, r=joboet
JonathanBrouwer Sep 1, 2026
66f5584
Rollup merge of #162097 - mejrs:instrumentfnattr, r=JonathanBrouwer
JonathanBrouwer Sep 1, 2026
2847ef4
Rollup merge of #162115 - BenjaminBrienen:typos, r=JonathanBrouwer
JonathanBrouwer Sep 1, 2026
25a3c06
Auto merge of #162117 - JonathanBrouwer:rollup-vMnIfR5, r=JonathanBro…
bors Sep 1, 2026
4c181b9
Auto merge of #162128 - clarfonthey:revert-drop-guard, r=clarfonthey
bors Sep 2, 2026
0ce2294
Prepare for merging from rust-lang/rust
Sep 2, 2026
7a62513
Merge ref 'edc52f87c28f' from rust-lang/rust
Sep 2, 2026
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
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17fd5b8a37b6667b6cc137f3cc35f09759768a3b
edc52f87c28f328c61685a02c47887a5cec7d767
26 changes: 12 additions & 14 deletions src/intrinsics/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ fn sqrt<'tcx, F: Float + FloatConvert<F> + Into<Scalar>>(
}

/// Determine which float operation on which type this is.
fn is_host_unary_float_op(intrinsic_name: &str) -> Option<(FloatTy, HostUnaryFloatOp)> {
let (op, ty) = intrinsic_name.rsplit_once('f')?;

let float_ty = match ty {
"16" => FloatTy::F16,
"32" => FloatTy::F32,
"64" => FloatTy::F64,
"128" => FloatTy::F128,
_ => return None,
};

let host_float_op = match op {
fn is_host_unary_float_op(
intrinsic_name: &str,
generic_args: ty::GenericArgsRef<'_>,
) -> Option<(FloatTy, HostUnaryFloatOp)> {
let host_float_op = match intrinsic_name {
"sin" => HostUnaryFloatOp::Sin,
"cos" => HostUnaryFloatOp::Cos,
"exp" => HostUnaryFloatOp::Exp,
Expand All @@ -39,6 +32,9 @@ fn is_host_unary_float_op(intrinsic_name: &str) -> Option<(FloatTy, HostUnaryFlo
_ => return None,
};

let ty::Float(float_ty) = *generic_args.type_at(0).kind() else {
bug!("`{intrinsic_name}` intrinsic called on non-float type");
};
Some((float_ty, host_float_op))
}

Expand Down Expand Up @@ -96,7 +92,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
fn emulate_math_intrinsic(
&mut self,
intrinsic_name: &str,
_generic_args: ty::GenericArgsRef<'tcx>,
generic_args: ty::GenericArgsRef<'tcx>,
args: &[OpTy<'tcx>],
dest: &PlaceTy<'tcx>,
) -> InterpResult<'tcx, EmulateItemResult> {
Expand Down Expand Up @@ -179,7 +175,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}

// Operations that need host floats.
_ if let Some((float_ty, op)) = is_host_unary_float_op(intrinsic_name) => {
_ if let Some((float_ty, op)) =
is_host_unary_float_op(intrinsic_name, generic_args) =>
{
let [f] = check_intrinsic_arg_count(args)?;
match float_ty {
FloatTy::F16 => host_unary_float_op::<HalfS>(this, f, op, dest)?,
Expand Down
8 changes: 4 additions & 4 deletions src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ where
}

/// For the intrinsics:
/// - sinf32, sinf64, sinhf, sinh
/// - cosf32, cosf64, coshf, cosh
/// - sin, sinhf, sinh
/// - cos, coshf, cosh
/// - tanhf, tanh, atanf, atan, atan2f, atan2
/// - expf32, expf64, exp2f32, exp2f64
/// - logf32, logf64, log2f32, log2f64, log10f32, log10f64
/// - exp, exp2
/// - log, log2, log10
/// - powf32, powf64
/// - erff, erf, erfcf, erfc
/// - hypotf, hypot
Expand Down