This commit is contained in:
Jean-Philippe Bossuat
2024-12-31 15:30:57 +01:00
parent c65522099b
commit 8d84727fae
17 changed files with 422 additions and 363 deletions

View File

@@ -1,8 +1,25 @@
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Barrett<O>(pub O, pub O);
impl<O> Barrett<O> {
#[inline(always)]
pub fn value(&self) -> &O {
&self.0
}
#[inline(always)]
pub fn quotient(&self) -> &O {
&self.1
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct BarrettPrecomp<O>{
pub q: O,
pub lo:O,
pub hi:O,
pub one: Barrett<O>,
}
impl<O> BarrettPrecomp<O>{