134 if (S1 = find_local($1, 0)) {
138 soft_alloc_reg(reg_lb);
169 if (S1 = find_local($1, 0)) {
172 "ld [%s], %s\n",S1,S2
176 soft_alloc_reg(reg_lb);
198 soft_alloc_reg(reg_lb);
214 soft_alloc_reg(reg_lb);
220 soft_alloc_reg(reg_lb);
222 inc_tos(((16*4) + 8 + 4 + (16 * 4)));
238 sprint(n_str, "%d", $1);
240 "set %s, %s\n",n_str,a
243 "mov %s, %s\n",reg_lb,b
246 "1: ld [%s + ((16*4) + 8 + 4 + (16 * 4))], %s\n",b,c
266 inc_tos(((16*4) + 8 + 4 + (16 * 4))))
295 const_str_t size_str;
298 if (type_of_tos() == T_cst && top_const() <= 16) {
299 size = pop_const(size_str);
302 case 1: LD = "ldub"; break;
303 case 2: LD = "lduh"; break;
304 case 4: LD = "ld"; break;
308 if (type_of_tos() & T_reg2)
312 "%s [%s+%s], %s\n",LD,a,c,b
321 "%s [%s+%s], %s\n",LD,a,n,b
326 } else if (size <= 16) {
328 for (i = 0; i < size; i += 4) {
330 if (type_of_tos() & T_reg2)
334 "ld [%s+%s], %s\n",a,c,b
344 "ld [%s+%s], %s\n",a,n,b
347 if (n[0] == '-' || isdigit(n[0]))
356 "add %s, %s, %s\n",a,n,b
375 "sub %s, %s, %s\n" ,reg_sp,a,reg_sp
381 "ld [%s+%s], %s\n",b,a,c
387 "st %s, [%s+%s]\n" ,c,reg_sp,a
408 if (type_of_tos() == T_cst)
416 force_alloc_output();
424 "set EILLINS, %s\n",reg_o0
451 if (S1 = find_local($1, &S2)) {
456 soft_alloc_reg(reg_lb);
502 if ((S1 = find_local($1, 0))) {
505 soft_alloc_reg(reg_lb);
531 if (S1 = find_local($1, 0)) {
534 "st %s, [%s]\n",S2,S1
538 soft_alloc_reg(reg_lb);
584 const_str_t size_str;
589 if (type_of_tos() == T_cst && top_const() <= 16) {
591 size = pop_const(size_str);
595 case 1: ST = "stb"; break;
596 case 2: ST = "sth"; break;
597 case 4: ST = "st"; break;
601 if (type_of_tos() & T_reg2)
605 if (type_of_tos() == T_float) {
609 "st %s,[%%fp+64]\n",b
614 "ld [%%fp+64],%s\n",b
623 "%s %s, [%s+%s]\n",ST,b,a,c
629 "%s %s, [%s+%s]\n",ST,b,a,n
633 } else if (size <= 16) {
634 for (i = 0; i < size; i+=4) {
636 if (type_of_tos() & T_reg2)
640 if (type_of_tos() == T_float)
646 "st %s, [%s+%s]\n",b,a,c
650 "st %s, [%s+%s]\n",b,a,n
658 else if (n[0] == '-' || isdigit(n[0]))
667 "add %s, %s, %s\n",a,n,b
679 force_alloc_output();
692 "andcc %s, 3, %%g0\n" ,d
698 "ld [%s], %s\n" ,reg_sp,b
707 "ld [%s], %s\n" ,reg_sp,b
719 "ld [%s], %s\n" ,reg_sp,b
722 "3: set EILLINS, %%o0\n"
746 "stb %s, [%s]\n" ,b,a
758 "sth %s, [%s]\n" ,b,a
788 "ld [%s+%s], %s\n",reg_sp,b,c
794 "st %s, [%s+%s]\n" ,c,a,b
797 "add %s, %s, %s\n" ,reg_sp,d,reg_sp
822 if (type_of_tos() == T_cst)
830 force_alloc_output();
838 "set EILLINS, %s\n",reg_o0
865 S1 = find_local($1, 0);
867 pop_double_reg_as(S1);
869 soft_alloc_reg(reg_lb);
907 if ((type_of_tos()) == T_cst) {
933 if (type_of_tos() == T_cst)
941 force_alloc_output();
949 "set EILLINS, %s\n",reg_o0
973 if ((type_of_tos()) == T_cst) {
987 "sub %s, %s, %s\n",b,a,c
1006 if (type_of_tos() == T_cst)
1014 force_alloc_output();
1022 "set EILLINS, %s\n",reg_o0
1057 if (type_of_tos() == T_cst) {
1062 for (n0 = 0; !(n & 1); n>>=1)
1064 for (n1 = 0; n & 1; n>>=1)
1069 sprint(n_str, "%d", n0);
1071 "sll %s, %s, %s\n",orig,n_str,a
1078 soft_alloc_reg(orig);
1083 "add %s, %s, %s\n",c,orig,a
1091 sprint(n_str, "%d", n1);
1093 "sll %s, %s, %s\n",orig,n_str,a
1097 "sub %s, %s, %s\n",a,orig,b
1106 "add %s, %s, %s\n",c,b,a
1117 force_alloc_output();
1127 forced_alloc_reg(reg_o0);
1144 if (type_of_tos() == T_cst)
1152 force_alloc_output();
1160 "set EILLINS, %s\n",reg_o0
1188 const_str_t n_exp_str;
1193 force_alloc_output();
1205 forced_alloc_reg(reg_o0);
1222 if (type_of_tos() == T_cst)
1230 force_alloc_output();
1238 "set EILLINS, %s\n",reg_o0
1263 force_alloc_output();
1275 forced_alloc_reg(reg_o1);
1291 if (type_of_tos() == T_cst)
1299 force_alloc_output();
1307 "set EILLINS, %s\n",reg_o0
1338 "sub %%g0, %s, %s\n",a,b
1356 if (type_of_tos() == T_cst)
1364 force_alloc_output();
1372 "set EILLINS, %s\n",reg_o0
1402 if ((type_of_tos() == T_cst) &&
1403 (((top_const()) > -4096 && (top_const()) < 4096))) {
1409 "sll %s, %s, %s\n",a,n,b
1415 "sll %s, %s, %s\n",a,c,b
1435 if (type_of_tos() == T_cst)
1443 force_alloc_output();
1451 "set EILLINS, %s\n",reg_o0
1481 if ((type_of_tos() == T_cst) &&
1482 (((top_const()) > -4096 && (top_const()) < 4096))) {
1488 "sra %s, %s, %s\n",a,n,b
1494 "sra %s, %s, %s\n",a,c,b
1514 if (type_of_tos() == T_cst)
1522 force_alloc_output();
1530 "set EILLINS, %s\n",reg_o0
1569 if (type_of_tos() == T_cst)
1577 force_alloc_output();
1585 "set EILLINS, %s\n",reg_o0
1618 if (type_of_tos() == T_cst)
1626 force_alloc_output();
1634 "set EILLINS, %s\n",reg_o0
1684 if (type_of_tos() == T_cst)
1692 force_alloc_output();
1700 "set EILLINS, %s\n",reg_o0
1728 const_str_t n_exp_str;
1731 if (type_of_tos() == T_cst &&
1732 uns_power_of_2(top_const(), &n_exp))
1734 sprint (n_exp_str, "%d", n_exp);
1739 "srl %s, %s, %s\n",a,n_exp_str,b
1746 force_alloc_output();
1756 forced_alloc_reg(reg_o0);
1773 if (type_of_tos() == T_cst)
1781 force_alloc_output();
1789 "set EILLINS, %s\n",reg_o0
1814 force_alloc_output();
1824 forced_alloc_reg(reg_o1);
1840 if (type_of_tos() == T_cst)
1848 force_alloc_output();
1856 "set EILLINS, %s\n",reg_o0
1889 if (type_of_tos() == T_cst)
1897 force_alloc_output();
1905 "set EILLINS, %s\n",reg_o0
1935 if ((type_of_tos() == T_cst) &&
1936 (((top_const()) > -4096 && (top_const()) < 4096))) {
1942 "srl %s, %s, %s\n",a,n,b
1948 "srl %s, %s, %s\n",a,c,b
1968 if (type_of_tos() == T_cst)
1976 force_alloc_output();
1984 "set EILLINS, %s\n",reg_o0
2028 if (type_of_tos() == T_cst)
2037 "fadds %s, %s, %s\n",f2,f1,f3
2047 f3= alloc_double(0);
2049 "faddd %s, %s, %s\n",f1,f2,f3
2051 free_double_reg(f1);
2052 free_double_reg(f2);
2053 push_double_reg(f3);
2059 not_implemented ("adf_narg");
2081 if (type_of_tos() == T_cst)
2090 "fsubs %s, %s, %s\n",f2,f1,f3
2100 f3= alloc_double(0);
2102 "fsubd %s, %s, %s\n",f2,f1,f3
2104 free_double_reg(f1);
2105 free_double_reg(f2);
2106 push_double_reg(f3);
2112 not_implemented ("sbf_narg");
2134 if (type_of_tos() == T_cst)
2143 "fmuls %s, %s, %s\n",f2,f1,f3
2153 f3= alloc_double(0);
2155 "fmuld %s, %s, %s\n",f2,f1,f3
2157 free_double_reg(f1);
2158 free_double_reg(f2);
2159 push_double_reg(f3);
2165 not_implemented ("mlf_narg");
2187 if (type_of_tos() == T_cst)
2196 "fdivs %s, %s, %s\n",f2,f1,f3
2206 f3= alloc_double(0);
2208 "fdivd %s, %s, %s\n",f2,f1,f3
2210 free_double_reg(f1);
2211 free_double_reg(f2);
2212 push_double_reg(f3);
2218 not_implemented ("dvf_narg");
2239 if (type_of_tos() == T_cst)
2242 if (n == 4 || n == 8)
2247 "fnegs %s, %s\n",f1,f2
2256 not_implemented ("ngf_narg");
2277 if (type_of_tos() == T_cst)
2284 "! unimplemented fif 4\n"
2307 force_alloc_output();
2333 "! unimplemented fif 4\n"
2345 "set EILLINS, %s\n",reg_o0
2396 if (type_of_tos() == T_cst)
2403 "! unimplemented fef 4\n"
2426 force_alloc_output();
2452 "! unimplemented fef 4\n"
2464 "set EILLINS, %s\n",reg_o0
2512 if ((type_of_tos()) == T_cst) {
2538 if (type_of_tos() == T_cst)
2546 force_alloc_output();
2554 "set EILLINS, %s\n",reg_o0
2579 if ((type_of_tos()) == T_cst) {
2593 "sub %s, %s, %s\n",b,a,c
2612 if (type_of_tos() == T_cst)
2620 force_alloc_output();
2628 "set EILLINS, %s\n",reg_o0
2666 if (S1 = find_local($1, 0)) {
2672 soft_alloc_reg(reg_lb);
2677 soft_alloc_reg(reg_lb);
2698 sprint(evalue, "%d", $2);
2700 "sethi %%hi(%s+%s), %s\n",ename,evalue,a
2703 "ld [%s+%%lo(%s+%s)], %s\n",a,ename,evalue,b
2709 "st %s, [%s+%%lo(%s+%s)]\n",b,a,ename,evalue
2729 if (S1 = find_local($1, 0)) {
2735 soft_alloc_reg(reg_lb);
2740 soft_alloc_reg(reg_lb);
2761 sprint(evalue, "%d", $2);
2763 "sethi %%hi(%s+%s), %s\n",ename,evalue,a
2766 "ld [%s+%%lo(%s+%s)], %s\n",a,ename,evalue,b
2772 "st %s, [%s+%%lo(%s+%s)]\n",b,a,ename,evalue
2785 if (S1 = find_local($1, 0)) {
2792 soft_alloc_reg(reg_lb);
2811 sprint(evalue, "%d", $2);
2813 "sethi %%hi(%s+%s), %s\n",ename,evalue,a
2816 "st %%g0, [%s+%%lo(%s+%s)]\n",a,ename,evalue
2852 if (type_of_tos() == T_cst && top_const() <= 8)
2854 n= pop_const(n_str);
2871 "sub %s, %s, %s\n",reg_sp,a,reg_sp
2880 "st %%g0, [%s+%s]\n",reg_sp,a
2914 if (type_of_tos() != T_cst)
2922 n1= pop_const(n1_str);
2923 if (type_of_tos() != T_cst)
2927 "set %s, %s\n",n1_str,a
2947 "sll %s, 24, %s\n",a,b
2950 "sra %s, 24, %s\n",b,b
2956 "sll %s, 16, %s\n",a,b
2959 "sra %s, 16, %s\n",b,b
2994 "ldsb [%s+3], %s\n" ,reg_sp,a
3000 "ldsh [%s+2], %s\n",reg_sp,a
3006 "st %s, [%s]\n",a,reg_sp
3052 if (type_of_tos() != T_cst)
3059 n1= pop_const (n1_str);
3060 if (type_of_tos() != T_cst)
3064 "set %s, %s\n",n1_str,a
3081 "fstoi %s, %s\n",s1,d1
3091 "fdtoi %s, %s\n",s1,d1
3093 free_double_reg(s1);
3104 force_alloc_output();
3136 "ld [%s], %%f0\n",reg_sp
3139 "ld [%s+4], %%f1\n",reg_sp
3142 "fdtoi %%f0, %s\n",d1
3148 "inc 2*4, %s\n" ,reg_sp
3154 "ld [%s+2*4], %%f0\n",reg_sp
3157 "fstoi %%f0, %s\n",d1
3163 "inc 4, %s\n" ,reg_sp
3200 if (type_of_tos() != T_cst)
3207 n1= pop_const (n1_str);
3208 if (type_of_tos() != T_cst)
3212 "set %s, %s\n",n1_str,a
3224 force_alloc_output();
3246 soft_alloc_reg(reg_o0);
3253 force_alloc_output();
3322 soft_alloc_reg(reg_o0);
3341 if (type_of_tos() != T_cst)
3348 n1= pop_const (n1_str);
3349 if (type_of_tos() != T_cst)
3353 "set %s, %s\n",n1_str,a
3370 "fdtos %s, %s\n",a,b
3384 "fstod %s, %s\n",a,b
3398 force_alloc_output();
3451 "ld [%s], %%f0\n",reg_sp
3454 "fstod %%f0, %%f2\n"
3457 "dec 4, %s\n",reg_sp
3460 "st %%f2, [%s]\n",reg_sp
3463 "st %%f3, [%s+4]\n",reg_sp
3484 "ld [%s], %%f0\n",reg_sp
3487 "ld [%s+4], %%f1\n",reg_sp
3490 "fdtos %%f0, %%f2\n"
3493 "inc 4, %s\n",reg_sp
3496 "st %%f2, [%s]\n",reg_sp
3522 if (type_of_tos() != T_cst)
3529 n1= pop_const (n1_str);
3530 if (type_of_tos() != T_cst)
3534 "set %s, %s\n",n1_str,a
3553 "fitos %s, %s\n",r1,f1
3562 f1= alloc_double(0);
3564 "fitod %s, %s\n",r1,f1
3567 push_double_reg(f1);
3576 force_alloc_output();
3620 "ld [%s], %%f0\n",reg_sp
3623 "fitos %%f0, %%f1\n"
3629 "st %%f1, [%s]\n" ,reg_sp
3635 "dec 4, %s\n",reg_sp
3647 "ld [%s+4], %%f0\n",reg_sp
3650 "fitod %%f0, %%f2\n"
3653 "st %%f2, [%s]\n",reg_sp
3659 "st %%f3, [%s+4]\n" ,reg_sp
3689 if (type_of_tos() != T_cst)
3696 n1= pop_const (n1_str);
3697 if (type_of_tos() != T_cst)
3701 "set %s, %s\n",n1_str,a
3721 "fitos %s, %s\n",fs1,fs2
3724 "sethi %%hi(Fs0), %s\n",a
3727 "ld [%s+%%lo(Fs0)], %s\n",a,fs1
3730 "fcmpes %s, %s\n",fs2,fs1
3742 "sethi %%hi(Fs80000000), %s\n",a
3745 "ld [%s+%%lo(Fs80000000)], %s\n",a,fs1
3748 "fadds %s, %s, %s\n",fs1,fs2,fs2
3760 fd1= alloc_double(0);
3761 fd2= alloc_double(0);
3764 "fitod %s, %s\n",fs1,fd2
3767 "sethi %%hi(Fd0), %s\n",a
3770 "ldd [%s+%%lo(Fd0)], %s\n",a,fd1
3773 "fcmped %s, %s\n",fd2,fd1
3785 "sethi %%hi(Fd80000000), %s\n",a
3788 "ldd [%s+%%lo(Fd80000000)], %s\n",a,fd1
3791 "faddd %s, %s, %s\n",fd1,fd2,fd2
3797 free_double_reg(fd1);
3798 push_double_reg(fd2);
3808 not_implemented ("cuf");
3835 const_str_t a_cst_str;
3836 const_str_t b_cst_str;
3837 const_str_t c_cst_str;
3838 const_str_t d_cst_str;
3843 if (type_of_tos() == T_cst)
3845 n= pop_const(n_str);
3848 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3851 pop_const (a_cst_str);
3855 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3858 pop_const (b_cst_str);
3866 "mov %s, %s\n" ,a_cst_str,a
3873 "and %s, %s, %s\n",a,b,c
3877 "and %s, %s, %s\n",a,b_cst_str,c
3881 "and %s, %s, %s\n",b,a_cst_str,c
3889 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3892 pop_const (a_cst_str);
3896 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3899 pop_const (b_cst_str);
3903 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3906 pop_const (c_cst_str);
3910 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3913 pop_const (d_cst_str);
3921 "mov %s, %s\n" ,b_cst_str,b
3928 "and %s, %s, %s\n",b,d,e
3932 "and %s, %s, %s\n",b,d_cst_str,e
3936 "and %s, %s, %s\n",d,b_cst_str,e
3945 "mov %s, %s\n" ,a_cst_str,a
3952 "and %s, %s, %s\n",a,c,e
3956 "and %s, %s, %s\n",a,c_cst_str,e
3960 "and %s, %s, %s\n",c,a_cst_str,e
3977 "set %s, %s\n",n_str,a
3980 "add %s, %s, %s\n",reg_sp,a,b
3992 "ld [%s+%s], %s\n",reg_sp,c,d
3995 "ld [%s+%s], %s\n",b,c,e
3998 "and %s, %s, %s\n",d,e,f
4004 "st %s, [%s+%s]\n" ,f,b,c
4007 "add %s, %s, %s\n",reg_sp,a,reg_sp
4030 "add %s, %s, %s\n",reg_sp,a,b
4042 "ld [%s+%s], %s\n",reg_sp,c,d
4045 "ld [%s+%s], %s\n",b,c,e
4048 "and %s, %s, %s\n",d,e,f
4054 "st %s, [%s+%s]\n" ,f,b,c
4057 "add %s, %s, %s\n",reg_sp,a,reg_sp
4086 const_str_t a_cst_str;
4087 const_str_t b_cst_str;
4088 const_str_t c_cst_str;
4089 const_str_t d_cst_str;
4094 if (type_of_tos() == T_cst)
4096 n= pop_const(n_str);
4099 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4102 pop_const (a_cst_str);
4106 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4109 pop_const (b_cst_str);
4117 "mov %s, %s\n" ,a_cst_str,a
4124 "or %s, %s, %s\n",a,b,c
4128 "or %s, %s, %s\n",a,b_cst_str,c
4132 "or %s, %s, %s\n",b,a_cst_str,c
4140 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4143 pop_const (a_cst_str);
4147 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4150 pop_const (b_cst_str);
4154 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4157 pop_const (c_cst_str);
4161 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4164 pop_const (d_cst_str);
4172 "mov %s, %s\n" ,b_cst_str,b
4179 "or %s, %s, %s\n",b,d,e
4183 "or %s, %s, %s\n",b,d_cst_str,e
4187 "or %s, %s, %s\n",d,b_cst_str,e
4196 "mov %s, %s\n" ,a_cst_str,a
4203 "or %s, %s, %s\n",a,c,e
4207 "or %s, %s, %s\n",a,c_cst_str,e
4211 "or %s, %s, %s\n",c,a_cst_str,e
4228 "set %s, %s\n",n_str,a
4231 "add %s, %s, %s\n",reg_sp,a,b
4243 "ld [%s+%s], %s\n",reg_sp,c,d
4246 "ld [%s+%s], %s\n",b,c,e
4249 "or %s, %s, %s\n",d,e,f
4255 "st %s, [%s+%s]\n" ,f,b,c
4258 "add %s, %s, %s\n",reg_sp,a,reg_sp
4281 "add %s, %s, %s\n",reg_sp,a,b
4293 "ld [%s+%s], %s\n",reg_sp,c,d
4296 "ld [%s+%s], %s\n",b,c,e
4299 "or %s, %s, %s\n",d,e,f
4305 "st %s, [%s+%s]\n" ,f,b,c
4308 "add %s, %s, %s\n",reg_sp,a,reg_sp
4338 const_str_t a_cst_str;
4339 const_str_t b_cst_str;
4340 const_str_t c_cst_str;
4341 const_str_t d_cst_str;
4346 if (type_of_tos() == T_cst)
4348 n= pop_const(n_str);
4351 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4354 pop_const (a_cst_str);
4358 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4361 pop_const (b_cst_str);
4369 "mov %s, %s\n" ,a_cst_str,a
4376 "xor %s, %s, %s\n",a,b,c
4380 "xor %s, %s, %s\n",a,b_cst_str,c
4384 "xor %s, %s, %s\n",b,a_cst_str,c
4392 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4395 pop_const (a_cst_str);
4399 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4402 pop_const (b_cst_str);
4406 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4409 pop_const (c_cst_str);
4413 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4416 pop_const (d_cst_str);
4424 "mov %s, %s\n" ,b_cst_str,b
4431 "xor %s, %s, %s\n",b,d,e
4435 "xor %s, %s, %s\n",b,d_cst_str,e
4439 "xor %s, %s, %s\n",d,b_cst_str,e
4448 "mov %s, %s\n" ,a_cst_str,a
4455 "xor %s, %s, %s\n",a,c,e
4459 "xor %s, %s, %s\n",a,c_cst_str,e
4463 "xor %s, %s, %s\n",c,a_cst_str,e
4480 "set %s, %s\n",n_str,a
4483 "add %s, %s, %s\n",reg_sp,a,b
4495 "ld [%s+%s], %s\n",reg_sp,c,d
4498 "ld [%s+%s], %s\n",b,c,e
4501 "xor %s, %s, %s\n",d,e,f
4507 "st %s, [%s+%s]\n" ,f,b,c
4510 "add %s, %s, %s\n",reg_sp,a,reg_sp
4533 "add %s, %s, %s\n",reg_sp,a,b
4545 "ld [%s+%s], %s\n",reg_sp,c,d
4548 "ld [%s+%s], %s\n",b,c,e
4551 "xor %s, %s, %s\n",d,e,f
4557 "st %s, [%s+%s]\n" ,f,b,c
4560 "add %s, %s, %s\n",reg_sp,a,reg_sp
4593 if (type_of_tos() == T_cst && top_const() <= 16)
4623 else if (n>0 && !(n % 4))
4628 for (i= 0; i< n; i += 4)
4630 sprint(i_str, "%d", i);
4632 "ld [%s+%s], %s\n",reg_sp,i_str,a
4638 "st %s, [%s+%s]\n",b,reg_sp,i_str
4661 "ld [%s+%s], %s\n",reg_sp,a,b
4670 "st %s, [%s+%s]\n",c,reg_sp,a
4692 if (type_of_tos() == T_cst)
4705 sprint(n_str, "%d", n);
4707 "sll %s, %s, %s\n",a,n_str,b
4709 sprint(n_str, "%d", 32-n);
4711 "srl %s, %s, %s\n",a,n_str,c
4714 "or %s, %s, %s\n",b,c,c
4729 "and %s, 31, %s\n",a,c
4735 "sub %s, %s, %s\n",d,c,d
4738 "sll %s, %s, %s\n",b,c,c
4741 "srl %s, %s, %s\n",b,d,d
4744 "or %s, %s, %s\n",c,d,d
4765 if (type_of_tos() == T_cst)
4773 force_alloc_output();
4781 "set EILLINS, %s\n",reg_o0
4814 if (type_of_tos() == T_cst)
4827 sprint(n_str, "%d", n);
4829 "srl %s, %s, %s\n",a,n_str,b
4831 sprint(n_str, "%d", 32-n);
4833 "sll %s, %s, %s\n",a,n_str,c
4836 "or %s, %s, %s\n",b,c,c
4851 "and %s, 31, %s\n",a,c
4857 "sub %s, %s, %s\n",d,c,d
4860 "srl %s, %s, %s\n",b,c,c
4863 "sll %s, %s, %s\n",b,d,d
4866 "or %s, %s, %s\n",c,d,d
4887 if (type_of_tos() == T_cst)
4895 force_alloc_output();
4903 "set EILLINS, %s\n",reg_o0
4949 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4951 n= pop_const(n_str);
4954 if (type_of_tos() == T_cst)
4956 i= pop_const (i_str);
4964 "srl %s, %s, %s\n",a,i_str,b
4967 "and %s, 1, %s\n",b,b
4979 "srl %s, %s, %s\n",b,a,c
4982 "and %s, 1, %s\n",c,c
4991 if (type_of_tos() == T_cst)
4993 i= pop_const (i_str);
5012 "srl %s, %s, %s\n",a,i_str,b
5015 "and %s, 1, %s\n",b,c
5031 "andn %s, 31, %s\n",a,b
5034 "and %s, 31, %s\n",a,c
5037 "srl %s, 3, %s\n",b,d
5040 "ld [%s+%s], %s\n",reg_sp,d,b
5043 "inc %s, %s\n",n_str,reg_sp
5046 "srl %s, %s, %s\n",b,c,d
5049 "and %s, 1, %s\n",d,b
5068 "andn %s, 31, %s\n",a,b
5071 "and %s, 31, %s\n",a,c
5074 "srl %s, 3, %s\n",b,d
5077 "ld [%s+%s], %s\n",reg_sp,d,b
5080 "inc %s, %s\n",n_str,reg_sp
5083 "srl %s, %s, %s\n",b,c,d
5086 "and %s, 1, %s\n",d,b
5095 not_implemented ("inn_narg");
5117 if (type_of_tos() == T_cst) {
5118 n = pop_const(n_str);
5127 "sll %s, %s, %s\n",c,a,b
5138 sprint(n_str, "%d", n);
5140 "set %s, %s\n",n_str,a
5143 "sub %s, %s, %s\n",reg_sp,a,reg_sp
5155 "st %%g0, [%s+%s]\n" ,reg_sp,a
5158 "andn %s, 31, %s\n",b,c
5161 "and %s, 31, %s\n",b,d
5164 "srl %s, 3, %s\n",c,c
5170 "sll %s, %s, %s\n",a,d,d
5173 "st %s, [%s+%s]\n",d,reg_sp,c
5188 "sub %s, %s, %s\n",reg_sp,a,reg_sp
5200 "st %%g0, [%s+%s]\n" ,reg_sp,a
5203 "andn %s, 31, %s\n",b,c
5206 "and %s, 31, %s\n",b,d
5209 "srl %s, 3, %s\n",c,c
5215 "sll %s, %s, %s\n",a,d,d
5218 "st %s, [%s+%s]\n",d,reg_sp,c
5239 force_alloc_output();
5264 if (type_of_tos() == T_cst)
5272 force_alloc_output();
5280 "set EILLINS, %s\n",reg_o0
5304 force_alloc_output();
5329 if (type_of_tos() == T_cst)
5337 force_alloc_output();
5345 "set EILLINS, %s\n",reg_o0
5369 force_alloc_output();
5380 soft_alloc_reg(reg_o0);
5396 if (type_of_tos() == T_cst)
5404 force_alloc_output();
5412 "set EILLINS, %s\n",reg_o0
5449 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
5483 if (type_of_tos() == T_cst)
5534 if (type_of_tos() == T_cst)
5542 force_alloc_output();
5550 "set EILLINS, %s\n",reg_o0
5587 if (type_of_tos() == T_cst)
5594 if (type_of_tos() == T_cst &&
5595 ((top_const()) > -4096 && (top_const()) < 4096))
5629 if (type_of_tos() == T_cst &&
5630 ((top_const()) > -4096 && (top_const()) < 4096))
5670 not_implemented ("cmu_narg");
5694 if (type_of_tos() == T_cst && top_const() <= 4)
5696 n= pop_const(n_str);
5701 if (type_of_tos() == T_cst &&
5702 ((top_const()) > -4096 && (top_const()) < 4096))
5707 "cmp %s, %s\n",a,b_str
5747 "add %s, %s, %s\n",reg_sp,a,b
5759 "ld [%s+%s], %s\n",b,a,d
5771 "cmp %s, %s\n",b,reg_sp
5786 "add %s, %s, %s\n",reg_sp,a,reg_sp
5789 "add %s, %s, %s\n",reg_sp,a,reg_sp
5995 if (type_of_tos() == T_cst)
6004 "fcmpes %s, %s\n",b,a
6037 "fcmped %s, %s\n",b,a
6068 not_implemented ("cmf_narg");
6105 if (type_of_tos() == T_cst &&
6106 ((top_const()) > -4096 && (top_const()) < 4096))
6118 "cmp %s, %s\n",b,n_str
6141 if (type_of_tos() == T_cst &&
6142 ((top_const()) > -4096 && (top_const()) < 4096))
6154 "cmp %s, %s\n",b,n_str
6177 if (type_of_tos() == T_cst &&
6178 ((top_const()) > -4096 && (top_const()) < 4096))
6190 "cmp %s, %s\n",b,n_str
6213 if (type_of_tos() == T_cst &&
6214 ((top_const()) > -4096 && (top_const()) < 4096))
6226 "cmp %s, %s\n",b,n_str
6249 if (type_of_tos() == T_cst &&
6250 ((top_const()) > -4096 && (top_const()) < 4096))
6262 "cmp %s, %s\n",b,n_str
6285 if (type_of_tos() == T_cst &&
6286 ((top_const()) > -4096 && (top_const()) < 4096))
6298 "cmp %s, %s\n",b,n_str
6492 forced_alloc_reg(reg_o0);
6500 forced_alloc_reg(reg_o0);
6501 forced_alloc_reg(reg_o1);
6518 free_all_reg_vars();
6526 "add %%sp, %s, %%sp\n",reg_gap
6529 alloc_all_reg_vars();
6536 soft_alloc_reg(reg_i0);
6541 free_all_reg_vars();
6549 "add %%sp, %s, %%sp\n",reg_gap
6552 alloc_all_reg_vars();
6559 soft_alloc_reg(reg_i0);
6560 soft_alloc_reg(reg_i1);
6567 free_all_reg_vars();
6575 "add %%sp, %s, %%sp\n",reg_gap
6578 alloc_all_reg_vars();
6608 if (type_of_tos() == T_cst)
6610 n= pop_const(n_str);
6619 if (((n) > -4096 && (n) < 4096))
6621 "inc %s, %s\n",n_str,reg_sp
6627 "set %s, %s\n",n_str,a
6630 "add %s, %s, %s\n",reg_sp,a,reg_sp
6641 "add %s, %s, %s\n",reg_sp,a,reg_sp
6660 if (type_of_tos() == T_cst)
6668 force_alloc_output();
6676 "set EILLINS, %s\n",reg_o0
6721 if (type_of_tos() == T_cst)
6723 n= pop_const(n_str);
6729 for (i=0; i<n; i += 4)
6731 if (type_of_tos() & T_reg2)
6732 a= pop_reg_reg (&ao_reg);
6736 a= pop_reg_c13(ac_str);
6738 if (type_of_tos() & T_reg2)
6739 b= pop_reg_reg (&bo_reg);
6743 b= pop_reg_c13(bc_str);
6747 "ld [%s+%s], %s\n",b,bo_reg,c
6751 "ld [%s+%s], %s\n",b,bc_str,c
6755 "st %s, [%s+%s]\n",c,a,ao_reg
6759 "st %s, [%s+%s]\n",c,a,ac_str
6764 inc_tos_reg(bo_reg);
6766 else if (bc_str[0] == '-' ||
6770 inc_tos(atoi(bc_str));
6775 "add %s, %s, %s\n",b,bc_str,c
6785 inc_tos_reg(ao_reg);
6787 else if (ac_str[0] == '-' ||
6791 inc_tos(atoi(ac_str));
6796 "add %s, %s, %s\n",a,ac_str,c
6815 "set %s-4, %s\n",n_str,c
6827 "ld [%s+%s], %s\n",b,e,d
6836 "st %s, [%s+%s]\n",d,a,e
6864 "st %s, [%s+%s]\n",d,a,e
6879 "ld [%s+%s], %s\n",b,e,d
6902 if (type_of_tos() == T_cst)
6910 force_alloc_output();
6918 "set EILLINS, %s\n",reg_o0
6943 force_alloc_output();
6949 "set csa, %s\n",reg_tmp
6971 if (type_of_tos() == T_cst)
6979 force_alloc_output();
6987 "set EILLINS, %s\n",reg_o0
7012 force_alloc_output();
7018 "set csb, %s\n",reg_tmp
7040 if (type_of_tos() == T_cst)
7048 force_alloc_output();
7056 "set EILLINS, %s\n",reg_o0
7091 "add %s, 7, %s\n",a,b
7094 "andn %s, 7, %s\n" ,b,c
7097 "ld [%s+4], %s\n" ,c,b
7126 if (type_of_tos() == T_cst && top_const() <= 16)
7128 n= pop_const(n_str);
7129 if (n == 4 || n == 8 || n<=32)
7131 else if (n<0 || n % 4)
7138 "sub %s, %s, %s\n",reg_sp,n_str,reg_sp
7140 for (i=0; i<n; i += 4)
7142 sprint(i_str, "%d", i);
7144 "ld [%s+%s+%s], %s\n",reg_sp,i_str,n_str,a
7147 "st %s, [%s+%s]\n",a,reg_sp,i_str
7166 "dec 4, %s\n",reg_sp
7169 "ld [%s+ %s], %s\n",reg_sp,a,c
7178 "st %s, [%s+ %s]\n" ,c,reg_sp,a
7198 if (type_of_tos() == T_cst)
7206 force_alloc_output();
7214 "set EILLINS, %s\n",reg_o0
7254 if (type_of_tos() == T_cst && top_const() <= 16)
7275 else if (n>0 && !(n % 4))
7280 for (i=0; i<n; i += 4)
7282 sprint(i_str, "%d", i);
7283 sprint(in_str, "%d", i+n);
7285 "ld [%s+%s], %s\n",reg_sp,i_str,a
7288 "ld [%s+%s], %s\n",reg_sp,in_str,b
7291 "st %s, [%s+%s]\n",b,reg_sp,i_str
7294 "st %s, [%s+%s]\n",a,reg_sp,in_str
7311 "add %s, %s, %s\n",reg_sp,a,b
7320 "cmp %s, %s\n",reg_sp,b
7326 "ld [%s+%s], %s\n",b,a,d
7335 "st %s, [%s+%s]\n" ,c,b,a
7374 forced_alloc_reg(a);
7375 forced_alloc_reg(b);
7376 forced_alloc_reg(c);
7377 forced_alloc_reg(d);
7383 "ld [%s+8], %s\n",a,b
7386 "mov %s, %s\n",reg_o0,c
7389 "mov %s, %s\n",reg_o1,d
7395 "cmp %s, %s\n",b,reg_lb
7404 "ld [%s+4], %s\n",a,reg_sp
7410 "mov %s, %s\n",c,reg_o0
7416 "mov %s, %s\n" ,d,reg_o1
7454 "sethi %%hi(lino), %s\n",a
7457 "ld [%s+%%lo(lino)], %s\n",a,b
7463 "st %s, [%s+%%lo(lino)]\n",b,a
7476 soft_alloc_reg(reg_lb);
7488 "mov %s, %s\n",reg_sp,a
7522 C_adp( (arith)((16*4) + 8 + 4 + (16 * 4))))
7529 force_alloc_output();
7557 force_alloc_output();
7573 "ld [%s+4], %s\n",a,c
7588 "set ERANGE, %s\n",reg_o0
7617 if (type_of_tos() == T_cst)
7625 force_alloc_output();
7633 "set EILLINS, %s\n",reg_o0
7714 "ld [%s], %s\n",reg_sp,reg_lb
7717 "add %s, 4, %%fp\n",reg_lb
7720 "and %%fp, -8, %%fp\n"
7723 "inc 4, %s\n",reg_sp
7733 "ld [%s], %s\n",reg_sp,reg_sp
7741 force_alloc_output();
7761 force_alloc_output();
7779 gen1( (int) atoi( $1)))
7784 gen2( (int) atoi( $1)))
7789 gen4( (long) atol( $1)))
7800 gen1( (int) atoi( $1)))
7805 gen2( (int) atoi( $1)))
7810 gen4( (long) atol( $1)))
7830 "sub %s, (((16*4) + 8 + 4 + (16 * 4))-4), %%g1\n",reg_sp
7833 "and %%g1, -8, %%sp\n"
7836 "mov %s, %%g1\n",reg_sp
7839 "save %%sp, %s, %%sp\n",reg_gap
7842 "st %%g0, [%%sp+(16*4)]\n"
7845 "sub %%g1, ((16*4) + 8 + 4 + (16 * 4)), %s\n",reg_lb
7848 forced_alloc_reg(reg_sp);
7849 forced_alloc_reg(reg_lb);
7850 forced_alloc_reg(reg_gap);
7875 soft_alloc_reg(reg_lb);