about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-11-12 09:46:00 +0000
committerbors <bors@rust-lang.org>2017-11-12 09:46:00 +0000
commit19e63bd50eb756e35416d7a8f01e2d63f419b373 (patch)
tree804731a452baa676e55485b85b18b8ed69f68741 /src/test/codegen
parentb087dedf3f85c4c90e27cb6e119b4da2712be5c9 (diff)
parent59524410a7eb3c6afe3ac01b4257d916efe2421b (diff)
downloadrust-19e63bd50eb756e35416d7a8f01e2d63f419b373.tar.gz
rust-19e63bd50eb756e35416d7a8f01e2d63f419b373.zip
Auto merge of #45900 - rkruppe:u128-to-f32-saturation-by-default, r=alexcrichton
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
-}