-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for f16 and f128 in float_to_int_unchecked intrinsic
- Loading branch information
1 parent
8400296
commit 9c4b070
Showing
4 changed files
with
255 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Verification failed for - check_cast_i16 | ||
Verification failed for - check_cast_i128 | ||
Verification failed for - check_cast_u8 | ||
Verification failed for - check_cast_u32 | ||
Verification failed for - check_cast_u64 | ||
Verification failed for - check_cast_u16 | ||
Verification failed for - check_cast_u128 | ||
Verification failed for - check_cast_usize | ||
Verification failed for - check_cast_i8 | ||
Verification failed for - check_cast_i64 | ||
Verification failed for - check_cast_isize | ||
Verification failed for - check_cast_i32 | ||
Complete - 0 successfully verified harnesses, 12 failures, 12 total. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
#![feature(f128)] | ||
|
||
// Check that `f128::MAX` does not fit in some integer types | ||
|
||
macro_rules! check_cast { | ||
($name:ident, $t:ty) => { | ||
#[kani::proof] | ||
fn $name() { | ||
let x = f128::MAX; | ||
let _u: $t = unsafe { x.to_int_unchecked() }; | ||
} | ||
}; | ||
} | ||
|
||
check_cast!(check_cast_u8, u8); | ||
check_cast!(check_cast_u16, u16); | ||
check_cast!(check_cast_u32, u32); | ||
check_cast!(check_cast_u64, u64); | ||
check_cast!(check_cast_u128, u128); | ||
check_cast!(check_cast_usize, usize); | ||
|
||
check_cast!(check_cast_i8, i8); | ||
check_cast!(check_cast_i16, i16); | ||
check_cast!(check_cast_i32, i32); | ||
check_cast!(check_cast_i64, i64); | ||
check_cast!(check_cast_i128, i128); | ||
check_cast!(check_cast_isize, isize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters