Delay shuffles that cross the "Great Wall of Intel".

This commit is contained in:
Henry de Valence 2018-11-28 12:47:25 -08:00
parent 33aa544cf4
commit 06766bfdea

View file

@ -71,14 +71,14 @@ impl Identity for ExtendedPoint {
impl ExtendedPoint {
pub fn double(&self) -> ExtendedPoint {
// Set tmp0 = (X1 Y1 X1 Y1)
let mut tmp0 = self.0.shuffle(Shuffle::ABAB);
// (Y1 X1 T1 Z1) -- uses vpshufd (1c latency @ 1/c)
let mut tmp0 = self.0.shuffle(Shuffle::BADC);
// Set tmp1 = (Y1 X1 Y1 X1)
let mut tmp1 = tmp0.shuffle(Shuffle::BADC);
// (X1+Y1 X1+Y1 X1+Y1 X1+Y1) -- can use vpinserti128
let mut tmp1 = (self.0 + tmp0).shuffle(Shuffle::ABAB);
// Set tmp0 = (X1 Y1 Z1 X1+Y1)
tmp0 = self.0.blend(&(tmp0 + tmp1), Lanes::D);
// (X1 Y1 Z1 X1+Y1)
tmp0 = self.0.blend(&tmp1, Lanes::D);
tmp1 = F51x4Reduced::from(tmp0).square();
// Now tmp1 = (S1 S2 S3 S4)