URL:
  <https://savannah.nongnu.org/patch/?10101>

                 Summary: util/crc16.h: improved _crc_xmodem_update (smaller &
faster)
                 Project: AVR C Runtime Library
            Submitted by: sten
            Submitted on: Sun 29 Aug 2021 09:20:55 PM UTC
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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 Attachments:


-------------------------------------------------------
Date: Sun 29 Aug 2021 09:20:55 PM UTC  Name: patch_crc_xmodem_update.txt 
Size: 2KiB   By: sten

<http://savannah.nongnu.org/patch/download.php?file_id=51830>
-------------------------------------------------------
Date: Sun 29 Aug 2021 09:20:55 PM UTC  Name: main.c  Size: 1KiB   By: sten

<http://savannah.nongnu.org/patch/download.php?file_id=51831>
-------------------------------------------------------
Date: Sun 29 Aug 2021 09:20:55 PM UTC  Name: orig_crc.c  Size: 116B   By: sten

<http://savannah.nongnu.org/patch/download.php?file_id=51832>
-------------------------------------------------------
Date: Sun 29 Aug 2021 09:20:55 PM UTC  Name: run_test.sh  Size: 51B   By: sten

<http://savannah.nongnu.org/patch/download.php?file_id=51833>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?10101>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


Reply via email to