[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

Jan Egil Ruud
URL:
  <http://savannah.nongnu.org/patch/?9187>

                 Summary: [AVR_TINY]: Support 16-bit xtoa functons and more
string functions.
                 Project: AVR C Runtime Library
            Submitted by: gjlayde
            Submitted on: Fri 09 Dec 2016 01:02:16 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This improves support for AVR_TINY architecture.

It'a collection of low hanging fruit from from /libc/misc/ and libc/string,
mostly achieved by

* Using new X_sbiw instead of sbiw
* Replace r0 by __tmp_reg__


        * common/asmdef.h (X_sbiw): New asm macro.
        * common/macros.inc (X_sbiw): New asm macro.
        * libc/misc/itoa.S: Don't restrict to !AVR_TINY.
        * libc/misc/itoa_ncheck.S: Same.
        * libc/misc/utoa.S: Same.
        * libc/misc/utoa_ncheck.S: Same. And use X_sbiw instead of sbiw.
        * libc/string/strlcat.S: Same.
        * libc/string/strncat.S: Same.
        * libc/string/strrev.S: Same.
        * libc/string/strrchr.S: Same.
        * libc/string/memchr.S: Don't restrict to !AVR_TINY.
        [AVR_TINY]: Use "ld __tmp_reg__,-R" instead of "sbiw R,1".
        * libc/string/strcat.S: Same.
        * libc/string/strchr.S: Same.
        * libc/string/memrchr.S: Don't restrict to !AVR_TINY.
        (r0): Use __tmp_reg__ instead.
        (adiw ZL,0): Use X_sbiw ZL,0 for comparison against 0 instead.
        * libc/string/strchrnul.S: Don't restrict to !AVR_TINY.
        (r0): Use __tmp_reg__ instead.
        [AVR_TINY]: Use "ld __tmp_reg__,-R" instead of "sbiw R,1".
        * libc/string/strpbrk.S: Same.
        * libc/string/strstr.S: Don't restrict to !AVR_TINY.
        Use X_sbiw instead of sbiw.
        (chr2): Define to __tmp_reg__ instead of to r0.
        * libc/string/strtok_r.S: Don't restrict to !AVR_TINY.
        Use X_sbiw instead of sbiw.
        (dch) [AVR_TINY]: Push / pop r18 around function.
        [AVR_TINY]: Use "ld __tmp_reg__,R+" instead of "adiw R,1".




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 09 Dec 2016 01:02:16 PM GMT  Name: alibc-tiny-1.diff  Size: 12kB  
By: gjlayde
Patch against trunk
<http://savannah.nongnu.org/patch/download.php?file_id=39181>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|

[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

Jan Egil Ruud
Additional Item Attachment, patch #9187 (project avr-libc):

File name: alibc-tiny-2.diff              Size:12 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|

[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

Jan Egil Ruud
Additional Item Attachment, patch #9187 (project avr-libc):

File name: alibc-tiny-3.diff              Size:12 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

George Spelvin
Generally looks good.

There are a couple of places (strlcat.S, strncat.S) where you don't
look at the flags after decremeninting a pointer, and could use a single
"ld __tmp_reg__,-X" instruction rather than the two-instruction X_sbiw
emulation.

(In strrchr.S and strstr.S, it's decrementing r25:r24, so that can't work.)

_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|

[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

Jan Egil Ruud
In reply to this post by Jan Egil Ruud
Follow-up Comment #1, patch #9187 (project avr-libc):

Ping #1

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
Reply | Threaded
Open this post in threaded view
|

[patch #9187] [AVR_TINY]: Support 16-bit xtoa functons and more string functions.

Jan Egil Ruud
Update of patch #9187 (project avr-libc):

                  Status:                    None => Done                  
             Assigned to:                    None => joerg_wunsch          
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #2:

Added in r2542.

Thanks a lot, also for the nice ChangeLog entry!

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?9187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev