sqward: niemniej, istnieje kompilator, który produkuje pętlę z dbcc. I największy problem, podejrzewam, to nie to, czy on ją produkuje, czy nie, tylko że taka konstrukcja, jak pętla do-while z 16-bitowym licznikiem liczaca wstecz do -1, jest raczej mało prawdopodobna w programie napisanym w C. Gros pętli to przecież for (), potem while(), a do-while daleko w tyle.
Z tym mnożeniem i dzieleniem troche przesadziłem jednak:
1) m68k divs: 158 cykli plus obliczenie adresu efektywnego (np. natychmiastowy 16-bit 4 cykle, czyli razem 162)
- 68010: 122
2) m68k divu: 140 cykli (plus j.w.)
- 68010: 108
3) m68k muls: 70 cykli (j.w.)
- 68010: 42
4) m68k mulu: 70 cykli (j.w.)
- 68010: 40
Wszystko to sa czasy maksymalne, ale: "the divide algorithm used by the MC68000 provides less than 10% difference between the best- and worst-case timings. The multiply algorithm requires 38+2*n clocks, where n is defined as:
- mulu: n = the number of ones in <ea>
- muls: n = concatenate the <ea> with a zero as the LSB; n is the resultant number of 10 or 01 patterns in the 17 bit source, i.e. the wors case happens when the source is $5555".
KMK
? HEX$(6670358)