Fix some example code

This commit is contained in:
Justine Tunney 2021-08-10 13:38:27 -07:00
parent 79ba5233db
commit 31a37aeb1a
3 changed files with 10 additions and 11 deletions

View file

@ -36,9 +36,8 @@ uint64_t Modulus(uint64_t x, struct Modulus m) {
}
int main(int argc, char *argv[]) {
printf("%lx %% %d = %d\n", 3, 23, Modulus(23, GetModulus(3)));
printf("%lx %% %d = %d\n", 3, 23,
Modulus(0xf5bd76d4c3c91f47, GetModulus(34)));
printf("%#lx %% %d = %d\n", 0x23, 3, Modulus(23, GetModulus(3)));
printf("%#lx %% %d = %d\n", 0x123, 17, Modulus(0x123, GetModulus(17)));
volatile struct Modulus v = GetModulus(3);
volatile uint64_t x = 23, y = 3, z;
EZBENCH2("modulus", donothing, z = x % y);

View file

@ -17,10 +17,10 @@ COSMOPOLITAN_C_START_
* 0xffffffff 0 0 1 31 0
*/
int bsf(int);
int bsfl(long);
int bsfll(long long);
int bsfmax(uintmax_t);
int bsf(int) pureconst;
int bsfl(long) pureconst;
int bsfll(long long) pureconst;
int bsfmax(uintmax_t) pureconst;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define bsf(u) \

View file

@ -17,10 +17,10 @@ COSMOPOLITAN_C_START_
* 0xffffffff 0 0 1 31 0
*/
int bsr(int);
int bsrl(long);
int bsrll(long long);
int bsrmax(uintmax_t);
int bsr(int) pureconst;
int bsrl(long) pureconst;
int bsrll(long long) pureconst;
int bsrmax(uintmax_t) pureconst;
#if defined(__GNUC__) && defined(__x86_64__) && !defined(__STRICT_ANSI__)
#define bsr(u) \