comparison mc-code-ia32.c @ 258:22949117768f

Complex function argments. Struct is done. Long long is odd.
author kono
date Sat, 15 May 2004 20:07:24 +0900
parents 5aaca4f9d96b
children c922bade771d
comparison
equal deleted inserted replaced
257:e2f5671c413d 258:22949117768f
969 register_name(from,0), register_name(dreg,0)); 969 register_name(from,0), register_name(dreg,0));
970 printf("\tmovl %s,%d(%s)\n",register_name(dreg,0), offset, 970 printf("\tmovl %s,%d(%s)\n",register_name(dreg,0), offset,
971 register_name(to,0)); 971 register_name(to,0));
972 break; 972 break;
973 default: 973 default:
974 if (-MAX_COPY_LEN<length && length <0) { 974 if (length <0) {
975 for(;length<=4;length+=4,offset-=4) 975 if (length > -MAX_COPY_LEN) {
976 emit_copy(from,to,4,offset,0,det); 976 for(;length<=-4;length+=4,offset-=4)
977 for(;length<=2;length+=2,offset-=2) 977 emit_copy(from,to,-4,offset-4,0,det);
978 emit_copy(from,to,2,offset,0,det); 978 for(;length<=-2;length+=2,offset-=2)
979 if(length>0) 979 emit_copy(from,to,-2,offset-2,0,det);
980 emit_copy(from,to,length,offset,0,det); 980 if(length<0)
981 break; 981 emit_copy(from,to,length,offset-1,0,det);
982 } else if (length <=MAX_COPY_LEN) { 982 break;
983 for(;length>=4;length-=4,offset+=4) 983 }
984 emit_copy(from,to,4,offset,0,det); 984 } else if (length <=MAX_COPY_LEN) {
985 for(;length>=2;length-=2,offset+=2) 985 for(;length>=4;length-=4,offset+=4)
986 emit_copy(from,to,2,offset,0,det); 986 emit_copy(from,to,4,offset,0,det);
987 if(length>0) 987 for(;length>=2;length-=2,offset+=2)
988 emit_copy(from,to,length,offset,0,det); 988 emit_copy(from,to,2,offset,0,det);
989 break; 989 if(length>0)
990 } 990 emit_copy(from,to,length,offset,0,det);
991 break;
992 }
993 /*
991 if (det) { 994 if (det) {
992 /*
993 call bcopy 995 call bcopy
994 g_expr(list3(FUNCTION,,); 996 g_expr(list3(FUNCTION,,);
995 break; 997 break;
998 }
996 */ 999 */
997 }
998 use_register(from,REG_ESI,1); 1000 use_register(from,REG_ESI,1);
999 use_register(to, REG_EDI,1); 1001 use_register(to, REG_EDI,1);
1000 use_register(dreg,REG_ECX,0); 1002 use_register(dreg,REG_ECX,0);
1001 if (length<0) { 1003 if (length<0) {
1002 printf("\tmovl $%d,%%ecx\n",-length/4); 1004 printf("\tmovl $%d,%%ecx\n",-length/4);
1003 printf("\taddl $%d,%%esi\n",-length); 1005 printf("\taddl $%d,%%esi\n",-length);
1004 printf("\taddl $%d,%%edi\n",-length); 1006 printf("\taddl $%d,%%edi\n",-length);
1005 printf("\tstd\n\trep\n\tmovsl\n"); 1007 printf("\tstd\n\trep\n\tmovsl\n");
1006 if(length%4) { 1008 if(length%4) {
1007 emit_copy(from,to,length,offset+length/4,0,det); 1009 emit_copy(from,to,length,offset+length/SIZE_OF_INT,0,det);
1008 } 1010 }
1009 } else { 1011 } else {
1010 printf("\tmovl $%d,%%ecx\n",length/4); 1012 printf("\tmovl $%d,%%ecx\n",length/4);
1011 fix = (length/4)*4; 1013 fix = (length/4)*4;
1012 printf("\tcld\n\trep\n\tmovsl\n"); 1014 printf("\tcld\n\trep\n\tmovsl\n");
1013 if(length%4) { 1015 if(length%4) {
1014 emit_copy(from,to,length,offset+length/4,0,det); 1016 emit_copy(from,to,length,offset+length/SIZE_OF_INT,0,det);
1015 } 1017 }
1016 } 1018 }
1017 } 1019 }
1018 if (value) { 1020 if (value) {
1019 /* creg must point top of the destination data */ 1021 /* creg must point top of the destination data */