simfony_as_rust/jet/arithmetic.rs
1/* This file has been automatically generated. */
2
3//! # Arithmetic
4//!
5//! This module defines jets that compute arithmetic functions.
6
7#![allow(unused)]
8#![allow(clippy::complexity)]
9
10use super::*;
11
12/// Add two integers and return the carry.
13///
14/// ## Cost
15///
16/// 112 mWU _(milli weight units)_
17pub fn add_8(a: u8, b: u8) -> (bool, u8) {
18 todo!()
19}
20
21/// Add two integers and return the carry.
22///
23/// ## Cost
24///
25/// 108 mWU _(milli weight units)_
26pub fn add_16(a: u16, b: u16) -> (bool, u16) {
27 todo!()
28}
29
30/// Add two integers and return the carry.
31///
32/// ## Cost
33///
34/// 117 mWU _(milli weight units)_
35pub fn add_32(a: u32, b: u32) -> (bool, u32) {
36 todo!()
37}
38
39/// Add two integers and return the carry.
40///
41/// ## Cost
42///
43/// 109 mWU _(milli weight units)_
44pub fn add_64(a: u64, b: u64) -> (bool, u64) {
45 todo!()
46}
47
48/// Decrement an integer by one and return the borrow bit.
49///
50/// ## Cost
51///
52/// 79 mWU _(milli weight units)_
53pub fn decrement_8(a: u8) -> (bool, u8) {
54 todo!()
55}
56
57/// Decrement an integer by one and return the borrow bit.
58///
59/// ## Cost
60///
61/// 85 mWU _(milli weight units)_
62pub fn decrement_16(a: u16) -> (bool, u16) {
63 todo!()
64}
65
66/// Decrement an integer by one and return the borrow bit.
67///
68/// ## Cost
69///
70/// 91 mWU _(milli weight units)_
71pub fn decrement_32(a: u32) -> (bool, u32) {
72 todo!()
73}
74
75/// Decrement an integer by one and return the borrow bit.
76///
77/// ## Cost
78///
79/// 89 mWU _(milli weight units)_
80pub fn decrement_64(a: u64) -> (bool, u64) {
81 todo!()
82}
83
84/// Divide the first integer by the second integer, and return the remainder.
85///
86/// ## Cost
87///
88/// 128 mWU _(milli weight units)_
89pub fn div_mod_8(a: u8, b: u8) -> (u8, u8) {
90 todo!()
91}
92
93/// Divide the first integer by the second integer, and return the remainder.
94///
95/// ## Cost
96///
97/// 118 mWU _(milli weight units)_
98pub fn div_mod_16(a: u16, b: u16) -> (u16, u16) {
99 todo!()
100}
101
102/// Divide the first integer by the second integer, and return the remainder.
103///
104/// ## Cost
105///
106/// 115 mWU _(milli weight units)_
107pub fn div_mod_32(a: u32, b: u32) -> (u32, u32) {
108 todo!()
109}
110
111/// Divide the first integer by the second integer, and return the remainder.
112///
113/// ## Cost
114///
115/// 86 mWU _(milli weight units)_
116pub fn div_mod_64(a: u64, b: u64) -> (u64, u64) {
117 todo!()
118}
119
120/// Divide the 128-bit integer `a` by the 64-bit integer `b`.
121/// Return a tuple of the quotient `q` and the remainer `r`.
122///
123/// Use this jet to recursively define wide integer divisions.
124///
125/// ## Preconditions
126/// 1. `q` < 2^64
127/// 2. 2^63 ≤ `b`
128///
129/// Return `(u64::MAX, u64::MAX)` when the preconditions are not satisfied.
130///
131/// ## Cost
132///
133/// 208 mWU _(milli weight units)_
134pub fn div_mod_128_64(a: u128, b: u64) -> (u64, u64) {
135 todo!()
136}
137
138/// Divide the first integer by the second integer.
139///
140/// ## Cost
141///
142/// 108 mWU _(milli weight units)_
143pub fn divide_8(a: u8, b: u8) -> u8 {
144 todo!()
145}
146
147/// Divide the first integer by the second integer.
148///
149/// ## Cost
150///
151/// 98 mWU _(milli weight units)_
152pub fn divide_16(a: u16, b: u16) -> u16 {
153 todo!()
154}
155
156/// Divide the first integer by the second integer.
157///
158/// ## Cost
159///
160/// 100 mWU _(milli weight units)_
161pub fn divide_32(a: u32, b: u32) -> u32 {
162 todo!()
163}
164
165/// Divide the first integer by the second integer.
166///
167/// ## Cost
168///
169/// 101 mWU _(milli weight units)_
170pub fn divide_64(a: u64, b: u64) -> u64 {
171 todo!()
172}
173
174/// Check if the first integer is divisible by the second integer.
175///
176/// ## Cost
177///
178/// 98 mWU _(milli weight units)_
179pub fn divides_8(a: u8, b: u8) -> bool {
180 todo!()
181}
182
183/// Check if the first integer is divisible by the second integer.
184///
185/// ## Cost
186///
187/// 93 mWU _(milli weight units)_
188pub fn divides_16(a: u16, b: u16) -> bool {
189 todo!()
190}
191
192/// Check if the first integer is divisible by the second integer.
193///
194/// ## Cost
195///
196/// 87 mWU _(milli weight units)_
197pub fn divides_32(a: u32, b: u32) -> bool {
198 todo!()
199}
200
201/// Check if the first integer is divisible by the second integer.
202///
203/// ## Cost
204///
205/// 91 mWU _(milli weight units)_
206pub fn divides_64(a: u64, b: u64) -> bool {
207 todo!()
208}
209
210/// Add two integers. Take a carry-in and return a carry-out.
211///
212/// ## Cost
213///
214/// 127 mWU _(milli weight units)_
215pub fn full_add_8(a: bool, b: u8, c: u8) -> (bool, u8) {
216 todo!()
217}
218
219/// Add two integers. Take a carry-in and return a carry-out.
220///
221/// ## Cost
222///
223/// 121 mWU _(milli weight units)_
224pub fn full_add_16(a: bool, b: u16, c: u16) -> (bool, u16) {
225 todo!()
226}
227
228/// Add two integers. Take a carry-in and return a carry-out.
229///
230/// ## Cost
231///
232/// 119 mWU _(milli weight units)_
233pub fn full_add_32(a: bool, b: u32, c: u32) -> (bool, u32) {
234 todo!()
235}
236
237/// Add two integers. Take a carry-in and return a carry-out.
238///
239/// ## Cost
240///
241/// 121 mWU _(milli weight units)_
242pub fn full_add_64(a: bool, b: u64, c: u64) -> (bool, u64) {
243 todo!()
244}
245
246/// Decrement an integer by one. Take a borrow-in and return a borrow-out.
247///
248/// ## Cost
249///
250/// 91 mWU _(milli weight units)_
251pub fn full_decrement_8(a: bool, b: u8) -> (bool, u8) {
252 todo!()
253}
254
255/// Decrement an integer by one. Take a borrow-in and return a borrow-out.
256///
257/// ## Cost
258///
259/// 92 mWU _(milli weight units)_
260pub fn full_decrement_16(a: bool, b: u16) -> (bool, u16) {
261 todo!()
262}
263
264/// Decrement an integer by one. Take a borrow-in and return a borrow-out.
265///
266/// ## Cost
267///
268/// 107 mWU _(milli weight units)_
269pub fn full_decrement_32(a: bool, b: u32) -> (bool, u32) {
270 todo!()
271}
272
273/// Decrement an integer by one. Take a borrow-in and return a borrow-out.
274///
275/// ## Cost
276///
277/// 81 mWU _(milli weight units)_
278pub fn full_decrement_64(a: bool, b: u64) -> (bool, u64) {
279 todo!()
280}
281
282/// Increment an integer by one. Take a carry-in and return a carry-out.
283///
284/// ## Cost
285///
286/// 72 mWU _(milli weight units)_
287pub fn full_increment_8(a: bool, b: u8) -> (bool, u8) {
288 todo!()
289}
290
291/// Increment an integer by one. Take a carry-in and return a carry-out.
292///
293/// ## Cost
294///
295/// 89 mWU _(milli weight units)_
296pub fn full_increment_16(a: bool, b: u16) -> (bool, u16) {
297 todo!()
298}
299
300/// Increment an integer by one. Take a carry-in and return a carry-out.
301///
302/// ## Cost
303///
304/// 104 mWU _(milli weight units)_
305pub fn full_increment_32(a: bool, b: u32) -> (bool, u32) {
306 todo!()
307}
308
309/// Increment an integer by one. Take a carry-in and return a carry-out.
310///
311/// ## Cost
312///
313/// 99 mWU _(milli weight units)_
314pub fn full_increment_64(a: bool, b: u64) -> (bool, u64) {
315 todo!()
316}
317
318/// Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
319///
320/// ## Cost
321///
322/// 109 mWU _(milli weight units)_
323pub fn full_multiply_8(a: (u8, u8), b: (u8, u8)) -> u16 {
324 todo!()
325}
326
327/// Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
328///
329/// ## Cost
330///
331/// 112 mWU _(milli weight units)_
332pub fn full_multiply_16(a: (u16, u16), b: (u16, u16)) -> u32 {
333 todo!()
334}
335
336/// Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
337///
338/// ## Cost
339///
340/// 96 mWU _(milli weight units)_
341pub fn full_multiply_32(a: (u32, u32), b: (u32, u32)) -> u64 {
342 todo!()
343}
344
345/// Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
346///
347/// ## Cost
348///
349/// 127 mWU _(milli weight units)_
350pub fn full_multiply_64(a: (u64, u64), b: (u64, u64)) -> u128 {
351 todo!()
352}
353
354/// Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
355///
356/// ## Cost
357///
358/// 126 mWU _(milli weight units)_
359pub fn full_subtract_8(a: bool, b: u8, c: u8) -> (bool, u8) {
360 todo!()
361}
362
363/// Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
364///
365/// ## Cost
366///
367/// 121 mWU _(milli weight units)_
368pub fn full_subtract_16(a: bool, b: u16, c: u16) -> (bool, u16) {
369 todo!()
370}
371
372/// Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
373///
374/// ## Cost
375///
376/// 116 mWU _(milli weight units)_
377pub fn full_subtract_32(a: bool, b: u32, c: u32) -> (bool, u32) {
378 todo!()
379}
380
381/// Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
382///
383/// ## Cost
384///
385/// 98 mWU _(milli weight units)_
386pub fn full_subtract_64(a: bool, b: u64, c: u64) -> (bool, u64) {
387 todo!()
388}
389
390/// Increment an integer by one and return the carry.
391///
392/// ## Cost
393///
394/// 85 mWU _(milli weight units)_
395pub fn increment_8(a: u8) -> (bool, u8) {
396 todo!()
397}
398
399/// Increment an integer by one and return the carry.
400///
401/// ## Cost
402///
403/// 69 mWU _(milli weight units)_
404pub fn increment_16(a: u16) -> (bool, u16) {
405 todo!()
406}
407
408/// Increment an integer by one and return the carry.
409///
410/// ## Cost
411///
412/// 92 mWU _(milli weight units)_
413pub fn increment_32(a: u32) -> (bool, u32) {
414 todo!()
415}
416
417/// Increment an integer by one and return the carry.
418///
419/// ## Cost
420///
421/// 87 mWU _(milli weight units)_
422pub fn increment_64(a: u64) -> (bool, u64) {
423 todo!()
424}
425
426/// Check if an integer is one.
427///
428/// ## Cost
429///
430/// 91 mWU _(milli weight units)_
431pub fn is_one_8(a: u8) -> bool {
432 todo!()
433}
434
435/// Check if an integer is one.
436///
437/// ## Cost
438///
439/// 82 mWU _(milli weight units)_
440pub fn is_one_16(a: u16) -> bool {
441 todo!()
442}
443
444/// Check if an integer is one.
445///
446/// ## Cost
447///
448/// 65 mWU _(milli weight units)_
449pub fn is_one_32(a: u32) -> bool {
450 todo!()
451}
452
453/// Check if an integer is one.
454///
455/// ## Cost
456///
457/// 83 mWU _(milli weight units)_
458pub fn is_one_64(a: u64) -> bool {
459 todo!()
460}
461
462/// Check if an integer is zero.
463///
464/// ## Cost
465///
466/// 77 mWU _(milli weight units)_
467pub fn is_zero_8(a: u8) -> bool {
468 todo!()
469}
470
471/// Check if an integer is zero.
472///
473/// ## Cost
474///
475/// 75 mWU _(milli weight units)_
476pub fn is_zero_16(a: u16) -> bool {
477 todo!()
478}
479
480/// Check if an integer is zero.
481///
482/// ## Cost
483///
484/// 85 mWU _(milli weight units)_
485pub fn is_zero_32(a: u32) -> bool {
486 todo!()
487}
488
489/// Check if an integer is zero.
490///
491/// ## Cost
492///
493/// 80 mWU _(milli weight units)_
494pub fn is_zero_64(a: u64) -> bool {
495 todo!()
496}
497
498/// Check if an integer is less than or equal to another integer.
499///
500/// ## Cost
501///
502/// 109 mWU _(milli weight units)_
503pub fn le_8(a: u8, b: u8) -> bool {
504 todo!()
505}
506
507/// Check if an integer is less than or equal to another integer.
508///
509/// ## Cost
510///
511/// 112 mWU _(milli weight units)_
512pub fn le_16(a: u16, b: u16) -> bool {
513 todo!()
514}
515
516/// Check if an integer is less than or equal to another integer.
517///
518/// ## Cost
519///
520/// 93 mWU _(milli weight units)_
521pub fn le_32(a: u32, b: u32) -> bool {
522 todo!()
523}
524
525/// Check if an integer is less than or equal to another integer.
526///
527/// ## Cost
528///
529/// 93 mWU _(milli weight units)_
530pub fn le_64(a: u64, b: u64) -> bool {
531 todo!()
532}
533
534/// Check if an integer is less than another integer.
535///
536/// ## Cost
537///
538/// 107 mWU _(milli weight units)_
539pub fn lt_8(a: u8, b: u8) -> bool {
540 todo!()
541}
542
543/// Check if an integer is less than another integer.
544///
545/// ## Cost
546///
547/// 123 mWU _(milli weight units)_
548pub fn lt_16(a: u16, b: u16) -> bool {
549 todo!()
550}
551
552/// Check if an integer is less than another integer.
553///
554/// ## Cost
555///
556/// 107 mWU _(milli weight units)_
557pub fn lt_32(a: u32, b: u32) -> bool {
558 todo!()
559}
560
561/// Check if an integer is less than another integer.
562///
563/// ## Cost
564///
565/// 76 mWU _(milli weight units)_
566pub fn lt_64(a: u64, b: u64) -> bool {
567 todo!()
568}
569
570/// Return the bigger of two integers.
571///
572/// ## Cost
573///
574/// 96 mWU _(milli weight units)_
575pub fn max_8(a: u8, b: u8) -> u8 {
576 todo!()
577}
578
579/// Return the bigger of two integers.
580///
581/// ## Cost
582///
583/// 114 mWU _(milli weight units)_
584pub fn max_16(a: u16, b: u16) -> u16 {
585 todo!()
586}
587
588/// Return the bigger of two integers.
589///
590/// ## Cost
591///
592/// 92 mWU _(milli weight units)_
593pub fn max_32(a: u32, b: u32) -> u32 {
594 todo!()
595}
596
597/// Return the bigger of two integers.
598///
599/// ## Cost
600///
601/// 104 mWU _(milli weight units)_
602pub fn max_64(a: u64, b: u64) -> u64 {
603 todo!()
604}
605
606/// Return the median of three integers.
607///
608/// ## Cost
609///
610/// 122 mWU _(milli weight units)_
611pub fn median_8(a: u8, b: u8, c: u8) -> u8 {
612 todo!()
613}
614
615/// Return the median of three integers.
616///
617/// ## Cost
618///
619/// 123 mWU _(milli weight units)_
620pub fn median_16(a: u16, b: u16, c: u16) -> u16 {
621 todo!()
622}
623
624/// Return the median of three integers.
625///
626/// ## Cost
627///
628/// 101 mWU _(milli weight units)_
629pub fn median_32(a: u32, b: u32, c: u32) -> u32 {
630 todo!()
631}
632
633/// Return the median of three integers.
634///
635/// ## Cost
636///
637/// 109 mWU _(milli weight units)_
638pub fn median_64(a: u64, b: u64, c: u64) -> u64 {
639 todo!()
640}
641
642/// Return the smaller of two integers.
643///
644/// ## Cost
645///
646/// 99 mWU _(milli weight units)_
647pub fn min_8(a: u8, b: u8) -> u8 {
648 todo!()
649}
650
651/// Return the smaller of two integers.
652///
653/// ## Cost
654///
655/// 97 mWU _(milli weight units)_
656pub fn min_16(a: u16, b: u16) -> u16 {
657 todo!()
658}
659
660/// Return the smaller of two integers.
661///
662/// ## Cost
663///
664/// 113 mWU _(milli weight units)_
665pub fn min_32(a: u32, b: u32) -> u32 {
666 todo!()
667}
668
669/// Return the smaller of two integers.
670///
671/// ## Cost
672///
673/// 102 mWU _(milli weight units)_
674pub fn min_64(a: u64, b: u64) -> u64 {
675 todo!()
676}
677
678/// Compute the remainder after dividing both integers.
679///
680/// ## Cost
681///
682/// 102 mWU _(milli weight units)_
683pub fn modulo_8(a: u8, b: u8) -> u8 {
684 todo!()
685}
686
687/// Compute the remainder after dividing both integers.
688///
689/// ## Cost
690///
691/// 103 mWU _(milli weight units)_
692pub fn modulo_16(a: u16, b: u16) -> u16 {
693 todo!()
694}
695
696/// Compute the remainder after dividing both integers.
697///
698/// ## Cost
699///
700/// 102 mWU _(milli weight units)_
701pub fn modulo_32(a: u32, b: u32) -> u32 {
702 todo!()
703}
704
705/// Compute the remainder after dividing both integers.
706///
707/// ## Cost
708///
709/// 85 mWU _(milli weight units)_
710pub fn modulo_64(a: u64, b: u64) -> u64 {
711 todo!()
712}
713
714/// Multiply two integers. The output is a 16-bit integer.
715///
716/// ## Cost
717///
718/// 93 mWU _(milli weight units)_
719pub fn multiply_8(a: u8, b: u8) -> u16 {
720 todo!()
721}
722
723/// Multiply two integers. The output is a 32-bit integer.
724///
725/// ## Cost
726///
727/// 90 mWU _(milli weight units)_
728pub fn multiply_16(a: u16, b: u16) -> u32 {
729 todo!()
730}
731
732/// Multiply two integers. The output is a 64-bit integer.
733///
734/// ## Cost
735///
736/// 90 mWU _(milli weight units)_
737pub fn multiply_32(a: u32, b: u32) -> u64 {
738 todo!()
739}
740
741/// Multiply two integers. The output is a 128-bit integer.
742///
743/// ## Cost
744///
745/// 85 mWU _(milli weight units)_
746pub fn multiply_64(a: u64, b: u64) -> u128 {
747 todo!()
748}
749
750/// Negate the integer (modulo 2⁸) and return the borrow bit.
751///
752/// ## Cost
753///
754/// 91 mWU _(milli weight units)_
755pub fn negate_8(a: u8) -> (bool, u8) {
756 todo!()
757}
758
759/// Negate the integer (modulo 2¹⁶) and return the borrow bit.
760///
761/// ## Cost
762///
763/// 70 mWU _(milli weight units)_
764pub fn negate_16(a: u16) -> (bool, u16) {
765 todo!()
766}
767
768/// Negate the integer (modulo 2³²) and return the borrow bit.
769///
770/// ## Cost
771///
772/// 85 mWU _(milli weight units)_
773pub fn negate_32(a: u32) -> (bool, u32) {
774 todo!()
775}
776
777/// Negate the integer (modulo 2⁶⁴) and return the borrow bit.
778///
779/// ## Cost
780///
781/// 94 mWU _(milli weight units)_
782pub fn negate_64(a: u64) -> (bool, u64) {
783 todo!()
784}
785
786/// Return 1 as an 8-bit integer.
787///
788/// ## Cost
789///
790/// 62 mWU _(milli weight units)_
791pub fn one_8() -> u8 {
792 todo!()
793}
794
795/// Return 1 as a 16-bit integer.
796///
797/// ## Cost
798///
799/// 60 mWU _(milli weight units)_
800pub fn one_16() -> u16 {
801 todo!()
802}
803
804/// Return 1 as a 32-bit integer.
805///
806/// ## Cost
807///
808/// 59 mWU _(milli weight units)_
809pub fn one_32() -> u32 {
810 todo!()
811}
812
813/// Return 1 as a 64-bit integer.
814///
815/// ## Cost
816///
817/// 59 mWU _(milli weight units)_
818pub fn one_64() -> u64 {
819 todo!()
820}
821
822/// Subtract the second integer from the first integer, and return the borrow bit.
823///
824/// ## Cost
825///
826/// 109 mWU _(milli weight units)_
827pub fn subtract_8(a: u8, b: u8) -> (bool, u8) {
828 todo!()
829}
830
831/// Subtract the second integer from the first integer, and return the borrow bit.
832///
833/// ## Cost
834///
835/// 113 mWU _(milli weight units)_
836pub fn subtract_16(a: u16, b: u16) -> (bool, u16) {
837 todo!()
838}
839
840/// Subtract the second integer from the first integer, and return the borrow bit.
841///
842/// ## Cost
843///
844/// 118 mWU _(milli weight units)_
845pub fn subtract_32(a: u32, b: u32) -> (bool, u32) {
846 todo!()
847}
848
849/// Subtract the second integer from the first integer, and return the borrow bit.
850///
851/// ## Cost
852///
853/// 115 mWU _(milli weight units)_
854pub fn subtract_64(a: u64, b: u64) -> (bool, u64) {
855 todo!()
856}