comparison mc-code-powerpc.c @ 594:f49c825920c4 fix-ltosop

tosop optimize buf fix
author kono
date Sat, 21 Jan 2006 15:00:29 +0900
parents c139d4d9307c
children df04bc5fd5fe
comparison
equal deleted inserted replaced
593:c139d4d9307c 594:f49c825920c4
2452 emit_pop_free(xreg); 2452 emit_pop_free(xreg);
2453 xreg = emit_pop(0); /* pop e3 value */ 2453 xreg = emit_pop(0); /* pop e3 value */
2454 printf("\t%s %s,0(%s)\n",cstore(byte), 2454 printf("\t%s %s,0(%s)\n",cstore(byte),
2455 register_name(ireg),register_name(xreg)); 2455 register_name(ireg),register_name(xreg));
2456 emit_pop_free(xreg); 2456 emit_pop_free(xreg);
2457 2457 }
2458 #if 0 2458
2459 char *xrn,*crn,*drn; 2459 int
2460 int xreg; 2460 tosop_operand_safe_p(int op)
2461 int edx = get_register(); if(!edx) error(-1); 2461 {
2462 // (*creg) op = pop() 2462 return 1;
2463
2464 use_int(creg);
2465 xrn = register_name(xreg = emit_pop(0)); /* pop e3 value */
2466 #if 1
2467 set_ireg(edx,0);
2468 ld_indexx(byte,0,creg,ireg,sign);
2469 use_reg(creg); // to clear ptr cache
2470 tosop(op,ireg,xreg);
2471 crn = register_name(ireg);
2472 drn = register_name(creg);
2473 if (byte==1) {
2474 printf("\tstb %s,0(%s)\n",crn,drn);
2475 } else if (byte==SIZE_OF_SHORT) {
2476 printf("\tsth %s,0(%s)\n",crn,drn);
2477 } else {
2478 printf("\tstw %s,0(%s)\n",crn,drn);
2479 }
2480 free_register(creg);
2481 emit_pop_free(xreg);
2482 #else
2483 printf("## assop\n\tmr %s,%s\n",register_name(edx),register_name(creg));
2484 ld_indexx(byte,0,edx,creg,sign);
2485 tosop(op,creg,xreg);
2486 crn = register_name(creg);
2487 drn = register_name(edx);
2488 if (byte==1) {
2489 printf("\tstb %s,0(%s)\n",crn,drn);
2490 } else if (byte==SIZE_OF_SHORT) {
2491 printf("\tsth %s,0(%s)\n",crn,drn);
2492 } else {
2493 printf("\tstw %s,0(%s)\n",crn,drn);
2494 }
2495 free_register(edx);
2496 emit_pop_free(xreg);
2497 #endif
2498 #endif
2499 } 2463 }
2500 2464
2501 void 2465 void
2502 tosop(int op,int creg,int oreg) 2466 tosop(int op,int creg,int oreg)
2503 { 2467 {