Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_cranelift/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ pub(crate) fn clif_int_or_float_cast(
fx.bcx.ins().fcvt_to_uint_sat(to_ty, from)
};

if let Some(false) = fx.tcx.sess.opts.unstable_opts.saturating_float_casts {
return val;
}

let is_not_nan = fx.bcx.ins().fcmp(FloatCC::Equal, from, from);
let zero = type_zero_value(&mut fx.bcx, to_ty);
fx.bcx.ins().select(is_not_nan, val, zero)
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,6 @@ pub(crate) fn codegen_cast(
fx.bcx.ins().ireduce(to_ty, val)
};

if let Some(false) = fx.tcx.sess.opts.unstable_opts.saturating_float_casts {
return val;
}

let is_not_nan = fcmp(fx, FloatCC::Equal, from, from);
let zero = type_zero_value(&mut fx.bcx, to_ty);
fx.bcx.ins().select(is_not_nan, val, zero)
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_ssa/src/traits/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,6 @@ pub trait BuilderMethods<'a, 'tcx>:
);
assert_eq!(self.cx().type_kind(int_ty), TypeKind::Integer);

if let Some(false) = self.cx().sess().opts.unstable_opts.saturating_float_casts {
return if signed { self.fptosi(x, dest_ty) } else { self.fptoui(x, dest_ty) };
}

if signed { self.fptosi_sat(x, dest_ty) } else { self.fptoui_sat(x, dest_ty) }
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,6 @@ fn test_unstable_options_tracking_hash() {
tracked!(sanitizer_kcfi_arity, Some(true));
tracked!(sanitizer_memory_track_origins, 2);
tracked!(sanitizer_recover, SanitizerSet::ADDRESS);
tracked!(saturating_float_casts, Some(true));
tracked!(share_generics, Some(true));
tracked!(simulate_remapped_rust_src_base, Some(PathBuf::from("/rustc/abc")));
tracked!(small_data_threshold, Some(16));
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2827,9 +2827,6 @@ written to standard error output)"),
"enable origins tracking in MemorySanitizer"),
sanitizer_recover: SanitizerSet = (SanitizerSet::empty(), parse_sanitizers, [TRACKED],
"enable recovery for selected sanitizers"),
saturating_float_casts: Option<bool> = (None, parse_opt_bool, [TRACKED],
"make float->int casts UB-free: numbers outside the integer type's range are clipped to \
the max/min integer respectively, and NaN is mapped to 0 (default: yes)"),
self_profile: SwitchWithOptPath = (SwitchWithOptPath::Disabled,
parse_switch_with_opt_path, [UNTRACKED],
"run the self profiler and output the raw event data"),
Expand Down
Loading