1 /* See if ADOX give expected results */
7 static uint64_t adoxq(bool *c_out
, uint64_t a
, uint64_t b
, bool c
)
9 asm ("addl $0x7fffffff, %k1\n\t"
12 : "+r"(a
), "=&r"(c
) : "r"(b
), "1"((int)c
));
17 static uint64_t adoxl(bool *c_out
, uint64_t a
, uint64_t b
, bool c
)
19 asm ("addl $0x7fffffff, %k1\n\t"
22 : "+r"(a
), "=&r"(c
) : "r"(b
), "1"((int)c
));
32 r
= adoxq(&c
, 0, 0, 0);
36 r
= adoxl(&c
, 0, 0, 0);
40 r
= adoxl(&c
, 0x100000000, 0, 0);
44 r
= adoxq(&c
, 0, 0, 1);
48 r
= adoxl(&c
, 0, 0, 1);
52 r
= adoxq(&c
, -1, -1, 0);
56 r
= adoxl(&c
, -1, -1, 0);
57 assert(r
== 0xfffffffe);
60 r
= adoxq(&c
, -1, -1, 1);
64 r
= adoxl(&c
, -1, -1, 1);
65 assert(r
== 0xffffffff);