comparison mc-code-powerpc.c @ 209:7bfc1435cdc6 regv-fix

regv fix done
author kono
date Wed, 21 Apr 2004 17:40:29 +0900
parents 70b1da1864f6
children f21651f85344
comparison
equal deleted inserted replaced
208:70b1da1864f6 209:7bfc1435cdc6
1788 code_drindirect(int e1, int offset, int d) 1788 code_drindirect(int e1, int offset, int d)
1789 { 1789 {
1790 char *crn; 1790 char *crn;
1791 g_expr(e1); 1791 g_expr(e1);
1792 crn=register_name(creg); 1792 crn=register_name(creg);
1793 creg = d?use_double(creg):use_float(creg);
1793 printf("\t%s %s,%d(%s)\n",fload(d), 1794 printf("\t%s %s,%d(%s)\n",fload(d),
1794 fregister_name(freg),offset,crn); 1795 fregister_name(freg),offset,crn);
1795 creg = freg;
1796 return d?DOUBLE:FLOAT; 1796 return d?DOUBLE:FLOAT;
1797 } 1797 }
1798 #endif 1798 #endif
1799 1799
1800 #if LONGLONG_CODE 1800 #if LONGLONG_CODE
2922 } 2922 }
2923 2923
2924 void 2924 void
2925 code_dassop(int op,int d) { 2925 code_dassop(int op,int d) {
2926 /* we have lvalue in creg, applied floating value is in freg */ 2926 /* we have lvalue in creg, applied floating value is in freg */
2927 char *frn=fregister_name(freg);
2928 int xreg=emit_dpop(d); 2927 int xreg=emit_dpop(d);
2929 char *crn=register_name(creg); 2928 char *crn=register_name(creg);
2930 2929 char *frn;
2931 if (!is_float_reg(freg)) error(-1); 2930 creg = d?use_double(creg):use_float(creg);
2931 frn =fregister_name(freg);
2932
2932 printf("\t%s %s,0(%s)\n",fload(d),frn,crn); 2933 printf("\t%s %s,0(%s)\n",fload(d),frn,crn);
2933 dtosop(op,xreg); 2934 dtosop(op,xreg);
2934 printf("\t%s %s,0(%s)\n",fstore(d),frn,crn); 2935 printf("\t%s %s,0(%s)\n",fstore(d),frn,crn);
2935 emit_dpop_free(xreg,d); 2936 emit_dpop_free(xreg,d);
2936 } 2937 }
2941 char *frn; 2942 char *frn;
2942 char *crn; 2943 char *crn;
2943 int g; 2944 int g;
2944 char *grn,*drn; 2945 char *grn,*drn;
2945 int r; 2946 int r;
2946 r = get_ptr_cache(&float_one);
2947 float_one_lib_used=1;
2948 2947
2949 if (car(e2)==DREGISTER||car(e2)==FREGISTER) { 2948 if (car(e2)==DREGISTER||car(e2)==FREGISTER) {
2950 error(-1); /* unspported now */ 2949 error(-1); /* unspported now */
2951 } 2950 }
2952 g_expr(e2); 2951 g_expr(e2);
2953 2952
2953 float_one_lib_used=1;
2954 r = get_ptr_cache(&float_one);
2955 drn=register_name(r);
2956
2954 crn=register_name(creg); 2957 crn=register_name(creg);
2958
2959 creg = d?use_double(creg):use_float(creg);
2955 frn=fregister_name(freg); 2960 frn=fregister_name(freg);
2956 drn=register_name(r);
2957 grn=fregister_name(g=get_dregister(d)); 2961 grn=fregister_name(g=get_dregister(d));
2958 2962
2959 printf("\t%s %s,0(%s)\n",fload(d),frn,crn); 2963 printf("\t%s %s,0(%s)\n",fload(d),frn,crn);
2960 printf("\tlfs %s,0(%s)\n",grn,drn); 2964 printf("\tlfs %s,0(%s)\n",grn,drn);
2961 if (caddr(e1)>0) 2965 if (caddr(e1)>0)
2973 char *frn; 2977 char *frn;
2974 char *crn; 2978 char *crn;
2975 int g; 2979 int g;
2976 char *grn,*drn; 2980 char *grn,*drn;
2977 int r; 2981 int r;
2978 r = get_ptr_cache(&float_one);
2979 float_one_lib_used=1;
2980 2982
2981 if (car(e2)==DREGISTER||car(e2)==FREGISTER) { 2983 if (car(e2)==DREGISTER||car(e2)==FREGISTER) {
2982 error(-1); /* unspported now */ 2984 error(-1); /* unspported now */
2983 } 2985 }
2984 g_expr(e2); 2986 g_expr(e2);
2985 2987
2986 crn=register_name(creg); 2988 crn=register_name(creg);
2989
2990 float_one_lib_used=1;
2991 r = get_ptr_cache(&float_one);
2992 drn=register_name(r);
2993
2994 creg = d?use_double(creg):use_float(creg);
2987 frn=fregister_name(freg); 2995 frn=fregister_name(freg);
2988 drn=register_name(r);
2989 grn=fregister_name(g=get_dregister(d)); 2996 grn=fregister_name(g=get_dregister(d));
2990 2997
2991 printf("\t%s %s,0(%s)\n",fload(d),frn,crn); 2998 printf("\t%s %s,0(%s)\n",fload(d),frn,crn);
2992 printf("\tlfs %s,0(%s)\n",grn,drn); 2999 printf("\tlfs %s,0(%s)\n",grn,drn);
2993 if (caddr(e1)>0) 3000 if (caddr(e1)>0)