Ignore:
Timestamp:
07/24/09 18:55:27 (3 years ago)
Author:
debrouxl
Message:

library:

  • use explicit register parameters for Sprite8/16/32, bsearch and qsort;
  • regenerate headers;
  • 2-byte optimization in Sprite8: shift count can be computed differently.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tigcc/archive/qsort.c

    r1359 r1360  
    77// For sorting data that has no significant statistical property, on embedded platforms 
    88// without processor caches, the shell sort is one of the very best size/speed tradeoffs. 
    9 __ATTR_LIB_C__ void qsort(void *list, short num_items, short size, compare_t cmp_func); 
     9void qsort(void *list asm("a0"), short num_items asm("d0"), short size asm("d1"), compare_t cmp_func asm("a2")) __ATTR_LIB_ASM__; 
    1010 
    1111asm(" 
     
    2323        .globl qsort 
    2424qsort: 
    25         movem.l %d3-%d7/%a2-%a4/%a6,-(%sp) 
     25        movem.l %d3-%d7/%a3-%a4/%a6,-(%sp) 
    2626        move.l %a0,%a4  ;# list, list 
    2727        move.w %d1,%d7  ;# size, size 
    28         move.l %a1,%a2  ;# cmp_func, cmp_func 
    2928        move.w #4096,%d5        ;#, k 
    3029        cmp.w #16,%d0   ;#, num_items 
     
    8584        bne.s .L6       ;# 
    8685 
    87         movem.l (%sp)+,%d3-%d7/%a2-%a4/%a6 
     86        movem.l (%sp)+,%d3-%d7/%a3-%a4/%a6 
    8887        rts 
    8988"); 
     
    193192        rts 
    194193*/ 
    195 // In six steps, 30 bytes were saved, yielding the ASM routine at the top of this file. 
     194// In seven steps, 34 bytes were saved, yielding the ASM routine at the top of this file. 
Note: See TracChangeset for help on using the changeset viewer.