@@ -591,7 +591,7 @@ RIGHT_EXTEND_(32,64)
591591
592592#define LEFT_SHIFT_ (log , bits ) \
593593static inline void left_shift_helper_##bits(bool with, frameItem* dst, frameItem *src) { \
594- static_assert(log <= 8, "Only log parameter upto 8 is supported."); \
594+ static_assert(log <= 8, "Only log parameter up to 8 is supported."); \
595595 uint_fast8_t amt = simplicity_read##log(src); \
596596 uint_fast##bits##_t output = simplicity_read##bits(src); \
597597 if (with) output = UINT##bits##_MAX ^ output; \
@@ -625,7 +625,7 @@ LEFT_SHIFT_(8,64)
625625
626626#define RIGHT_SHIFT_ (log , bits ) \
627627static inline void right_shift_helper_##bits(bool with, frameItem* dst, frameItem *src) { \
628- static_assert(log <= 8, "Only log parameter upto 8 is supported."); \
628+ static_assert(log <= 8, "Only log parameter up to 8 is supported."); \
629629 uint_fast8_t amt = simplicity_read##log(src); \
630630 uint_fast##bits##_t output = simplicity_read##bits(src); \
631631 if (with) output = UINT##bits##_MAX ^ output; \
@@ -1046,7 +1046,7 @@ DIVIDES_(64)
10461046/* Implements the 3n/2n division algorithm for n=32 bits.
10471047 * For more details see "Fast Recursive Division" by Christoph Burnikel and Joachim Ziegler, MPI-I-98-1-022, Oct. 1998.
10481048 *
1049- * Given a 96 bit (unsigned) value A and a 64 bit value B, set *q and *r to the quotent and remainder of A divided by B.
1049+ * Given a 96 bit (unsigned) value A and a 64 bit value B, set *q and *r to the quotient and remainder of A divided by B.
10501050 *
10511051 * ah is passed the high 64 bits of A, and al is passed the low 32 bits of A.
10521052 * We say that A = [ah;al] where [ah;al] denotes ah * 2^32 + al.
@@ -1067,7 +1067,7 @@ DIVIDES_(64)
10671067 *
10681068 * Preconditon 2 ensures that this estimate is close to the true value of Q. In fact Q <= estQ <= Q + 2 (see proof below)
10691069 *
1070- * There is a corresponding estR value satifying the equation estR = A - estQ * B.
1070+ * There is a corresponding estR value satisfying the equation estR = A - estQ * B.
10711071 * This estR is one of {R, R - B, R - 2B}.
10721072 * Therefore if estR is non-negative, then estR is equal to the true R value, and hence estQ is equal to the true Q value.
10731073 *
@@ -1085,7 +1085,7 @@ DIVIDES_(64)
10851085 *
10861086 * Lemma 2: estQ < [1;2] (== 2^32 + 2).
10871087 * First note that ah - [bh;0] < [1;0] because
1088- * ah < B (by precondtion 1)
1088+ * ah < B (by precondition 1)
10891089 * < [bh+1;0]
10901090 * == [bh;0] + [1;0]
10911091 *
@@ -1116,7 +1116,7 @@ static void div_mod_96_64(uint_fast32_t *q, uint_fast64_t *r,
11161116 /* B == b == [bh;bl] */
11171117 uint_fast64_t estQ = ah / bh ;
11181118
1119- /* Precondition 1 guarentees Q is 32-bits, if estQ is greater than UINT32_MAX, then reduce our initial estimated quotient to UINT32_MAX. */
1119+ /* Precondition 1 guarantees Q is 32-bits, if estQ is greater than UINT32_MAX, then reduce our initial estimated quotient to UINT32_MAX. */
11201120 * q = estQ <= UINT32_MAX ? (uint_fast32_t )estQ : UINT32_MAX ;
11211121
11221122 /* *q * bh <= estQ * bh <= ah */
@@ -1131,7 +1131,7 @@ static void div_mod_96_64(uint_fast32_t *q, uint_fast64_t *r,
11311131 * This value is negative when [rh;al] < d.
11321132 * Note that d is 64 bit and thus if rh is greater than UINT32_MAX, then this value cannot be negative.
11331133 */
1134- /* This loop is exectued at most twice. */
1134+ /* This loop is executed at most twice. */
11351135 while (rh <= UINT32_MAX && 0x100000000u * rh + al < d ) {
11361136 /* Our estimated remainder, A - *q * B is negative. */
11371137 /* 0 < d == *q * bl and hence 0 < *q, so this decrement does not underflow. */
@@ -1173,7 +1173,7 @@ bool simplicity_div_mod_128_64(frameItem* dst, frameItem src, const txEnv* env)
11731173 * RR
11741174 *
11751175 * First divide the high 3 "digit"s (96-bits) of A by the two "digit"s (64-bits) of B,
1176- * returning the first "digit" (high 32-bits) of the quotient, and an intermediate remainer consisiting of 2 "digit"s (64-bits).
1176+ * returning the first "digit" (high 32-bits) of the quotient, and an intermediate remainder consisiting of 2 "digit"s (64-bits).
11771177 */
11781178 div_mod_96_64 (& qh , & r , ah , am , b );
11791179 simplicity_debug_assert (r < b );
@@ -1187,8 +1187,8 @@ bool simplicity_div_mod_128_64(frameItem* dst, frameItem src, const txEnv* env)
11871187 * ---
11881188 * RR
11891189 *
1190- * Then append the last "digit" of A to the intermidiate remainder and divide that value (96_bits) by the two "digit"s (64-bits) of B,
1191- * returning the second "digit" (low 32-bits) of the quotient, and the final remainer consisiting of 2 "digit"s (64-bits).
1190+ * Then append the last "digit" of A to the intermediate remainder and divide that value (96_bits) by the two "digit"s (64-bits) of B,
1191+ * returning the second "digit" (low 32-bits) of the quotient, and the final remainder consisiting of 2 "digit"s (64-bits).
11921192 */
11931193 div_mod_96_64 (& ql , & r , r , al , b );
11941194 simplicity_write32 (dst , qh );
0 commit comments