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
25432543 vtop -=2;
25442544 }else{
25452545 size = type_size(&vtop->type, &align);
2546−#ifdef TCC_ARM_EABI
2547− /* destination */
2548− vswap();
2549− vtop->type.t = VT_PTR;
2550− gaddrof();
2546+#ifndef TCC_TARGET_X86_64
2547+ /* destination */
2548+ vswap();
2549+ vtop->type.t = VT_PTR;
2550+ gaddrof();
25512551
2552− /* address of memcpy() */
2553− if(!(align & 7))
2554− vpush_global_sym(&func_old_type, TOK_memcpy8);
2555− else if(!(align & 3))
2556− vpush_global_sym(&func_old_type, TOK_memcpy4);
2557− else
2558− vpush_global_sym(&func_old_type, TOK_memcpy);
2552+ /* address of memcpy() */
2553+# ifdef TCC_ARM_EABI
2554+ if(!(align & 7))
2555+ vpush_global_sym(&func_old_type, TOK_memcpy8);
2556+ else if(!(align & 3))
2557+ vpush_global_sym(&func_old_type, TOK_memcpy4);
2558+ else
2559+# endif
2560+ vpush_global_sym(&func_old_type, TOK_memcpy);
25592561
2560− vswap();
2561− /* source */
2562− vpushv(vtop - 2);
2563− vtop->type.t = VT_PTR;
2564− gaddrof();
2565− /* type size */
2566− vpushi(size);
2567− gfunc_call(3);
2562+ vswap();
2563+ /* source */
2564+ vpushv(vtop - 2);
2565+ vtop->type.t = VT_PTR;
2566+ gaddrof();
2567+ /* type size */
2568+ vpushi(size);
2569+ gfunc_call(3);
25682570 #else
2569− /* destination */
2571+ /* destination */
25702572 vswap();
25712573 vtop->type.t = VT_PTR;
25722574 gaddrof();
@@ -5239,14 +5241,19 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size) · 2666 unmodified lines
52395241 if (sec) {
52405242 /* nothing to do because globals are already set to zero */
52415243 } else {
5242−#ifdef TCC_TARGET_ARM
5244+#ifndef TCC_TARGET_X86_64
52435245 vpush_global_sym(&func_old_type, TOK_memset);
52445246 vseti(VT_LOCAL, c);
5247+#ifdef TCC_TARGET_ARM
52455248 vpushs(size);
52465249 vpushi(0);
5250+#else
5251+ vpushi(0);
5252+ vpushs(size);
5253+#endif
52475254 gfunc_call(3);
52485255 #else
5249− vseti(VT_LOCAL, c);
5256+ vseti(VT_LOCAL, c);
52505257 gen_putz(vtop, size);
52515258 vtop--;
52525259 #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