comparison mc-code-arm.c @ 489:79fef53141b4

fix clear_ptr_cache in MIPS/ARM.
author kono
date Mon, 19 Dec 2005 22:42:12 +0900
parents f84d4525ffc8
children 4c2607e72ab5
comparison
equal deleted inserted replaced
488:62f3c801b6ac 489:79fef53141b4
2401 int nargs=0,reg_arg=0,freg_arg=0; 2401 int nargs=0,reg_arg=0,freg_arg=0;
2402 int t=caddr(e3); 2402 int t=caddr(e3);
2403 if(scalar(t)) { 2403 if(scalar(t)) {
2404 nargs ++ ; reg_arg++; 2404 nargs ++ ; reg_arg++;
2405 } else if (t==LONGLONG||t==ULONGLONG||t==DOUBLE) { 2405 } else if (t==LONGLONG||t==ULONGLONG||t==DOUBLE) {
2406 #if 0
2407 if (*preg_arg>3 && *preg_arg%2==1) reg_arg++; // alignment
2408 if (*preg_arg>3 && *pnargs%2==1) nargs++; // alignment
2409 if (*preg_arg==3) {
2410 // half register, half stack case
2411 nargs --;
2412 }
2413 #endif
2414 nargs ++ ; reg_arg++; 2406 nargs ++ ; reg_arg++;
2415 nargs ++ ; reg_arg++; 2407 nargs ++ ; reg_arg++;
2416 } else if (t==FLOAT) { 2408 } else if (t==FLOAT) {
2417 reg_arg ++ ; freg_arg++; 2409 reg_arg ++ ; freg_arg++;
2418 nargs += size(t)/SIZE_OF_INT; 2410 nargs += size(t)/SIZE_OF_INT;
2498 int pnargs,preg_arg,pfreg_arg; 2490 int pnargs,preg_arg,pfreg_arg;
2499 int stargs,i; 2491 int stargs,i;
2500 int half_register = 0; 2492 int half_register = 0;
2501 2493
2502 special_lvar = -1; 2494 special_lvar = -1;
2503 #if 0
2504 ret_type = cadr(cadddr(e1));
2505 if (ret_type==CHAR) ret_type=INT; // ???
2506
2507 /* check argments type is DOTS? */
2508 t = caddr(cadddr(e1));
2509 if (t==0 || t==DOTS) dots = 1;
2510 else {
2511 dots = 0;
2512 for(t = caddr(cadddr(e1));t;t = cadr(t)) {
2513 if (car(t)==DOTS) dots = 1;
2514 }
2515 }
2516 #else
2517 ret_type = function_type(cadddr(e1),&dots); 2495 ret_type = function_type(cadddr(e1),&dots);
2518 if (caddr(cadddr(e1))==0) dots=1; 2496 if (caddr(cadddr(e1))==0) dots=1;
2519 #endif
2520 2497
2521 arg_assign = 0; 2498 arg_assign = 0;
2522 e2 = cadr(e1); 2499 e2 = cadr(e1);
2523 if (car(e2) == FNAME) { 2500 if (car(e2) == FNAME) {
2524 fn=(NMTBL *)cadr(e2); 2501 fn=(NMTBL *)cadr(e2);
3359 r1_offset_label = fwdlabel(); 3336 r1_offset_label = fwdlabel();
3360 max_func_args = 0; 3337 max_func_args = 0;
3361 printf("%s:\n",name); 3338 printf("%s:\n",name);
3362 code_label_value(r1_offset_label,REG_ip); 3339 code_label_value(r1_offset_label,REG_ip);
3363 printf("\tadd\tsp, ip, fp\n"); 3340 printf("\tadd\tsp, ip, fp\n");
3341 clear_ptr_cache();
3364 } 3342 }
3365 3343
3366 3344
3367 void 3345 void
3368 code_enter1(int args) 3346 code_enter1(int args)
3397 printf("\t.globl\t%s\n",name); 3375 printf("\t.globl\t%s\n",name);
3398 printf("%s:\n",name); 3376 printf("%s:\n",name);
3399 printf("\tmov\tip, sp\n"); 3377 printf("\tmov\tip, sp\n");
3400 gen_jmp(entry_label = fwdlabel()); 3378 gen_jmp(entry_label = fwdlabel());
3401 register_save_return_label = backdef(); 3379 register_save_return_label = backdef();
3380 clear_ptr_cache();
3402 } 3381 }
3403 3382
3404 void 3383 void
3405 enter1() 3384 enter1()
3406 { 3385 {