Changeset 1360 for trunk/tigcc/archive/qsort.c
- Timestamp:
- 07/24/09 18:55:27 (3 years ago)
- File:
-
- 1 edited
-
trunk/tigcc/archive/qsort.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tigcc/archive/qsort.c
r1359 r1360 7 7 // For sorting data that has no significant statistical property, on embedded platforms 8 8 // 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);9 void qsort(void *list asm("a0"), short num_items asm("d0"), short size asm("d1"), compare_t cmp_func asm("a2")) __ATTR_LIB_ASM__; 10 10 11 11 asm(" … … 23 23 .globl qsort 24 24 qsort: 25 movem.l %d3-%d7/%a 2-%a4/%a6,-(%sp)25 movem.l %d3-%d7/%a3-%a4/%a6,-(%sp) 26 26 move.l %a0,%a4 ;# list, list 27 27 move.w %d1,%d7 ;# size, size 28 move.l %a1,%a2 ;# cmp_func, cmp_func29 28 move.w #4096,%d5 ;#, k 30 29 cmp.w #16,%d0 ;#, num_items … … 85 84 bne.s .L6 ;# 86 85 87 movem.l (%sp)+,%d3-%d7/%a 2-%a4/%a686 movem.l (%sp)+,%d3-%d7/%a3-%a4/%a6 88 87 rts 89 88 "); … … 193 192 rts 194 193 */ 195 // In s ix steps, 30bytes 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.
