@@ -73,19 +73,16 @@ impl GoldilocksField {
73
73
res
74
74
}
75
75
76
- #[ inline( always) ]
77
76
fn from_canonical_u64 ( n : u64 ) -> Self {
78
77
debug_assert ! ( n < Self :: ORDER ) ;
79
78
Self ( n)
80
79
}
81
80
82
- #[ inline]
83
81
fn to_canonical_u64 ( self ) -> u64 {
84
82
self . 0
85
83
}
86
84
}
87
85
88
- #[ inline]
89
86
fn wrap ( x : u64 ) -> u64 {
90
87
if x >= GoldilocksField :: ORDER {
91
88
x - GoldilocksField :: ORDER
@@ -97,7 +94,6 @@ fn wrap(x: u64) -> u64 {
97
94
impl std:: ops:: Neg for GoldilocksField {
98
95
type Output = Self ;
99
96
100
- #[ inline]
101
97
fn neg ( self ) -> Self {
102
98
if self . 0 == 0 {
103
99
self
@@ -110,7 +106,6 @@ impl std::ops::Neg for GoldilocksField {
110
106
impl std:: ops:: Add for GoldilocksField {
111
107
type Output = Self ;
112
108
113
- #[ inline]
114
109
#[ allow( clippy:: suspicious_arithmetic_impl) ]
115
110
fn add ( self , rhs : Self ) -> Self {
116
111
let ( sum, over) = self . 0 . overflowing_add ( rhs. 0 ) ;
@@ -123,7 +118,6 @@ impl std::ops::Add for GoldilocksField {
123
118
impl std:: ops:: Sub for GoldilocksField {
124
119
type Output = Self ;
125
120
126
- #[ inline]
127
121
#[ allow( clippy:: suspicious_arithmetic_impl) ]
128
122
fn sub ( self , rhs : Self ) -> Self {
129
123
let ( diff, under) = self . 0 . overflowing_sub ( rhs. 0 ) ;
@@ -171,7 +165,6 @@ impl std::ops::Div for GoldilocksField {
171
165
}
172
166
}
173
167
174
- #[ inline]
175
168
fn try_integer_div_without_remainder ( a : u64 , b : u64 ) -> Option < u64 > {
176
169
( a % b == 0 ) . then ( || a / b)
177
170
}
@@ -185,7 +178,7 @@ fn full_field_div(a: GoldilocksField, b: GoldilocksField) -> GoldilocksField {
185
178
/// - It is only correct if x + y < 2**64 + ORDER = 0x1ffffffff00000001.
186
179
/// - It is only faster in some circumstances. In particular, on x86 it overwrites both inputs in
187
180
/// the registers, so its use is not recommended when either input will be used again.
188
- # [ inline ( always ) ]
181
+
189
182
#[ cfg( target_arch = "x86_64" ) ]
190
183
unsafe fn add_no_canonicalize_trashing_input ( x : u64 , y : u64 ) -> u64 {
191
184
let res_wrapped: u64 ;
@@ -212,7 +205,6 @@ unsafe fn add_no_canonicalize_trashing_input(x: u64, y: u64) -> u64 {
212
205
res_wrapped + adjustment
213
206
}
214
207
215
- #[ inline( always) ]
216
208
#[ cfg( not( target_arch = "x86_64" ) ) ]
217
209
const unsafe fn add_no_canonicalize_trashing_input ( x : u64 , y : u64 ) -> u64 {
218
210
let ( res_wrapped, carry) = x. overflowing_add ( y) ;
@@ -221,7 +213,7 @@ const unsafe fn add_no_canonicalize_trashing_input(x: u64, y: u64) -> u64 {
221
213
}
222
214
223
215
/// Reduces to a 64-bit value. The result is in canonical form.
224
- # [ inline ]
216
+
225
217
fn reduce128 ( x : u128 ) -> GoldilocksField {
226
218
let ( x_lo, x_hi) = split ( x) ; // This is a no-op
227
219
let x_hi_hi = x_hi >> 32 ;
@@ -239,17 +231,15 @@ fn reduce128(x: u128) -> GoldilocksField {
239
231
}
240
232
241
233
/// Squares the base N number of times and multiplies the result by the tail value.
242
- # [ inline ( always ) ]
234
+
243
235
fn exp_acc < const N : usize > ( base : GoldilocksField , tail : GoldilocksField ) -> GoldilocksField {
244
236
base. exp_power_of_2 ( N ) * tail
245
237
}
246
238
247
- #[ inline]
248
239
const fn split ( x : u128 ) -> ( u64 , u64 ) {
249
240
( x as u64 , ( x >> 64 ) as u64 )
250
241
}
251
242
252
- #[ inline( always) ]
253
243
#[ cfg( target_arch = "x86_64" ) ]
254
244
fn assume ( p : bool ) {
255
245
debug_assert ! ( p) ;
@@ -268,7 +258,7 @@ fn assume(p: bool) {
268
258
/// y = bar();
269
259
/// }
270
260
/// This function has no semantics. It is a hint only.
271
- # [ inline ( always ) ]
261
+
272
262
fn branch_hint ( ) {
273
263
// NOTE: These are the currently supported assembly architectures. See the
274
264
// [nightly reference](https://doc.rust-lang.org/nightly/reference/inline-assembly.html) for
@@ -287,14 +277,12 @@ fn branch_hint() {
287
277
}
288
278
289
279
impl From < u64 > for GoldilocksField {
290
- #[ inline]
291
280
fn from ( n : u64 ) -> Self {
292
281
Self ( wrap ( n) )
293
282
}
294
283
}
295
284
296
285
impl From < FieldElement > for IntType {
297
- #[ inline]
298
286
fn from ( f : FieldElement ) -> Self {
299
287
f. 0
300
288
}
@@ -306,21 +294,20 @@ impl std::fmt::Display for GoldilocksField {
306
294
}
307
295
}
308
296
309
- #[ inline]
310
297
fn integer_div ( a : GoldilocksField , b : GoldilocksField ) -> GoldilocksField {
311
298
GoldilocksField ( a. 0 / b. 0 )
312
299
}
313
300
314
301
impl std:: ops:: BitAnd < u64 > for GoldilocksField {
315
302
type Output = Self ;
316
- # [ inline ]
303
+
317
304
fn bitand ( self , b : u64 ) -> GoldilocksField {
318
305
Self ( self . 0 & b)
319
306
}
320
307
}
321
308
impl std:: ops:: BitOr < GoldilocksField > for GoldilocksField {
322
309
type Output = Self ;
323
- # [ inline ]
310
+
324
311
fn bitor ( self , b : GoldilocksField ) -> GoldilocksField {
325
312
Self ( self . 0 | b. 0 )
326
313
}
0 commit comments