The attached patch improves the _crc_xmodem_update algorithm. The improved algorithm uses 14 instructions instead of the original 25. Additionally the temporary variables have less strict constraints (=r instead of =d), and r0 is not clobbered.
I have successfully tested the new algorithm with all possible inputs (65536 * 256) against the original algorithm. The test was run in simulavr. See attached files main.c, orig_crc.c and run_test.sh
Sun 29 Aug 2021 11:20:55 PM CEST
The attached patch improves the _crc_xmodem_update algorithm. The improved algorithm uses 14 instructions instead of the original 25. Additionally the temporary variables have less strict constraints (=r instead of =d), and r0 is not clobbered.
I have successfully tested the new algorithm with all possible inputs (65536 * 256) against the original algorithm. The test was run in simulavr. See attached files main.c, orig_crc.c and run_test.sh
file #51833: run_test.sh file #51832: orig_crc.c file #51831: main.c file #51830: patch_crc_xmodem_update.txt
This issue was migrated from https://savannah.nongnu.org/patch/?10101