Migrate to packed_simd from core::simd

This commit is contained in:
Henry de Valence 2018-07-26 12:40:24 -07:00
parent 920bdb3279
commit 288625418d
5 changed files with 11 additions and 5 deletions

View file

@ -48,6 +48,7 @@ generic-array = "0.9"
clear_on_drop = "=0.2.3"
subtle = { version = "0.7", features = ["generic-impls"], default-features = false }
serde = { version = "1.0", optional = true }
packed_simd = { version = "0.1.0", features = ["into_bits"], optional = true }
[build-dependencies]
rand = { version = "0.5", default-features = false }
@ -57,6 +58,7 @@ generic-array = "0.9"
clear_on_drop = "=0.2.3"
subtle = { version = "0.7", features = ["generic-impls"], default-features = false }
serde = { version = "1.0", optional = true }
packed_simd = { version = "0.1.0", features = ["into_bits"], optional = true }
[features]
nightly = ["subtle/nightly", "clear_on_drop/nightly"]
@ -71,7 +73,7 @@ u32_backend = []
u64_backend = []
# The AVX2 backend uses u32x8s with u64x4 products.
# It uses the u64 code for serial operations.
avx2_backend = ["nightly", "u64_backend"]
avx2_backend = ["nightly", "u64_backend", "packed_simd"]
# Signals that we're in the main build stage. This is off by default,
# to signal stage 1 of the build, where build.rs loads the library

View file

@ -1,6 +1,5 @@
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]
#![cfg_attr(feature = "nightly", feature(cfg_target_feature))]
#![cfg_attr(all(feature = "nightly", feature = "avx2_backend"), feature(stdsimd))]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
@ -15,6 +14,9 @@ extern crate generic_array;
extern crate rand;
extern crate subtle;
#[cfg(all(feature = "nightly", feature = "avx2_backend"))]
extern crate packed_simd;
use std::env;
use std::fs::File;
use std::io::Write;

View file

@ -10,7 +10,7 @@
//! This module contains constants used by the AVX2 backend.
use core::simd::u32x8;
use packed_simd::u32x8;
use backend::avx2::edwards::{CachedPoint, ExtendedPoint};
use backend::avx2::field::FieldElement32x4;

View file

@ -40,7 +40,7 @@ const C_LANES64: u8 = 0b00_11_00_00;
const D_LANES64: u8 = 0b11_00_00_00;
use core::ops::{Add, Mul, Neg};
use core::simd::{i32x8, u32x8, u64x4, IntoBits};
use packed_simd::{i32x8, u32x8, u64x4, IntoBits};
use backend::avx2::constants::{P_TIMES_16_HI, P_TIMES_16_LO, P_TIMES_2_HI, P_TIMES_2_LO};
use backend::u64::field::FieldElement64;

View file

@ -13,7 +13,6 @@
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]
#![cfg_attr(feature = "nightly", feature(cfg_target_feature))]
#![cfg_attr(feature = "nightly", feature(external_doc))]
#![cfg_attr(all(feature = "nightly", feature = "avx2_backend"), feature(stdsimd))]
// Refuse to compile if documentation is missing, but only on nightly.
//
@ -39,6 +38,9 @@ extern crate alloc;
#[macro_use]
extern crate std;
#[cfg(all(feature = "nightly", feature = "avx2_backend"))]
extern crate packed_simd;
extern crate rand;
extern crate clear_on_drop;
extern crate byteorder;