The best should be to write a (small) asm replacement, but I do not know exactly how to do it (I can write the mullong.s, but how to convince the compiler to use it?)
Meanwhile I cleaned the C code for the long integer product (32x32->32), it uses a smaller local variable and replaces six 8x8->16 products (four of them should be 8x8->8, because the high byte is discarder) with two 16x16->16 multiplication.
The C code obviously works on all the ports, but it was developed with Z80 limitations in mind, that's why an #ifdef limits its use to the z80 environment. On the other ports this code MAY show a small gain in code size, but it SHOULD NOT give any speed improvement (or may be it slow down the library), that's why it is disabled.
Log in to post a comment.