bugAVR C Runtime Library - Bugs: bug #18994, minor optimization possible to...

 
 

bug #18994: minor optimization possible to stdlib functions isspace(), isprint(), and islower()

Submitted by:  None
Submitted on:  Thu 08 Feb 2007 11:14:47 AM UTC  
 
Category: LibrarySeverity: 3 - Normal
Priority: 9 - ImmediateItem Group: libc code
Status: FixedPercent Complete: 0%
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 08 Feb 2007 11:14:47 AM UTC, original submission:

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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dmix (Updated the item)
  • -unavailable- added by arcanum (Updated the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 16 Dec 2007 03:01:09 AM UTCdmixOpen/ClosedOpen=>Closed
    Sun 16 Dec 2007 02:59:23 AM UTCdmixStatusNone=>Fixed
    Wed 12 Sep 2007 08:47:22 PM UTCarcanumPriority5 - Normal=>9 - Immediate

    Back to the top


    Powered by Savane 3.1-cleanup1