Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea38a04

Browse files
committed
Add math functions
1 parent3b7e69a commitea38a04

File tree

9 files changed

+3406
-92
lines changed

9 files changed

+3406
-92
lines changed

‎library/std/build.rs‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ fn main() {
8585
println!("cargo:rustc-check-cfg=cfg(reliable_f16)");
8686
println!("cargo:rustc-check-cfg=cfg(reliable_f128)");
8787

88+
// This is a step beyond only having the types and basic functions available. Math functions
89+
// aren't consistently available or correct.
90+
println!("cargo:rustc-check-cfg=cfg(reliable_f16_math)");
91+
println!("cargo:rustc-check-cfg=cfg(reliable_f128_math)");
92+
8893
let has_reliable_f16 =match(target_arch.as_str(), target_os.as_str()){
8994
// Selection failure until recent LLVM <https://github.com/llvm/llvm-project/issues/93894>
9095
// FIXME(llvm19): can probably be removed at the version bump
@@ -128,10 +133,29 @@ fn main() {
128133
_ =>false,
129134
};
130135

136+
// LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
137+
let has_reliable_f16_math = has_reliable_f16
138+
&&match(target_arch.as_str(), target_os.as_str()){
139+
("x86", _) =>false,
140+
_ =>true,
141+
};
142+
143+
let has_reliable_f128_math = has_reliable_f128
144+
&&match(target_arch.as_str(), target_os.as_str()){
145+
// ("aarch64", _) => false,
146+
_ =>true,
147+
};
148+
131149
if has_reliable_f16{
132150
println!("cargo:rustc-cfg=reliable_f16");
133151
}
134152
if has_reliable_f128{
135153
println!("cargo:rustc-cfg=reliable_f128");
136154
}
155+
if has_reliable_f16_math{
156+
println!("cargo:rustc-cfg=reliable_f16_math");
157+
}
158+
if has_reliable_f128_math{
159+
println!("cargo:rustc-cfg=reliable_f128_math");
160+
}
137161
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp