# HG changeset patch # User Shinji KONO # Date 1289612867 -32400 # Node ID d4bc10fe73627ed0d89d3c1aa9633b1030ca11c3 # Parent f8ea174944f26f73f5af6ad3a7644adaab9956e6 i64 continue... (global table) diff -r f8ea174944f2 -r d4bc10fe7362 mc-code-i64.c --- a/mc-code-i64.c Fri Nov 12 22:19:55 2010 +0900 +++ b/mc-code-i64.c Sat Nov 13 10:47:47 2010 +0900 @@ -260,12 +260,12 @@ int code_lassop_p = 1; -#define MAX_REGISTER 14 /* intel386のレジスタを6つまで使う*/ -#define REAL_MAX_REGISTER (1+16) /* intel386のレジスタが8つということ*/ -int MAX_REGISTER_VAR=6; -#define REAL_MAX_DREGISTER (1+16) /* intel386のレジスタが8つということ*/ - -int MAX_DREGISTER_VAR=8; +#define MAX_REGISTER 14 /* intel64のレジスタを14まで使う*/ +#define REAL_MAX_REGISTER (1+16) /* intel64のレジスタが16つということ*/ +int MAX_REGISTER_VAR=5; +#define REAL_MAX_DREGISTER (1+16) /* intel64のxmmレジスタが16つということ*/ + +int MAX_DREGISTER_VAR=0; /* 保存される xmm register はない */ #define MIN_TMP_FREG 6 #define MAX_TMP_FREG 9 @@ -360,28 +360,29 @@ // 2 (REG_VAR) register variable // 3 pointer cache (not used in ia32) -#define FREG_OFFSET 18 #define REG_ESP 0 #define REG_EBP 1 #define REG_EDI 2 // first argument register #define REG_ESI 3 -#define REG_EDX 4 -#define REG_ECX 5 // for strange reason (code_assop) -#define REG_EAX 6 -#define REG_EBX 7 +#define REG_ECX 4 // for strange reason (code_assop) +#define REG_EDX 5 +#define REG_EAX 8 +#define REG_EBX 11 +#define REG_R15 15 #define is_int_reg(reg) (1<=reg&®<=MAX_REGISTER) #define is_float_reg(reg) (RET_FREGISTER<=reg&®sc == GVAR || ((is_code(n) || is_function(n)) &&has_attr(n,FNAME)) ) { if (init==0) { - printf("\t.section __IMPORT,__pointers,non_lazy_symbol_pointers\n"); +printf(".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\nEH_frame1:\n"); +printf( +" .set L$set$0,LECIE1-LSCIE1\n" +" .long L$set$0\n" +"LSCIE1:\n" +" .long 0x0\n" +" .byte 0x1\n" +" .ascii \"zR\0\"\n" +" .byte 0x1\n" +" .byte 0x78\n" +" .byte 0x10\n" +" .byte 0x1\n" +" .byte 0x10\n" +" .byte 0xc\n" +" .byte 0x7\n" +" .byte 0x8\n" +" .byte 0x90\n" +" .byte 0x1\n" +" .align 3\n" +"LECIE1:\n"); init=1; } - printf("L_%s$non_lazy_ptr:\n\t.indirect_symbol _%s\n\t.long\t0\n", - n->nm,n->nm); + } } for(n = global_list;n!=&null_nptr;n = n->next) { if (n->sc==EXTRN1) { - if (!(is_code(n) || is_function(n))) { - printf("\t.section __IMPORT,__pointers,non_lazy_symbol_pointers\n"); - printf("L_%s$non_lazy_ptr:\n\t.indirect_symbol _%s\n\t.long\t0\n", - n->nm,n->nm); - } - printf("\t.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5\n"); - printf("L_%s$stub:\n",n->nm); - printf("\t.indirect_symbol _%s\n",n->nm); - printf("\thlt ; hlt ; hlt ; hlt ; hlt\n"); + if ((is_code(n) || is_function(n))) { + exntern_entry(n) ; } } printf(" .subsections_via_symbols\n"); - printf(" .section __TEXT,__textcoal_nt,coalesced,pure_instructions\n"); - printf(".weak_definition ___i686.get_pc_thunk.bx\n"); - printf(".private_extern ___i686.get_pc_thunk.bx\n"); - printf("___i686.get_pc_thunk.bx:\n"); - printf(" movl (%%esp), %%ebx\n"); - printf(" ret\n"); #endif } diff -r f8ea174944f2 -r d4bc10fe7362 test/code-gen.c --- a/test/code-gen.c Fri Nov 12 22:19:55 2010 +0900 +++ b/test/code-gen.c Sat Nov 13 10:47:47 2010 +0900 @@ -1581,6 +1581,9 @@ f0 = 0.0; f1 = 0.2; d0 = 10; d1 = 10e10; printf("#1511:code_lvar float r %f %f %g %g\n",f0,f1,d0,d1); + f0 += f1; + d0 += d1; + printf("#1511:code_lvar float r %f %f %g %g\n",f0,f1,d0,d1); } // code_dassign_gvar(int e2,int freg,int d)