comparison mc-code-ia32.c @ 436:d92786033042 loprtc-div

loprtc
author kono
date Sun, 14 Nov 2004 15:41:05 +0900
parents d3e6359f8501
children 626d705471d5
comparison
equal deleted inserted replaced
435:d3e6359f8501 436:d92786033042
2921 case LLSHIFT: 2921 case LLSHIFT:
2922 case LULSHIFT: 2922 case LULSHIFT:
2923 case LRSHIFT: 2923 case LRSHIFT:
2924 case LURSHIFT: 2924 case LURSHIFT:
2925 return (0<=l&&l<=63); 2925 return (0<=l&&l<=63);
2926 case LMUL:
2927 case LUMUL:
2928 case LUDIV:
2929 /* case LDIV: */
2930 return -0x10000000LL<l&&l<0x10000000LL && ilog(l);
2926 case LADD: 2931 case LADD:
2927 case LSUB: 2932 case LSUB:
2928 case LBAND: 2933 case LBAND:
2929 case LEOR: 2934 case LEOR:
2930 case LBOR: 2935 case LBOR:
2950 2955
2951 use_longlong(reg); 2956 use_longlong(reg);
2952 opl = 0; 2957 opl = 0;
2953 2958
2954 switch(op) { 2959 switch(op) {
2960 case LMUL: case LUMUL:
2961 vl=il=ilog(il);
2955 case LLSHIFT: 2962 case LLSHIFT:
2956 case LULSHIFT: 2963 case LULSHIFT:
2957 if (il==0) return; 2964 if (il==0) return;
2958 else if (il==32) { 2965 else if (il==32) {
2959 code_register(regv_l(reg),regv_h(reg)); 2966 code_register(regv_l(reg),regv_h(reg));
2981 return; 2988 return;
2982 } 2989 }
2983 printf("\tshrdl $%d,%s,%s\n",(int)il,l_edx(reg),l_eax(reg)); 2990 printf("\tshrdl $%d,%s,%s\n",(int)il,l_edx(reg),l_eax(reg));
2984 printf("\tsarl $%d,%s\n",(int)il,l_edx(reg)); 2991 printf("\tsarl $%d,%s\n",(int)il,l_edx(reg));
2985 return; 2992 return;
2993 case LUDIV:
2994 il=ilog(il);
2986 case LURSHIFT: 2995 case LURSHIFT:
2987 if (il==0) return; 2996 if (il==0) return;
2988 else if (il==32) { 2997 else if (il==32) {
2989 code_register(regv_h(reg),regv_l(reg)); 2998 code_register(regv_h(reg),regv_l(reg));
2990 code_const(0,regv_h(reg)); 2999 code_const(0,regv_h(reg));