avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #18994] minor optimization possible to stdlib functi


From: anonymous
Subject: [avr-libc-dev] [bug #18994] minor optimization possible to stdlib functions isspace(), isprint(), and islower()
Date: Thu, 08 Feb 2007 11:14:48 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

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: address@hidden
             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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]