about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2017-11-10 00:24:05 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2017-11-10 10:12:30 +0100
commit59524410a7eb3c6afe3ac01b4257d916efe2421b (patch)
tree155dd4768dfc1aff7795dba6784126f9f90326e3 /src/test/codegen
parentf1ea23e2cc72cafad1dc25a06c09ec2de8e323eb (diff)
downloadrust-59524410a7eb3c6afe3ac01b4257d916efe2421b.tar.gz
rust-59524410a7eb3c6afe3ac01b4257d916efe2421b.zip
Make saturating u128 -> f32 casts the default behavior
... rather than being gated by -Z saturating-float-casts.
There are several reasons for this:

1. Const eval already implements this behavior.
2. Unlike with float->int casts, this behavior is uncontroversially the
right behavior and it is not as performance critical. Thus there is no
particular need to make the bug fix for u128->f32 casts opt-in.
3. Having two orthogonal features under one flag is silly, and never
should have happened in the first place.
4. Benchmarking float->int casts with the -Z flag should not pick up
performance changes due to the u128->f32 casts (assuming there are any).

Fixes #41799
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/unchecked-float-casts.rs23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/test/codegen/unchecked-float-casts.rs b/src/test/codegen/unchecked-float-casts.rs
index 64ab19cceee..c2fc2966170 100644
--- a/src/test/codegen/unchecked-float-casts.rs
+++ b/src/test/codegen/unchecked-float-casts.rs
@@ -37,29 +37,10 @@ pub fn f32_to_i32(x: f32) -> i32 {
 }
 
 #[no_mangle]
-pub fn f64_to_u8(x: f32) -> u16 {
+pub fn f64_to_u16(x: f64) -> u16 {
+    // CHECK: fptoui
     // CHECK-NOT: fcmp
     // CHECK-NOT: icmp
     // CHECK-NOT: select
     x as u16
 }
-
-// CHECK-LABEL: @i32_to_f64
-#[no_mangle]
-pub fn i32_to_f64(x: i32) -> f64 {
-    // CHECK: sitofp
-    // CHECK-NOT: fcmp
-    // CHECK-NOT: icmp
-    // CHECK-NOT: select
-    x as f64
-}
-
-// CHECK-LABEL: @u128_to_f32
-#[no_mangle]
-pub fn u128_to_f32(x: u128) -> f32 {
-    // CHECK: uitofp
-    // CHECK-NOT: fcmp
-    // CHECK-NOT: icmp
-    // CHECK-NOT: select
-    x as f32
-}