Skip to content

Commit

Permalink
Fixing main (Plonky3#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyxtonPrime authored Oct 1, 2024
1 parent af5eb39 commit eb500be
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
6 changes: 4 additions & 2 deletions goldilocks/src/x86_64_avx2/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{PackedField, PackedValue, PrimeField64};
use p3_field::{PackedField, PackedFieldPow2, PackedValue, PrimeField64};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -261,7 +261,9 @@ unsafe impl PackedValue for PackedGoldilocksAVX2 {

unsafe impl PackedField for PackedGoldilocksAVX2 {
type Scalar = Goldilocks;
}

unsafe impl PackedFieldPow2 for PackedGoldilocksAVX2 {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.get(), other.get());
Expand Down Expand Up @@ -584,7 +586,7 @@ unsafe fn interleave2(x: __m256i, y: __m256i) -> (__m256i, __m256i) {

#[cfg(test)]
mod tests {
use p3_field::{AbstractField, PackedField, PackedValue};
use p3_field::{AbstractField, PackedFieldPow2, PackedValue};

use crate::x86_64_avx2::packing::WIDTH;
use crate::{Goldilocks, PackedGoldilocksAVX2};
Expand Down
6 changes: 4 additions & 2 deletions goldilocks/src/x86_64_avx512/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{PackedField, PackedValue};
use p3_field::{PackedField, PackedFieldPow2, PackedValue};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -260,7 +260,9 @@ unsafe impl PackedValue for PackedGoldilocksAVX512 {

unsafe impl PackedField for PackedGoldilocksAVX512 {
type Scalar = Goldilocks;
}

unsafe impl PackedFieldPow2 for PackedGoldilocksAVX512 {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.get(), other.get());
Expand Down Expand Up @@ -481,7 +483,7 @@ unsafe fn interleave4(x: __m512i, y: __m512i) -> (__m512i, __m512i) {

#[cfg(test)]
mod tests {
use p3_field::{AbstractField, PackedField, PackedValue};
use p3_field::{AbstractField, PackedFieldPow2, PackedValue};

use crate::x86_64_avx512::packing::WIDTH;
use crate::{Goldilocks, PackedGoldilocksAVX512};
Expand Down
4 changes: 3 additions & 1 deletion mersenne-31/src/x86_64_avx2/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{AbstractField, Field, PackedField, PackedValue};
use p3_field::{AbstractField, Field, PackedField, PackedFieldPow2, PackedValue};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -623,7 +623,9 @@ unsafe impl PackedValue for PackedMersenne31AVX2 {

unsafe impl PackedField for PackedMersenne31AVX2 {
type Scalar = Mersenne31;
}

unsafe impl PackedFieldPow2 for PackedMersenne31AVX2 {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.to_vector(), other.to_vector());
Expand Down
4 changes: 3 additions & 1 deletion mersenne-31/src/x86_64_avx512/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{AbstractField, Field, PackedField, PackedValue};
use p3_field::{AbstractField, Field, PackedField, PackedFieldPow2, PackedValue};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -723,7 +723,9 @@ unsafe impl PackedValue for PackedMersenne31AVX512 {

unsafe impl PackedField for PackedMersenne31AVX512 {
type Scalar = Mersenne31;
}

unsafe impl PackedFieldPow2 for PackedMersenne31AVX512 {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.to_vector(), other.to_vector());
Expand Down
4 changes: 3 additions & 1 deletion monty-31/src/x86_64_avx2/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{AbstractField, Field, PackedField, PackedValue};
use p3_field::{AbstractField, Field, PackedField, PackedFieldPow2, PackedValue};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -823,7 +823,9 @@ unsafe impl<FP: FieldParameters> PackedValue for PackedMontyField31AVX2<FP> {

unsafe impl<FP: FieldParameters> PackedField for PackedMontyField31AVX2<FP> {
type Scalar = MontyField31<FP>;
}

unsafe impl<FP: FieldParameters> PackedFieldPow2 for PackedMontyField31AVX2<FP> {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.to_vector(), other.to_vector());
Expand Down
4 changes: 3 additions & 1 deletion monty-31/src/x86_64_avx512/packing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use core::iter::{Product, Sum};
use core::mem::transmute;
use core::ops::{Add, AddAssign, Div, Mul, MulAssign, Neg, Sub, SubAssign};

use p3_field::{AbstractField, Field, PackedField, PackedValue};
use p3_field::{AbstractField, Field, PackedField, PackedFieldPow2, PackedValue};
use rand::distributions::{Distribution, Standard};
use rand::Rng;

Expand Down Expand Up @@ -766,7 +766,9 @@ unsafe impl<FP: FieldParameters> PackedValue for PackedMontyField31AVX512<FP> {

unsafe impl<FP: FieldParameters> PackedField for PackedMontyField31AVX512<FP> {
type Scalar = MontyField31<FP>;
}

unsafe impl<FP: FieldParameters> PackedFieldPow2 for PackedMontyField31AVX512<FP> {
#[inline]
fn interleave(&self, other: Self, block_len: usize) -> (Self, Self) {
let (v0, v1) = (self.to_vector(), other.to_vector());
Expand Down

0 comments on commit eb500be

Please sign in to comment.