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

fix: #170 compile fail on aarch64 #171

Merged
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
15 changes: 14 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
env:
RUSTFLAGS: -C target-cpu=native
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
Expand Down Expand Up @@ -89,6 +89,19 @@ jobs:
with:
command: check
args: --target armv7-unknown-linux-gnueabihf
aarch64-apple-darwin:
name: Aarch64 Apple Darwin
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
- uses: actions-rs/cargo@v1
with:
command: check
args: --target aarch64-apple-darwin
i686-unknown-linux-gnu:
name: Linux i686
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ahash"
version = "0.8.4"
version = "0.8.5"
authors = ["Tom Kaitchuck <[email protected]>"]
license = "MIT OR Apache-2.0"
description = "A non-cryptographic hash function using AES-NI for high performance"
Expand Down
14 changes: 6 additions & 8 deletions src/operations.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::convert::*;
use zerocopy::transmute;

Check warning on line 2 in src/operations.rs

View workflow job for this annotation

GitHub Actions / wasm

unused import: `zerocopy::transmute`

Check warning on line 2 in src/operations.rs

View workflow job for this annotation

GitHub Actions / thumbv6m

unused import: `zerocopy::transmute`

Check warning on line 2 in src/operations.rs

View workflow job for this annotation

GitHub Actions / Linux ARMv7

unused import: `zerocopy::transmute`

Check warning on line 2 in src/operations.rs

View workflow job for this annotation

GitHub Actions / Aarch64 Apple Darwin

unused import: `zerocopy::transmute`

///This constant comes from Kunth's prng (Empirically it works better than those from splitmix32).
pub(crate) const MULTIPLE: u64 = 6364136223846793005;
Expand Down Expand Up @@ -123,10 +123,9 @@
use core::arch::aarch64::*;
#[cfg(target_arch = "arm")]
use core::arch::arm::*;
unsafe {
let value = transmute!(value);
xor ^ transmute::<_, u128>(vaesmcq_u8(vaeseq_u8(value, transmute!(0u128))))
}
let res = unsafe { vaesmcq_u8(vaeseq_u8(transmute!(value), transmute!(0u128))) };
let value: u128 = transmute!(res);
xor ^ value
}

#[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)))]
Expand Down Expand Up @@ -156,10 +155,9 @@
use core::arch::aarch64::*;
#[cfg(target_arch = "arm")]
use core::arch::arm::*;
unsafe {
let value = transmute!(value);
xor ^ transmute::<_, u128>(vaesimcq_u8(vaesdq_u8(value, transmute!(0u128))))
}
let res = unsafe { vaesimcq_u8(vaesdq_u8(transmute!(value), transmute!(0u128))) };
let value: u128 = transmute!(res);
xor ^ value
}

#[allow(unused)]
Expand Down
Loading