URL:
  <http://savannah.nongnu.org/bugs/?18994>

                 Summary: minor optimization possible to stdlib functions
isspace(), isprint(), and islower()
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Thursday 02/08/07 at 11:14 UTC
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: libc code
                  Status: None
                 Privacy: Public
        Percent Complete: 0%
             Assigned to: None
        Originator Email: [EMAIL PROTECTED]
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The stdlib function isdigit uses a compact way to test if input is within a
given range:

GLOBAL(isdigit)
          CPSE  rHigh,__zero_reg__
1:        
          RJMP  _U(__ctype_isfalse)
          SUBI  rLow,'0'
          SUBI  rLow,10
          BRSH  1b
          RET                      ; rLow: -10..-1

          ENDFUNC

Other functions in the same file (ctype.S) use the slightly larger
CPI-BRLT-CPI-BRGE combination to test the same thing. At least isspace,
isprint and islower could use a similar test as isdigit.




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18994>

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



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

Reply via email to