plonky2/src/field/packable.rs
Jakub Nabaglo bbbb57caa6
Simplify AVX2 Goldilocks (#399)
* Simplify AVX2 Goldilocks

* Fixes

* Lints

* Docs

* Minor doc

* Minor: typo
2021-12-20 13:41:42 -08:00

19 lines
700 B
Rust

use crate::field::field_types::Field;
use crate::field::packed_field::PackedField;
/// Points us to the default packing for a particular field. There may me multiple choices of
/// PackedField for a particular Field (e.g. every Field is also a PackedField), but this is the
/// recommended one. The recommended packing varies by target_arch and target_feature.
pub trait Packable: Field {
type Packing: PackedField<Scalar = Self>;
}
impl<F: Field> Packable for F {
default type Packing = Self;
}
#[cfg(target_feature = "avx2")]
impl Packable for crate::field::goldilocks_field::GoldilocksField {
type Packing = crate::field::arch::x86_64::avx2_goldilocks_field::Avx2GoldilocksField;
}