7 .c "%i/%i = %i (expected %i)\n"
13 #define generate_divider(operand) \
14 name divider_##operand \
19 divi %r2 %r1 operand \
23 generate_divider(32768)
25 #define generate_test_divider(divisor) \
26 name test_divider_##divisor \
27 test_divider_##divisor: \
37 bger done_##divisor %v0 %v1 \
41 finishi divider_##divisor \
44 divi %r0 %r2 divisor \
45 /* save div result */ \
56 /* reload div result */ \
58 beqr loop_##divisor %r0 %v2 \
59 /* return if failed */ \
64 generate_test_divider(8)
65 generate_test_divider(32768)
73 finishi test_divider_8
79 finishi test_divider_32768