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

Major perf improvement by decorating unsafe functions with AES target. #2

Merged
merged 1 commit into from Oct 22, 2018
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+3 −0
Diff settings

Always

Just for now

Copy path View file
@@ -56,6 +56,7 @@ impl MeowLane {
}

#[inline]
#[target_feature(enable="aes")]
unsafe fn aes_rotate(a: &mut MeowLane, b: &mut MeowLane) {
a.l0 = _mm_aesdec_si128(a.l0, b.l0);
a.l1 = _mm_aesdec_si128(a.l1, b.l1);
@@ -71,6 +72,7 @@ unsafe fn aes_rotate(a: &mut MeowLane, b: &mut MeowLane) {

#[inline]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
#[target_feature(enable="aes")]
unsafe fn aes_load(s: &mut MeowLane, from: *const u8) {
s.l0 = _mm_aesdec_si128(s.l0, ptr::read_unaligned(from as *const __m128i));
s.l1 = _mm_aesdec_si128(
@@ -88,6 +90,7 @@ unsafe fn aes_load(s: &mut MeowLane, from: *const u8) {
}

#[inline]
#[target_feature(enable="aes")]
unsafe fn aes_merge(a: &mut MeowLane, b: &MeowLane) {
a.l0 = _mm_aesdec_si128(a.l0, b.l0);
a.l1 = _mm_aesdec_si128(a.l1, b.l1);
ProTip! Use n and p to navigate between commits in a pull request.