mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Add more selectors to the Lanes enum
This commit is contained in:
parent
64cb999866
commit
30a2b01c05
1 changed files with 14 additions and 2 deletions
|
|
@ -34,6 +34,8 @@ pub enum Lanes {
|
||||||
D,
|
D,
|
||||||
AB,
|
AB,
|
||||||
CD,
|
CD,
|
||||||
|
AD,
|
||||||
|
BC,
|
||||||
ALL,
|
ALL,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -49,6 +51,10 @@ fn blend_lanes(x: u32x8, y: u32x8, control: Lanes) -> u32x8 {
|
||||||
Lanes::D => {
|
Lanes::D => {
|
||||||
_mm256_blend_epi32(x.into_bits(), y.into_bits(), D_LANES as i32).into_bits()
|
_mm256_blend_epi32(x.into_bits(), y.into_bits(), D_LANES as i32).into_bits()
|
||||||
}
|
}
|
||||||
|
Lanes::AD => {
|
||||||
|
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (A_LANES | D_LANES) as i32)
|
||||||
|
.into_bits()
|
||||||
|
}
|
||||||
Lanes::AB => {
|
Lanes::AB => {
|
||||||
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (A_LANES | B_LANES) as i32)
|
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (A_LANES | B_LANES) as i32)
|
||||||
.into_bits()
|
.into_bits()
|
||||||
|
|
@ -57,9 +63,15 @@ fn blend_lanes(x: u32x8, y: u32x8, control: Lanes) -> u32x8 {
|
||||||
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (C_LANES | D_LANES) as i32)
|
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (C_LANES | D_LANES) as i32)
|
||||||
.into_bits()
|
.into_bits()
|
||||||
}
|
}
|
||||||
Lanes::ALL => {
|
Lanes::BC => {
|
||||||
_mm256_blend_epi32(x.into_bits(), y.into_bits(), ALL_LANES as i32).into_bits()
|
_mm256_blend_epi32(x.into_bits(), y.into_bits(), (B_LANES | C_LANES) as i32)
|
||||||
|
.into_bits()
|
||||||
}
|
}
|
||||||
|
Lanes::ALL => _mm256_blend_epi32(
|
||||||
|
x.into_bits(),
|
||||||
|
y.into_bits(),
|
||||||
|
(A_LANES | B_LANES | C_LANES | D_LANES) as i32,
|
||||||
|
).into_bits(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue