Changeset 1360
- Timestamp:
- 07/24/09 18:55:27 (3 years ago)
- Location:
- trunk/tigcc
- Files:
-
- 16 edited
-
archive/bsearch.c (modified) (3 diffs)
-
archive/qsort.c (modified) (4 diffs)
-
archive/sprite16.s (modified) (4 diffs)
-
archive/sprite32.s (modified) (3 diffs)
-
archive/sprite8.s (modified) (3 diffs)
-
doc/System/Include/sprites.h/Sprite16.hsf (modified) (1 diff)
-
doc/System/Include/sprites.h/Sprite32.hsf (modified) (2 diffs)
-
doc/System/Include/sprites.h/Sprite8.hsf (modified) (1 diff)
-
doc/System/Include/sprites.h/sprites.hsh (modified) (1 diff)
-
doc/System/Include/stdlib.h/bsearch.hsf (modified) (1 diff)
-
doc/System/Include/stdlib.h/qsort.hsf (modified) (1 diff)
-
include/C/basfunc.h (modified) (1 diff)
-
include/C/estack.h (modified) (1 diff)
-
include/C/sprites.h (modified) (1 diff)
-
include/C/stdlib.h (modified) (2 diffs)
-
include/C/unknown.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tigcc/archive/bsearch.c
r1356 r1360 50 50 * look at item 3. 51 51 */ 52 __ATTR_LIB_C__ void *bsearch(const void *key, const void *bptr, short n, short w, compare_t cmp_func);52 void *bsearch(const void *key asm("a0"), const void *bptr asm("a1"), short n asm("d0"), short w asm("d1"), compare_t cmp_func asm("a2")) __ATTR_LIB_ASM__; 53 53 asm(" 54 54 .text … … 56 56 .globl bsearch 57 57 bsearch: 58 movem.l %d3-%d5/%a 2-%a4,-(%sp)58 movem.l %d3-%d5/%a3-%a4,-(%sp) 59 59 move.l %a0,%d5 ;# key, key 60 60 move.w %d1,%d4 ;# w, w … … 83 83 .L4: 84 84 move.l %a4,%a0 ;# rptr, <result> 85 movem.l (%sp)+,%d3-%d5/%a 2-%a485 movem.l (%sp)+,%d3-%d5/%a3-%a4 86 86 rts 87 87 "); -
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. -
trunk/tigcc/archive/sprite16.s
r1344 r1360 16 16 addq.w #1,%d0 | 2 17 17 18 move.w %d4,-(%a7) | 2 19 move.l %d3,-(%a7) | 2 20 | d4: drawing mode. 21 move.w 4+6(%a7),%d4 | 4 22 subq.w #1,%d4 | 2 23 | d3: mask used by AND and RPLC. 24 moveq #-1,%d3 | 2 25 clr.w %d3 | 2 26 rol.l %d0,%d3 | 2 18 move.l %d4,-(%a7) | 2 19 | d3: drawing mode. 20 subq.w #1,%d3 | 2 21 | d4: mask used by AND and RPLC. 22 moveq #-1,%d4 | 2 23 clr.w %d4 | 2 24 rol.l %d0,%d4 | 2 27 25 | Jump to loop entry. 28 26 bra.s .L__s16_loopentry | 2 … … 30 28 | AND. 31 29 .L__s16_Am: 32 or.l %d 3,%d1 | 230 or.l %d4,%d1 | 2 33 31 and.l %d1,(%a1) | 2 34 32 … … 45 43 move.w (%a0)+,%d1 | 2 46 44 lsl.l %d0,%d1 | 2 47 cmp.w #1,%d 4| 445 cmp.w #1,%d3 | 4 48 46 beq.s .L__s16_Am | 2 49 tst.w %d 4| 247 tst.w %d3 | 2 50 48 blt.s .L__s16_Xm | 2 51 49 beq.s .L__s16_Om | 2 52 50 | RPLC. 53 and.l %d 3,(%a1) | 251 and.l %d4,(%a1) | 2 54 52 55 53 | OR. … … 65 63 | Return 66 64 .L__s16_rts: 67 move.l (%a7)+,%d3 | 268 move. w(%a7)+,%d4 | 265 addq.w #1,%d3 | 2 66 move.l (%a7)+,%d4 | 2 69 67 rts | 2 -
trunk/tigcc/archive/sprite32.s
r1344 r1360 18 18 19 19 | d4: drawing mode. 20 move.w 4+5*4(%a7),%d4 | 4 21 subq.w #1,%d4 | 2 20 subq.w #1,%d3 | 2 22 21 | d3, d6: masks used by AND and RPLC. 23 moveq #-1,%d 3| 224 lsr.w %d0,%d 3| 225 move.w %d3,%d6 | 226 not.l %d3| 227 swap %d3| 222 moveq #-1,%d4 | 2 23 lsr.w %d0,%d4 | 2 24 move.w %d4,%d6 | 2 25 not.l %d4 | 2 26 swap %d4 | 2 28 27 | Jump to loop entry. 29 28 bra.s .L__s32_loopentry | 2 … … 31 30 | AND. 32 31 .L__s32_Am: 33 or.l %d 3,%d1 | 232 or.l %d4,%d1 | 2 34 33 or.w %d6,%d7 | 2 35 34 and.l %d1,(%a1)+ | 2 … … 47 46 move.l (%a0)+,%d1 | 2 48 47 move.w %d1,%d7 | 2 49 lsr.l %d0,%d1 | 250 lsl.w %d5,%d7 | 251 cmp.w #1,%d 4| 448 lsr.l %d0,%d1 | 2 49 lsl.w %d5,%d7 | 2 50 cmp.w #1,%d3 | 4 52 51 beq.s .L__s32_Am | 2 53 tst.w %d 4| 252 tst.w %d3 | 2 54 53 blt.s .L__s32_Xm | 2 55 54 beq.s .L__s32_Om | 2 56 55 | RPLC. 57 and.l %d 3,(%a1) | 256 and.l %d4,(%a1) | 2 58 57 and.w %d6,4(%a1) | 2 59 58 | OR. -
trunk/tigcc/archive/sprite8.s
r1344 r1360 12 12 adda.w %d1,%a1 | 2 13 13 | d0: shift count. 14 not.w %d0| 214 moveq #24,%d1 | 2 15 15 and.w #15,%d0 | 4 16 add.w #9,%d0 | 416 sub.w %d0,%d1 | 2 17 17 18 move.w %d4,-(%a7) | 2 19 move.l %d3,-(%a7) | 2 20 | d4: drawing mode. 21 move.w 4+6(%a7),%d4 | 4 22 subq.w #1,%d4 | 2 23 | d3: mask used by AND and RPLC. 24 moveq #-1,%d3 | 2 25 clr.b %d3 | 2 26 rol.l %d0,%d3 | 2 18 move.l %d4,-(%a7) | 2 19 | d3: drawing mode. 20 subq.w #1,%d3 | 2 21 | d4: mask used by AND and RPLC. 22 moveq #-1,%d4 | 2 23 clr.b %d4 | 2 24 rol.l %d1,%d4 | 2 27 25 | Jump to loop entry. 28 26 bra.s .L__s8_loopentry | 2 … … 30 28 | AND. 31 29 .L__s8_Am: 32 or.l %d 3,%d1| 233 and.l %d 1,(%a1) | 230 or.l %d4,%d0 | 2 31 and.l %d0,(%a1) | 2 34 32 35 33 | Next line. … … 42 40 blt.s .L__s8_rts | 2 43 41 44 moveq #0,%d 1| 245 move.b (%a0)+,%d 1| 246 lsl.l %d 0,%d1| 247 cmp.w #1,%d 4| 442 moveq #0,%d0 | 2 43 move.b (%a0)+,%d0 | 2 44 lsl.l %d1,%d0 | 2 45 cmp.w #1,%d3 | 4 48 46 beq.s .L__s8_Am | 2 49 tst.w %d 4| 247 tst.w %d3 | 2 50 48 blt.s .L__s8_Xm | 2 51 49 beq.s .L__s8_Om | 2 52 50 | RPLC. 53 and.l %d 3,(%a1) | 251 and.l %d4,(%a1) | 2 54 52 55 53 | OR. 56 54 .L__s8_Om: 57 or.l %d 1,(%a1) | 255 or.l %d0,(%a1) | 2 58 56 bra.s .L__s8_loop | 2 59 57 60 58 | XOR 61 59 .L__s8_Xm: 62 eor.l %d 1,(%a1) | 260 eor.l %d0,(%a1) | 2 63 61 bra.s .L__s8_loop | 2 64 62 65 63 | Return 66 64 .L__s8_rts: 67 move.l (%a7)+,%d3 | 268 move. w(%a7)+,%d4 | 265 addq.w #1,%d3 | 2 66 move.l (%a7)+,%d4 | 2 69 67 rts | 2 -
trunk/tigcc/doc/System/Include/sprites.h/Sprite16.hsf
r1307 r1360 5 5 Header Files=sprites.h 6 6 Definition=void Sprite16 (short x, short y, short height, const unsigned short *sprite, void *vm_addr, short mode); 7 Real Definition=extern void Sprite16(short,short,short,__cpushort,void*,short)__ATTR_LIB_C__; 7 Real Definition=extern void Sprite16(short asm("d0"),short asm("d1"),short asm("d2"),__cpushort asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; 8 9 [Library Call] 10 Asm=1 11 12 [Registers] 13 x=d0 14 y=d1 15 height=d2 16 sprite=a0 17 vm_addr=a1 18 mode=d3 8 19 9 20 [Description] -
trunk/tigcc/doc/System/Include/sprites.h/Sprite32.hsf
r1307 r1360 5 5 Header Files=sprites.h 6 6 Definition=void Sprite32 (short x, short y, short height, const unsigned long *sprite, void *vm_addr, short mode); 7 Real Definition=extern void Sprite32(short,short,short,__cpulong,void*,short)__ATTR_LIB_C__; 7 Real Definition=extern void Sprite32(short asm("d0"),short asm("d1"),short asm("d2"),__cpulong asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; 8 9 [Library Call] 10 Asm=1 11 12 [Registers] 13 x=d0 14 y=d1 15 height=d2 16 sprite=a0 17 vm_addr=a1 18 mode=d3 8 19 9 20 [Description] … … 23 34 <BR><BR> 24 35 If you want to use sprites wider than 32 pixels (which is not very likely), one solution is to 25 use DoorsOS and its "put_sprite" function (see <A HREF="$$INFOLINK(faq)">Frequently Asked Questions</A> 26 for more info about how to do it). If you don't want to use DoorsOS, the proposed method depends 27 on what the use of the sprite will be. If you don't need too fast action, the built-in TIOS function 28 <A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A> may be good enough. If you need a very fast sprite 29 routine for very large sprites, then you must write it yourself. 36 use a "kernel"-based program and <CODE>graphlib::put_sprite</CODE> (see <A HREF="$$INFOLINK(faq)">Frequently Asked Questions</A> 37 for more info about how to do it). If you don't want to use kernel-based programs, the proposed method depends 38 on what the use of the sprite will be: 39 <UL> 40 <LI> 41 If you don't need too fast action, the built-in TIOS function <A HREF="$$LINK(graph.h/BitmapPut)">BitmapPut</A> may be good enough. 42 </LI> 43 <LI> 44 If you need a very fast sprite routine for very large sprites, then you must write it yourself, or use prewritten ones in 45 ExtGraph or Genlib. 46 </LI> 47 </UL> 30 48 <BR><BR> 31 49 See <A HREF="$$LINK(sprites.h/Sprite8)">Sprite8</A> for more info about sprites. -
trunk/tigcc/doc/System/Include/sprites.h/Sprite8.hsf
r1344 r1360 5 5 Header Files=sprites.h 6 6 Definition=void Sprite8 (short x, short y, short height, const unsigned char *sprite, void *vm_addr, short mode); 7 8 [Library Call] 9 Asm=1 10 11 [Registers] 12 x=d0 13 y=d1 14 height=d2 15 sprite=a0 16 vm_addr=a1 17 mode=d3 7 18 8 19 [Description] -
trunk/tigcc/doc/System/Include/sprites.h/sprites.hsh
r1307 r1360 6 6 7 7 [Bottom] 8 For a lot of advanced drawing routines, we recommend you to download the <A HREF="http://www.ticalc.org/archives/files/fileinfo/187/18705.html">ExtGraph library</A> by the <A HREF="http://tict.ticalc.org/">TI-ChessTeam</A>.8 For lots of advanced drawing routines, we recommend you to download either the <A HREF="http://tict.ticalc.org/">ExtGraph static library</A> by the <A HREF="http://tict.ticalc.org/">TI-Chess Team</A> or <A HREF="http://www.yaronet.com/t3/?id=20">Genlib "kernel"-based dynamic library</A> by the <A HREF="http://www.yaronet.com/t3/">Time To Team</A>. -
trunk/tigcc/doc/System/Include/stdlib.h/bsearch.hsf
r1358 r1360 6 6 Definition=void *bsearch (const void *Key, const void *BasePtr, unsigned short NoOfElements, unsigned short Width, compare_t cmp_func); 7 7 See Also=stdlib.h/qsort 8 9 [Library Call] 10 Asm=1 11 12 [Registers] 13 Key=a0 14 BasePtr=a1 15 NoOfElements=d0 16 Width=d1 17 cmp_func=a2 8 18 9 19 [Description] -
trunk/tigcc/doc/System/Include/stdlib.h/qsort.hsf
r1358 r1360 5 5 Header Files=stdlib.h 6 6 Definition=void qsort (void *BasePtr, unsigned short NoOfElements, unsigned short Width, compare_t cmp_func); 7 See Also=stdlib.h/bsearch 8 9 [Library Call] 10 Asm=1 11 12 [Registers] 13 BasePtr=a0 14 NoOfElements=d0 15 Width=d1 16 cmp_func=a2 7 17 8 18 [Description] -
trunk/tigcc/include/C/basfunc.h
r1319 r1360 25 25 #endif 26 26 #if MIN_AMS>=101 27 #define push_format ({__need_in_use_bit;_rom_call(void,(ESI,ESI),315);}) 27 28 #define push_getfold _rom_call(void,(void),317) 28 29 #define push_getkey ({__need_in_use_bit;_rom_call(void,(void),316);}) -
trunk/tigcc/include/C/estack.h
r1319 r1360 173 173 #define index_numeric_term _rom_call(ESI,(CESI),2CD) 174 174 #define index_of_lead_base_of_lead_term _rom_call(ESI,(CESI),2CE) 175 #define init_list_indices _rom_call(ESI*,(ESI*,CESI),2BA) 176 #define init_matrix_indices _rom_call(ESI*,(ESI*,CESI),2BB) 175 177 #define is_advanced_tag _rom_call(short,(ESQ),2D0) 176 178 #define is_antisymmetric ({__need_in_use_bit;_rom_call(short,(CESI,CESI),2D1);}) -
trunk/tigcc/include/C/sprites.h
r1344 r1360 6 6 /* Begin Auto-Generated Part */ 7 7 enum SprtModes{SPRT_XOR,SPRT_OR,SPRT_AND,SPRT_RPLC}; 8 extern void Sprite8(short ,short,short,const unsigned char*,void*,short)__ATTR_LIB_C__;9 extern void Sprite16(short ,short,short,__cpushort,void*,short)__ATTR_LIB_C__;10 extern void Sprite32(short ,short,short,__cpulong,void*,short)__ATTR_LIB_C__;8 extern void Sprite8(short asm("d0"),short asm("d1"),short asm("d2"),const unsigned char* asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; 9 extern void Sprite16(short asm("d0"),short asm("d1"),short asm("d2"),__cpushort asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; 10 extern void Sprite32(short asm("d0"),short asm("d1"),short asm("d2"),__cpulong asm("a0"),void* asm("a1"),short asm("d3"))__ATTR_LIB_ASM__; 11 11 /* End Auto-Generated Part */ 12 12 -
trunk/tigcc/include/C/stdlib.h
r1307 r1360 42 42 extern short atoi(const char*)__ATTR_LIB_C__; 43 43 extern long atol(const char*)__ATTR_LIB_C__; 44 extern void *bsearch(const void* ,const void*,short,short,compare_t)__ATTR_LIB_C__;44 extern void *bsearch(const void* asm("a0"),const void* asm("a1"),short asm("d0"),short asm("d1"),compare_t asm("a2"))__ATTR_LIB_ASM__; 45 45 #ifndef __HAVE_calloc 46 46 #define __HAVE_calloc … … 58 58 #define max(a,b) ({typeof(a) __a = (a); typeof(b) __b = (b); (__a > __b) ? __a : __b;}) 59 59 #define min(a,b) ({typeof(a) __a = (a); typeof(b) __b = (b); (__a < __b) ? __a : __b;}) 60 extern void qsort(void* ,short,short,compare_t)__ATTR_LIB_C__;60 extern void qsort(void* asm("a0"),short asm("d0"),short asm("d1"),compare_t asm("a2"))__ATTR_LIB_ASM__; 61 61 extern short rand(void)__ATTR_LIB_ASM__; 62 62 #define random(x) ((short)((long)(unsigned short)rand()*(unsigned short)(x)/32768)) -
trunk/tigcc/include/C/unknown.h
r1319 r1360 273 273 #define InitDEMem ({__need_in_use_bit;_rom_call(unknown_retval,(),1EA);}) 274 274 #define InitTimeSeq ({__need_in_use_bit;_rom_call(unknown_retval,(),1D9);}) 275 #define is_executable _rom_call( unknown_retval,(),25A)275 #define is_executable _rom_call(short,(CESI),25A) 276 276 #define LoadSymFromFindHandle _rom_call(void,(void),281) 277 277 #define NG_cleanup_graph_fun ({__need_in_use_bit;_rom_call(unknown_retval,(),262);}) … … 330 330 #define has_unit_base _rom_call(short,(ESI),3AF) 331 331 #define index_after_match_endtag _rom_call(ESI,(ESI,char),2B1) 332 #define init_list_indices _rom_call(unknown_retval,(),2BA)333 #define init_matrix_indices _rom_call(unknown_retval,(),2BB)334 332 #define init_unit_system _rom_call(unknown_retval,(),3B0) 335 333 #define is_pathname _rom_call(short,(CESI),3C6) … … 339 337 #define push_ans_entry _rom_call(HANDLE,(CESI),2B0) 340 338 #define push_auto_units_conversion ({__need_in_use_bit;_rom_call(unknown_retval,(),3B2);}) 341 #define push_float_qr_fact ({__need_in_use_bit;_rom_call(unknown_retval,(),2BC);}) 342 #define push_format ({__need_in_use_bit;_rom_call(unknown_retval,(),315);}) 343 #define push_lu_fact ({__need_in_use_bit;_rom_call(unknown_retval,(),2BD);}) 344 #define push_mrow_aux ({__need_in_use_bit;_rom_call(unknown_retval,(),31B);}) 339 #define push_float_qr_fact ({__need_in_use_bit;_rom_call(ESI,(ESI,float),2BC);}) 340 #define push_lu_fact ({__need_in_use_bit;_rom_call(ESI,(ESI,float),2BD);}) 341 #define push_mrow_aux ({__need_in_use_bit;_rom_call(void,(ESI,ESI,short,short),31B);}) 345 342 #define push_parse_prgm_or_func_text _rom_call(void,(const char*,ESI,short),3C9) 346 343 #define push_sq_matrix_to_whole_number ({__need_in_use_bit;_rom_call(unknown_retval,(),3C0);}) 347 #define push_symbolic_qr_fact ({__need_in_use_bit;_rom_call( unknown_retval,(),2BE);})344 #define push_symbolic_qr_fact ({__need_in_use_bit;_rom_call(ESI,(ESI),2BE);}) 348 345 #define push_unit_system_list _rom_call(unknown_retval,(),3B3) 349 346 #define push_user_func ({__need_in_use_bit;_rom_call(void,(ESI,short),2B3);}) 350 347 #define push_var _rom_call(void,(const char*,const char*),3CB) 351 #define push_zero_partial_column _rom_call( unknown_retval,(),3C2)348 #define push_zero_partial_column _rom_call(void,(ESI,short,short),3C2) 352 349 #define setup_unit_system _rom_call(unknown_retval,(),3B4) 353 350 #define store_func_def ({__need_in_use_bit;_rom_call(void,(ESI),2B4);})
Note: See TracChangeset
for help on using the changeset viewer.
