-
Notifications
You must be signed in to change notification settings - Fork 10
Advance the port all the way to the end of 2022. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b6f2ebb
Track the current LLVM commit hash of the port in the version number.
eddyb 7c82f2d
README: fill in most of the remaining details (history, versioning).
eddyb 697bf3c
Advance the port to https://github.com/llvm/llvm-project/commit/768d6…
eddyb 45c2345
Advance the port to https://github.com/llvm/llvm-project/commit/69f60…
eddyb bacc0a9
Advance the port to https://github.com/llvm/llvm-project/commit/2b6b8…
eddyb 6a67d49
Advance the port to https://github.com/llvm/llvm-project/commit/b198f…
eddyb e4703ec
Advance the port to https://github.com/llvm/llvm-project/commit/a2588…
eddyb a3362d1
fuzz: add float->float->float roundtrip ops (through `f32`/`Single` a…
eddyb 6f8bd3a
Advance the port to https://github.com/llvm/llvm-project/commit/6dabc…
eddyb 9905076
fuzz: remove `--strict-hard-qnan-vs-snan` flag now that APFloat handl…
eddyb c5ad989
fuzz: add two more flags to control NaN strictness (vs hardware) and …
eddyb dc40e34
Advance the port to https://github.com/llvm/llvm-project/commit/f45d5…
eddyb b079515
Advance the port to https://github.com/llvm/llvm-project/commit/462a3…
eddyb 01745f2
fuzz: add `bruteforce-tiny` subcommand for exhaustively checking 8-bi…
eddyb 68abe98
ieee: increase robustness around special combinations of `category` a…
eddyb 02bb6cf
Bump version to `0.1.0`.
eddyb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,41 @@ | ||
// HACK(eddyb) easier dep-tracking if we let `rustc` do it. | ||
const SRC_LIB_RS_CONTENTS: &str = include_str!("src/lib.rs"); | ||
|
||
const EXPECTED_SRC_LIB_RS_PREFIX: &str = "\ | ||
//! Port of LLVM's APFloat software floating-point implementation from the | ||
//! following C++ sources (please update commit hash when backporting): | ||
//! https://github.com/llvm/llvm-project/commit/"; | ||
|
||
fn main() { | ||
// HACK(eddyb) disable the default of re-running the build script on *any* | ||
// change to *the entire source tree* (i.e. the default is roughly `./`). | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
|
||
let llvm_commit_hash = SRC_LIB_RS_CONTENTS | ||
.strip_prefix(EXPECTED_SRC_LIB_RS_PREFIX) | ||
.ok_or(()) | ||
.map_err(|_| format!("expected `src/lib.rs` to start with:\n\n{EXPECTED_SRC_LIB_RS_PREFIX}")) | ||
.and_then(|commit_hash_plus_rest_of_file| { | ||
Ok(commit_hash_plus_rest_of_file | ||
.split_once('\n') | ||
.ok_or("expected `src/lib.rs` to have more than 3 lines")?) | ||
}) | ||
.and_then(|(commit_hash, _)| { | ||
if commit_hash.len() != 40 || !commit_hash.chars().all(|c| matches!(c, '0'..='9'|'a'..='f')) { | ||
Err(format!("expected `src/lib.rs` to have a valid commit hash, found {commit_hash:?}")) | ||
} else { | ||
Ok(commit_hash) | ||
} | ||
}) | ||
.unwrap_or_else(|e| { | ||
eprintln!("\n{e}\n"); | ||
panic!("failed to validate `src/lib.rs`'s commit hash (see above)") | ||
}); | ||
|
||
let expected_version_metadata = format!("+llvm-{}", &llvm_commit_hash[..12]); | ||
let actual_version = env!("CARGO_PKG_VERSION"); | ||
if !actual_version.ends_with(&expected_version_metadata) { | ||
eprintln!("\nexpected version ending in `{expected_version_metadata}`, found `{actual_version}`\n"); | ||
panic!("failed to validate Cargo package version (see above)"); | ||
} | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.