Skip to content
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

feat(storage-proofs-porep): implement prefetch macro for aarch64 #1294

Merged
merged 3 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions storage-proofs/porep/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//requires nightly, or later stable version
//#![warn(clippy::unwrap_used)]

#![cfg_attr(target_arch = "aarch64", feature(stdsimd))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means that aarch64 now requires a nightly compiler, which is fine, but should be documented

Copy link
Contributor Author

@dgbo dgbo Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick review.

Seems the nightly compiler requirement has been documented in README.md already:

275 ## Building for Arm64
276
277 In order to build for arm64 the current requirements are
278
279 - nightly rust compiler
280
281 Example for building `filecoin-proofs`
282
283 ```
284 $ rustup +nightly target add aarch64-unknown-linux-gnu
285 $ cargo +nightly build -p filecoin-proofs --release --target aarch64-unknown-linux-gnu
286 ```

Do we need extra comments in storage-proofs/porep/src/lib.rs before the cfg_attr line or elsewhere? Maybe something like //requires nightly, or later stable version to build for aarch64?

Best Regards.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha, I forgot about that, perfect thank you!


pub mod drg;
pub mod stacked;

Expand Down
5 changes: 5 additions & 0 deletions storage-proofs/porep/src/stacked/vanilla/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ macro_rules! prefetch {

_mm_prefetch($val, _MM_HINT_T0);
}
#[cfg(all(target_arch = "aarch64"))]
unsafe {
use std::arch::aarch64::*;
_prefetch($val, _PREFETCH_READ, _PREFETCH_LOCALITY3);
}
};
}

Expand Down