@@ -66,32 +66,32 @@ pub fn ctl_arithmetic_rows<F: Field>() -> TableWithColumns<F> {
66
66
// from the opcode bits matches.
67
67
// FIXME: opcode = op + 2^6 * func
68
68
const COMBINED_OPS : [ ( usize , u32 ) ; 18 ] = [
69
- ( columns:: IS_ADD , 0b000000 + 0b100000 * ( 1 << 6 ) ) ,
70
- ( columns:: IS_ADDU , 0b000000 + 0b100001 * ( 1 << 6 ) ) ,
69
+ ( columns:: IS_ADD , 0b100000 * ( 1 << 6 ) ) ,
70
+ ( columns:: IS_ADDU , 0b100001 * ( 1 << 6 ) ) ,
71
71
//(columns::IS_ADDI, 0b001000 + 0b000000 * (1 << 6)),
72
72
//(columns::IS_ADDIU, 0b001001 + 0b000000 * (1 << 6)),
73
- ( columns:: IS_SUB , 0b000000 + 0b100010 * ( 1 << 6 ) ) ,
74
- ( columns:: IS_SUBU , 0b000000 + 0b100011 * ( 1 << 6 ) ) ,
75
- ( columns:: IS_MULT , 0b000000 + 0b011000 * ( 1 << 6 ) ) ,
76
- ( columns:: IS_MULTU , 0b000000 + 0b011001 * ( 1 << 6 ) ) ,
73
+ ( columns:: IS_SUB , 0b100010 * ( 1 << 6 ) ) ,
74
+ ( columns:: IS_SUBU , 0b100011 * ( 1 << 6 ) ) ,
75
+ ( columns:: IS_MULT , 0b011000 * ( 1 << 6 ) ) ,
76
+ ( columns:: IS_MULTU , 0b011001 * ( 1 << 6 ) ) ,
77
77
( columns:: IS_MUL , 0b011100 + 0b000010 * ( 1 << 6 ) ) ,
78
- ( columns:: IS_DIV , 0b000000 + 0b011010 * ( 1 << 6 ) ) ,
79
- ( columns:: IS_DIVU , 0b000000 + 0b011011 * ( 1 << 6 ) ) ,
80
- ( columns:: IS_SLLV , 0b000000 + 0b000100 * ( 1 << 6 ) ) ,
81
- ( columns:: IS_SRLV , 0b000000 + 0b000110 * ( 1 << 6 ) ) ,
82
- ( columns:: IS_SRAV , 0b000000 + 0b000111 * ( 1 << 6 ) ) ,
78
+ ( columns:: IS_DIV , 0b011010 * ( 1 << 6 ) ) ,
79
+ ( columns:: IS_DIVU , 0b011011 * ( 1 << 6 ) ) ,
80
+ ( columns:: IS_SLLV , 0b000100 * ( 1 << 6 ) ) ,
81
+ ( columns:: IS_SRLV , 0b000110 * ( 1 << 6 ) ) ,
82
+ ( columns:: IS_SRAV , 0b000111 * ( 1 << 6 ) ) ,
83
83
//(columns::IS_SLL, 0b000000 + 0b000000 * (1 << 6)),
84
84
//(columns::IS_SRL, 0b000000 + 0b000010 * (1 << 6)),
85
85
//(columns::IS_SRA, 0b000000 + 0b000011 * (1 << 6)),
86
- ( columns:: IS_SLT , 0b000000 + 0b101010 * ( 1 << 6 ) ) ,
87
- ( columns:: IS_SLTU , 0b000000 + 0b101011 * ( 1 << 6 ) ) ,
86
+ ( columns:: IS_SLT , 0b101010 * ( 1 << 6 ) ) ,
87
+ ( columns:: IS_SLTU , 0b101011 * ( 1 << 6 ) ) ,
88
88
// (columns::IS_SLTI, 0b001010 + 0b000000 * (1 << 6)),
89
89
// (columns::IS_SLTIU, 0b001011 + 0b000000 * (1 << 6)),
90
90
// (columns::IS_LUI, 0b001111 + 0b000000 * (1 << 6)),
91
- ( columns:: IS_MFHI , 0b000000 + 0b010000 * ( 1 << 6 ) ) ,
92
- ( columns:: IS_MTHI , 0b000000 + 0b010001 * ( 1 << 6 ) ) ,
93
- ( columns:: IS_MFLO , 0b000000 + 0b010010 * ( 1 << 6 ) ) ,
94
- ( columns:: IS_MTLO , 0b000000 + 0b010011 * ( 1 << 6 ) ) ,
91
+ ( columns:: IS_MFHI , 0b010000 * ( 1 << 6 ) ) ,
92
+ ( columns:: IS_MTHI , 0b010001 * ( 1 << 6 ) ) ,
93
+ ( columns:: IS_MFLO , 0b010010 * ( 1 << 6 ) ) ,
94
+ ( columns:: IS_MTLO , 0b010011 * ( 1 << 6 ) ) ,
95
95
] ;
96
96
97
97
const REGISTER_MAP : [ Range < usize > ; 3 ] = [
@@ -123,7 +123,7 @@ const RANGE_MAX: usize = 1usize << 16; // Range check strict upper bound
123
123
124
124
impl < F : RichField , const D : usize > ArithmeticStark < F , D > {
125
125
/// Expects input in *column*-major layout
126
- fn generate_range_checks ( & self , cols : & mut Vec < Vec < F > > ) {
126
+ fn generate_range_checks ( & self , cols : & mut [ Vec < F > ] ) {
127
127
debug_assert ! ( cols. len( ) == columns:: NUM_ARITH_COLUMNS ) ;
128
128
129
129
let n_rows = cols[ 0 ] . len ( ) ;
@@ -286,12 +286,11 @@ impl<F: RichField + Extendable<D>, const D: usize> Stark<F, D> for ArithmeticSta
286
286
mod tests {
287
287
use anyhow:: Result ;
288
288
use itertools:: Itertools ;
289
- use plonky2:: field:: types:: PrimeField64 ;
290
289
use plonky2:: plonk:: config:: { GenericConfig , PoseidonGoldilocksConfig } ;
291
290
use rand:: { Rng , SeedableRng } ;
292
291
use rand_chacha:: ChaCha8Rng ;
293
292
294
- use super :: { columns , ArithmeticStark } ;
293
+ use crate :: arithmetic :: arithmetic_stark :: ArithmeticStark ;
295
294
use crate :: arithmetic:: columns:: OUTPUT_REGISTER ;
296
295
use crate :: arithmetic:: * ;
297
296
use crate :: stark_testing:: { test_stark_circuit_constraints, test_stark_low_degree} ;
0 commit comments