History

gen_putz () and struct_copy (), is to reduce the third-party call that generates faster code tcc Now only for x86-64 parse_number also to reduce the reliance on third-party libraries, allowing faster analysis tcc

jiang committed 12 years ago

Commit 5b52a441 parent ee99fd41 file · +30 −23Browse files

Unified · Split

tccgen.c+30−23
@@ -2543,30 +2543,32 @@ ST_FUNC void vstore(void) · 2542 unmodified lines
2543 vtop -=2;2543 vtop -=2;
2544 }else{2544 }else{
2545 size = type_size(&vtop->type, &align);2545 size = type_size(&vtop->type, &align);
2546#ifdef TCC_ARM_EABI2546#ifndef TCC_TARGET_X86_64
2547 /* destination */2547 /* destination */
2548 vswap();2548 vswap();
2549 vtop->type.t = VT_PTR;2549 vtop->type.t = VT_PTR;
2550 gaddrof();2550 gaddrof();
2551 2551
2552 /* address of memcpy() */2552 /* address of memcpy() */
2553 if(!(align & 7))2553# ifdef TCC_ARM_EABI
2554 vpush_global_sym(&func_old_type, TOK_memcpy8);2554 if(!(align & 7))
2555 else if(!(align & 3))2555 vpush_global_sym(&func_old_type, TOK_memcpy8);
2556 vpush_global_sym(&func_old_type, TOK_memcpy4);2556 else if(!(align & 3))
2557 else2557 vpush_global_sym(&func_old_type, TOK_memcpy4);
2558 vpush_global_sym(&func_old_type, TOK_memcpy);2558 else
2559# endif
2560 vpush_global_sym(&func_old_type, TOK_memcpy);
2559 2561
2560 vswap();2562 vswap();
2561 /* source */2563 /* source */
2562 vpushv(vtop - 2);2564 vpushv(vtop - 2);
2563 vtop->type.t = VT_PTR;2565 vtop->type.t = VT_PTR;
2564 gaddrof();2566 gaddrof();
2565 /* type size */2567 /* type size */
2566 vpushi(size);2568 vpushi(size);
2567 gfunc_call(3);2569 gfunc_call(3);
2568#else2570#else
2569 /* destination */2571 /* destination */
2570 vswap();2572 vswap();
2571 vtop->type.t = VT_PTR;2573 vtop->type.t = VT_PTR;
2572 gaddrof();2574 gaddrof();
@@ -5239,14 +5241,19 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size) · 2666 unmodified lines
5239 if (sec) {5241 if (sec) {
5240 /* nothing to do because globals are already set to zero */5242 /* nothing to do because globals are already set to zero */
5241 } else {5243 } else {
5242#ifdef TCC_TARGET_ARM5244#ifndef TCC_TARGET_X86_64
5243 vpush_global_sym(&func_old_type, TOK_memset);5245 vpush_global_sym(&func_old_type, TOK_memset);
5244 vseti(VT_LOCAL, c);5246 vseti(VT_LOCAL, c);
5247#ifdef TCC_TARGET_ARM
5245 vpushs(size);5248 vpushs(size);
5246 vpushi(0);5249 vpushi(0);
5250#else
5251 vpushi(0);
5252 vpushs(size);
5253#endif
5247 gfunc_call(3);5254 gfunc_call(3);
5248#else5255#else
5249 vseti(VT_LOCAL, c);5256 vseti(VT_LOCAL, c);
5250 gen_putz(vtop, size);5257 gen_putz(vtop, size);
5251 vtop--;5258 vtop--;
5252#endif5259#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t