Pristine Ack-5.5
[Ack-5.5.git] / mach / sparc / ce / EM_table
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 C_loc           ==>
122 code_combiner(
123                         ;
124                         push_const($1))
125 .
126
127
128 C_lol           ==>
129 code_combiner(
130                 ;
131                 {
132                         reg_t S1;
133
134                         if (S1 = find_local($1, 0)) {
135                                 soft_alloc_reg(S1);
136                                 push_reg(S1);
137                         } else {
138                                 soft_alloc_reg(reg_lb);
139                                 push_reg(reg_lb);
140                                 inc_tos($1);
141                                 push_const(4);
142                                 C_los(4);
143                         }
144                 })
145 .
146
147
148 C_loe..         ==>
149 code_combiner(
150                 ;
151                 {
152
153                                 push_ext($1);
154                                 inc_tos($2);
155                                 push_const(4);
156                                 C_los(4);
157
158                 }
159                 )
160 .
161
162 C_lil           ==>
163 code_combiner(
164                 ;
165                 {
166                         reg_t S1;
167                         reg_t S2;
168
169                         if (S1 = find_local($1, 0)) {
170                                 S2 = alloc_reg();
171 fprint ( codefile,
172                                 "ld     [%s], %s\n",S1,S2
173 );
174                                 push_reg(S2);
175                         } else {
176                                 soft_alloc_reg(reg_lb);
177                                 push_reg(reg_lb);
178                                 inc_tos($1);
179                                 push_const(4);
180                                 C_los(4);
181                                 push_const(4);
182                                 C_los(4);
183                         }
184                 })
185 .
186
187 C_lof           ==>
188 code_combiner(
189                         ;
190                         inc_tos($1);
191                         push_const(4);
192                         C_los(4))
193 .
194
195 C_lal           ==>
196 code_combiner(
197                         ;
198                         soft_alloc_reg(reg_lb);
199                         push_reg(reg_lb);
200                         inc_tos($1))
201 .
202
203 C_lae..         ==>
204 code_combiner(
205                         ;
206                         push_ext($1);
207                         inc_tos($2))
208 .
209
210 C_lxl
211         $1 == 0 ==>
212 code_combiner(
213                         ;
214                         soft_alloc_reg(reg_lb);
215                         push_reg(reg_lb))
216 .
217         $1 == 1 ==>
218 code_combiner(
219                         ;
220                         soft_alloc_reg(reg_lb);
221                         push_reg(reg_lb);
222                         inc_tos(((16*4) + 8 + 4 + (16 * 4)));
223                         push_const(4);
224                         C_los(4))
225 .
226         default ==>
227 code_combiner(
228                         ;
229                         {
230                                 reg_t a;
231                                 reg_t b;
232                                 reg_t c;
233                                 const_str_t n_str;
234
235                                 a = alloc_reg();
236                                 b = alloc_reg();
237                                 c = alloc_reg();
238                                 sprint(n_str, "%d", $1);
239 fprint ( codefile,
240                                 "set    %s, %s\n",n_str,a
241 );
242 fprint ( codefile,
243                                 "mov    %s, %s\n",reg_lb,b
244 );
245 fprint ( codefile,
246                         "1:     ld      [%s + ((16*4) + 8 + 4 + (16 * 4))], %s\n",b,c
247 );
248 fprint ( codefile,
249                                 "deccc  %s\n",a
250 );
251 fprint ( codefile,
252                                 "bnz    1b\n"
253 );
254 fprint ( codefile,
255                                 "mov    %s, %s\n",c,b
256 );
257                                 push_reg(b);
258                                 free_reg(a);
259                                 free_reg(c);
260                         })
261 .
262
263 C_lxa   ==>
264 code_combiner(
265         C_lxl($1);
266         inc_tos(((16*4) + 8 + 4 + (16 * 4))))
267 .
268
269 C_loi
270         ( $1 == 1 ) ||
271         ( $1 == 2 ) ||
272         ( $1 % 4 == 0 ) ==>
273 code_combiner(
274                         ;
275                         push_const($1);
276                         C_los(4))
277 .
278
279         default         ==>
280 code_combiner(
281                                 )
282 .
283
284 C_los
285         $1 == 4  ==>
286 code_combiner(
287         {
288                 reg_t a;
289                 reg_t b;
290                 reg_t c;
291                 int i;
292                 char *LD;
293                 arith size;
294                 const_str_t n;
295                 const_str_t size_str;
296
297                 ;
298                 if (type_of_tos() == T_cst && top_const() <= 16) {
299                         size = pop_const(size_str);
300                         if (size <= 4) {
301                                 switch (size) {
302                                 case 1: LD = "ldub"; break;
303                                 case 2: LD = "lduh"; break;
304                                 case 4: LD = "ld"; break;
305                                 default: ;
306                                 }
307                                 b = alloc_reg();
308                                 if (type_of_tos() & T_reg2)
309                                 {
310                                         a= pop_reg_reg(&c);
311 fprint ( codefile,
312                                         "%s     [%s+%s], %s\n",LD,a,c,b
313 );
314                                         free_reg(a);
315                                         free_reg(c);
316                                 }
317                                 else
318                                 {
319                                         a = pop_reg_c13(n);
320 fprint ( codefile,
321                                         "%s     [%s+%s], %s\n",LD,a,n,b
322 );
323                                         free_reg(a);
324                                 }
325                                 push_reg(b);
326                         } else if (size <= 16) {    
327                                 inc_tos(size-4);
328                                 for (i = 0; i < size; i += 4) {
329                                         b = alloc_reg();
330                                         if (type_of_tos() & T_reg2)
331                                         {
332                                                 a= pop_reg_reg(&c);
333 fprint ( codefile,
334                                                 "ld     [%s+%s], %s\n",a,c,b
335 );
336                                                 push_reg(b);
337                                                 push_reg(a);
338                                                 inc_tos_reg(c);
339                                         }
340                                         else
341                                         {
342                                                 a = pop_reg_c13(n);
343 fprint ( codefile,
344                                                 "ld     [%s+%s], %s\n",a,n,b
345 );
346                                                 push_reg(b);
347                                                 if (n[0] == '-' || isdigit(n[0]))
348                                                 {
349                                                         push_reg(a);
350                                                         inc_tos(atoi(n));
351                                                 }
352                                                 else
353                                                 {
354                                                         b= alloc_reg();
355 fprint ( codefile,
356                                                         "add    %s, %s, %s\n",a,n,b
357 );
358                                                         push_reg(b);
359                                                         free_reg(a);
360                                                 }
361                                         }
362                                         inc_tos(-4);
363                                 }
364                                 pop_nop(1);
365                         } else
366                                 ;
367                 }
368                 else {
369                         a = alloc_reg();        
370                         pop_reg_as(a);
371                         b = pop_reg();  
372                         c = alloc_reg();
373                         flush_cache();
374 fprint ( codefile,
375                         "sub    %s, %s, %s\n"   ,reg_sp,a,reg_sp
376 );
377 fprint ( codefile,
378                 "1:      deccc  4, %s\n",a
379 );
380 fprint ( codefile,
381                         "ld     [%s+%s], %s\n",b,a,c
382 );
383 fprint ( codefile,
384                         "bnz    1b\n"
385 );
386 fprint ( codefile,
387                         "st     %s, [%s+%s]\n"  ,c,reg_sp,a
388 );
389                         free_reg(a);
390                         free_reg(b);
391                         free_reg(c);
392                 }
393         })
394 .
395         default ==>
396 code_combiner(
397                 )
398 .
399
400
401 C_los_narg      ==>
402 code_combiner(
403         {
404                 reg_t a;
405                 int n;
406                 
407                 ;
408                 if (type_of_tos() == T_cst)
409                 {
410                         n= pop_const(0);
411                         C_los (n);
412                 }
413                 else
414                 {
415                         a= pop_reg();
416                         force_alloc_output();
417 fprint ( codefile,
418                         "cmp    %s, 4\n",a
419 );
420 fprint ( codefile,
421                         "be     1f\n"
422 );
423 fprint ( codefile,
424                         "set    EILLINS, %s\n",reg_o0
425 );
426 fprint ( codefile,
427                         "call   trp\n"
428 );
429 fprint ( codefile,
430                         "nop\n"
431 );
432 fprint ( codefile,
433                 "1:\n"
434 );
435                         free_reg(a);
436                         free_output();
437                 C_los (4);
438                 }
439         })
440 .
441
442
443
444 C_ldl           ==>
445 code_combiner(
446                 ;
447                 {
448                         reg_t S1;
449                         reg_t S2;
450
451                         if (S1 = find_local($1, &S2)) {
452                                 soft_alloc_reg(S1);
453                                 soft_alloc_reg(S2);
454                                 push_double_reg(S1);
455                         } else {
456                                 soft_alloc_reg(reg_lb);
457                                 push_reg(reg_lb);
458                                 inc_tos($1);
459                                 push_const(8);
460                                 C_los(4);
461                         }
462                 })
463 .
464
465
466 C_lde..         ==>
467 code_combiner(
468                         ;
469                         push_ext($1);
470                         inc_tos($2);
471                         push_const(8);
472                         C_los(4))
473 .
474
475 C_ldf           ==>
476 code_combiner(
477                         ;
478                         inc_tos($1);
479                         push_const(8);
480                         C_los(4))
481 .
482
483 C_lpi           ==>
484 code_combiner(
485                         ;
486                         push_ext($1))
487 .
488
489
490
491
492
493
494
495
496 C_stl           ==>
497 code_combiner(
498                 ;
499                 {
500                         reg_t S1;
501
502                         if ((S1 = find_local($1, 0))) {
503                                 pop_reg_as(S1);
504                         } else {
505                                 soft_alloc_reg(reg_lb);
506                                 push_reg(reg_lb);
507                                 inc_tos($1);
508                                 push_const(4);
509                                 C_sts(4);
510                         }
511                 })
512 .
513
514 C_ste..         ==>
515 code_combiner(
516                         ;
517                         push_ext($1);
518                         inc_tos($2);
519                         push_const(4);
520                         C_sts(4))
521 .
522
523
524 C_sil           ==>
525 code_combiner(
526                 ;
527                 {
528                         reg_t S1;
529                         reg_t S2;
530
531                         if (S1 = find_local($1, 0)) {
532                                 S2 = pop_reg();
533 fprint ( codefile,
534                                 "st     %s, [%s]\n",S2,S1
535 );
536                                 free_reg(S2);
537                         } else {
538                                 soft_alloc_reg(reg_lb);
539                                 push_reg(reg_lb);
540                                 inc_tos($1);
541                                 push_const(4);
542                                 C_los(4);
543                                 push_const(4);
544                                 C_sts(4);
545                         }
546                 })
547 .
548
549 C_stf           ==>
550 code_combiner(
551                         ;
552                         inc_tos($1);
553                         push_const(4);
554                         C_sts(4))
555 .
556
557 C_sti
558         ( $1 == 1) ||
559         ( $1 == 2) ||
560         ( $1 % 4 == 0 ) ==>
561 code_combiner(
562                         ;
563                         push_const($1);
564                         C_sts(4))
565 .
566
567         default         ==>
568 code_combiner(
569                                 )
570 .
571
572
573 C_sts
574         $1 == 4  ==>
575 code_combiner(
576         {
577                 reg_t a;
578                 reg_t b;
579                 reg_t c;
580                 reg_t d;
581
582                 arith size;
583                 const_str_t n;
584                 const_str_t size_str;
585                 int i;
586                 char *ST;
587
588                 ;
589                 if (type_of_tos() == T_cst && top_const() <= 16) {
590
591                         size = pop_const(size_str);
592                         if (size <= 4) {
593
594                                 switch (size) {
595                                 case 1: ST = "stb"; break;
596                                 case 2: ST = "sth"; break;
597                                 case 4: ST = "st"; break;
598                                 default: ;
599                                 }
600                                 c= 0;
601                                 if (type_of_tos() & T_reg2)
602                                         a= pop_reg_reg(&c);
603                                 else
604                                         a = pop_reg_c13(n);
605                                 if (type_of_tos() == T_float) {
606                                         b= pop_float();
607                                         if (size < 4) {
608 fprint ( codefile,
609                                                 "st     %s,[%%fp+64]\n",b
610 );
611                                                 free_reg(b);
612                                                 b= alloc_reg();
613 fprint ( codefile,
614                                                 "ld     [%%fp+64],%s\n",b
615 );
616                                         }
617                                 }
618                                 else
619                                         b = pop_reg();
620                                 if (c)
621                                 {
622 fprint ( codefile,
623                                         "%s     %s, [%s+%s]\n",ST,b,a,c
624 );
625                                         free_reg(c);
626                                 }
627                                 else
628 fprint ( codefile,
629                                         "%s     %s, [%s+%s]\n",ST,b,a,n
630 );
631                                 free_reg(a);
632                                 free_reg(b);
633                         } else if (size <= 16) {
634                                 for (i = 0; i < size; i+=4) {
635                                         c= 0;
636                                         if (type_of_tos() & T_reg2)
637                                                 a= pop_reg_reg(&c);
638                                         else
639                                                 a = pop_reg_c13(n);
640                                         if (type_of_tos() == T_float)
641                                                 b= pop_float();
642                                         else
643                                                 b = pop_reg();
644                                         if (c)
645 fprint ( codefile,
646                                                 "st     %s, [%s+%s]\n",b,a,c
647 );
648                                         else
649 fprint ( codefile,
650                                                 "st     %s, [%s+%s]\n",b,a,n
651 );
652                                         free_reg(b);
653                                         if (c)
654                                         {
655                                                 push_reg(a);
656                                                 inc_tos_reg(c);
657                                         }
658                                         else if (n[0] == '-' || isdigit(n[0]))
659                                         {
660                                                 push_reg(a);
661                                                 inc_tos(atoi(n));
662                                         }
663                                         else
664                                         {
665                                                 b= alloc_reg();
666 fprint ( codefile,
667                                                 "add    %s, %s, %s\n",a,n,b
668 );
669                                                 push_reg(b);
670                                                 free_reg(a);
671                                         }
672                                         inc_tos(4);
673                                 }
674                                 pop_nop(1);
675                         } else
676                                 ;
677                 }
678                 else {
679                         force_alloc_output();
680                         d = pop_reg();          
681                         a = pop_reg();          
682                         flush_cache();
683                         b = alloc_reg();
684                         c = alloc_reg();
685 fprint ( codefile,
686                         "cmp    %s, 4\n",d
687 );
688 fprint ( codefile,
689                         "bg,a   8f\n"
690 );
691 fprint ( codefile,
692                         "andcc  %s, 3, %%g0\n"  ,d
693 );
694 fprint ( codefile,
695                         "be,a   4f\n"
696 );
697 fprint ( codefile,
698                         "ld     [%s], %s\n"     ,reg_sp,b
699 );
700 fprint ( codefile,
701                         "cmp    %s, 1\n",d
702 );
703 fprint ( codefile,
704                         "be,a   1f\n"
705 );
706 fprint ( codefile,
707                         "ld     [%s], %s\n"     ,reg_sp,b
708 );
709 fprint ( codefile,
710                         "bl     0f\n"
711 );
712 fprint ( codefile,
713                         "cmp    %s, 2\n",d
714 );
715 fprint ( codefile,
716                         "be     2f\n"
717 );
718 fprint ( codefile,
719                         "ld     [%s], %s\n"     ,reg_sp,b
720 );
721 fprint ( codefile,
722                 "3:      set    EILLINS, %%o0\n"
723 );
724 fprint ( codefile,
725                         "call   trp\n"
726 );
727 fprint ( codefile,
728                         "nop\n"
729 );
730 fprint ( codefile,
731                         "b      0f\n"
732 );
733 fprint ( codefile,
734                         "nop\n"
735 );
736 fprint ( codefile,
737                 "1:\n"
738 );
739 fprint ( codefile,
740                         "inc    4, %s\n",reg_sp
741 );
742 fprint ( codefile,
743                         "b      0f\n"
744 );
745 fprint ( codefile,
746                         "stb    %s, [%s]\n"     ,b,a
747 );
748 fprint ( codefile,
749                 "2:\n"
750 );
751 fprint ( codefile,
752                         "inc    4, %s\n",reg_sp
753 );
754 fprint ( codefile,
755                         "b      0f\n"
756 );
757 fprint ( codefile,
758                         "sth    %s, [%s]\n"     ,b,a
759 );
760 fprint ( codefile,
761                 "4:\n"
762 );
763 fprint ( codefile,
764                         "inc    4, %s\n",reg_sp
765 );
766 fprint ( codefile,
767                         "b      0f\n"
768 );
769 fprint ( codefile,
770                         "st     %s, [%s]\n"     ,b,a
771 );
772 fprint ( codefile,
773                 "8:\n"
774 );
775 fprint ( codefile,
776                         "bne    3b\n"
777 );
778 fprint ( codefile,
779                         "nop\n"
780 );
781 fprint ( codefile,
782                         "mov    %s, %s\n",d,b
783 );
784 fprint ( codefile,
785                 "9:      deccc  4, %s\n",b
786 );
787 fprint ( codefile,
788                         "ld     [%s+%s], %s\n",reg_sp,b,c
789 );
790 fprint ( codefile,
791                         "bnz    9b\n"
792 );
793 fprint ( codefile,
794                         "st     %s, [%s+%s]\n"  ,c,a,b
795 );
796 fprint ( codefile,
797                         "add    %s, %s, %s\n"   ,reg_sp,d,reg_sp
798 );
799 fprint ( codefile,
800                 "0:\n"
801 );
802                         free_reg(a);
803                         free_reg(b);
804                         free_reg(c);
805                         free_reg(d);
806                         free_output();
807                 }
808         })
809 .
810         default         ==>
811 code_combiner(
812                                 )
813 .
814
815 C_sts_narg      ==>
816 code_combiner(
817         {
818                 reg_t a;
819                 int n;
820                 
821                 ;
822                 if (type_of_tos() == T_cst)
823                 {
824                         n= pop_const(0);
825                         C_sts (n);
826                 }
827                 else
828                 {
829                         a= pop_reg();
830                         force_alloc_output();
831 fprint ( codefile,
832                         "cmp    %s, 4\n",a
833 );
834 fprint ( codefile,
835                         "be     1f\n"
836 );
837 fprint ( codefile,
838                         "set    EILLINS, %s\n",reg_o0
839 );
840 fprint ( codefile,
841                         "call   trp\n"
842 );
843 fprint ( codefile,
844                         "nop\n"
845 );
846 fprint ( codefile,
847                 "1:\n"
848 );
849                         free_reg(a);
850                         free_output();
851                 C_sts (4);
852                 }
853         })
854 .
855
856
857
858 C_sdl           ==>
859 code_combiner(
860                 ;
861                 {
862                         reg_t S1;
863                         reg_t S2;
864
865                         S1 = find_local($1, 0);
866                         if (S1) 
867                                 pop_double_reg_as(S1);
868                         else {
869                                 soft_alloc_reg(reg_lb);
870                                 push_reg(reg_lb);
871                                 inc_tos($1);
872                                 push_const(8);
873                                 C_sts(4);
874                         }
875                 })
876 .
877
878 C_sde..         ==>
879 code_combiner(
880                         ;
881                         push_ext($1);
882                         inc_tos($2);
883                         push_const(8);
884                         C_sts(4))
885 .
886
887 C_sdf           ==>
888 code_combiner(
889                         ;
890                         inc_tos($1);
891                         push_const(8);
892                         C_sts(4))
893 .
894
895
896
897
898
899
900
901
902
903 C_adi
904         $1 == 4 ==>
905 code_combiner(
906                         ;
907                         if ((type_of_tos()) == T_cst) {
908                                 arith n;
909
910                                 n = pop_const(0);
911                                 inc_tos(n);
912                         } else {
913                                 reg_t a;
914                                 reg_t b;
915                                 reg_t c;
916
917                                 a = pop_reg();
918                                 inc_tos_reg(a);
919                         })
920 .
921         default ==>
922 code_combiner(
923                                 )
924 .
925
926 C_adi_narg      ==>
927 code_combiner(
928         {
929                 reg_t a;
930                 int n;
931                 
932                 ;
933                 if (type_of_tos() == T_cst)
934                 {
935                         n= pop_const(0);
936                         C_adi (n);
937                 }
938                 else
939                 {
940                         a= pop_reg();
941                         force_alloc_output();
942 fprint ( codefile,
943                         "cmp    %s, 4\n",a
944 );
945 fprint ( codefile,
946                         "be     1f\n"
947 );
948 fprint ( codefile,
949                         "set    EILLINS, %s\n",reg_o0
950 );
951 fprint ( codefile,
952                         "call   trp\n"
953 );
954 fprint ( codefile,
955                         "nop\n"
956 );
957 fprint ( codefile,
958                 "1:\n"
959 );
960                         free_reg(a);
961                         free_output();
962                 C_adi (4);
963                 }
964         })
965 .
966
967
968
969 C_sbi
970         $1 == 4 ==>
971 code_combiner(
972                         ;
973                         if ((type_of_tos()) == T_cst) {
974                                 arith n;
975
976                                 n = pop_const(0);
977                                 inc_tos(-n);
978                         } else {
979                                 reg_t a;
980                                 reg_t b;
981                                 reg_t c;
982
983                                 a = pop_reg();
984                                 b = pop_reg();
985                                 c = alloc_reg();
986 fprint ( codefile,
987                                 "sub    %s, %s, %s\n",b,a,c
988 );
989                                 free_reg(a);
990                                 free_reg(b);
991                                 push_reg(c);
992                         })
993 .
994         default ==>
995 code_combiner(
996                                 )
997 .
998
999 C_sbi_narg      ==>
1000 code_combiner(
1001         {
1002                 reg_t a;
1003                 int n;
1004                 
1005                 ;
1006                 if (type_of_tos() == T_cst)
1007                 {
1008                         n= pop_const(0);
1009                         C_sbi (n);
1010                 }
1011                 else
1012                 {
1013                         a= pop_reg();
1014                         force_alloc_output();
1015 fprint ( codefile,
1016                         "cmp    %s, 4\n",a
1017 );
1018 fprint ( codefile,
1019                         "be     1f\n"
1020 );
1021 fprint ( codefile,
1022                         "set    EILLINS, %s\n",reg_o0
1023 );
1024 fprint ( codefile,
1025                         "call   trp\n"
1026 );
1027 fprint ( codefile,
1028                         "nop\n"
1029 );
1030 fprint ( codefile,
1031                 "1:\n"
1032 );
1033                         free_reg(a);
1034                         free_output();
1035                 C_sbi (4);
1036                 }
1037         })
1038 .
1039
1040
1041
1042 C_mli
1043         $1 == 4 ==>
1044 code_combiner(
1045         {
1046                 unsigned int n0;
1047                 unsigned int n1;
1048                 reg_t orig;
1049                 reg_t a;
1050                 reg_t b;
1051                 reg_t c;
1052                 unsigned int n;
1053                 const_str_t n_str;
1054
1055                 ;
1056
1057                 if (type_of_tos() == T_cst) {
1058                         n = pop_const(0);
1059                         orig = pop_reg();
1060                         c = reg_g0;
1061                         while (n) {
1062                                 for (n0 = 0; !(n & 1); n>>=1)
1063                                         ++n0;
1064                                 for (n1 = 0; n & 1; n>>=1)
1065                                         ++n1;
1066
1067                                 if (n0) {
1068                                         a = alloc_reg();
1069                                         sprint(n_str, "%d", n0);
1070 fprint ( codefile,
1071                                         "sll    %s, %s, %s\n",orig,n_str,a
1072 );
1073                                         free_reg(orig);
1074                                         orig = a;
1075                                 }
1076                                 if (n1 == 1) {
1077                                         if (c == reg_g0) {
1078                                                 soft_alloc_reg(orig);
1079                                                 c = orig;
1080                                         } else {
1081                                                 a = alloc_reg();
1082 fprint ( codefile,
1083                                                 "add    %s, %s, %s\n",c,orig,a
1084 );
1085                                                 free_reg(c);
1086                                                 c = a;
1087                                         }
1088                                         n <<= n1;
1089                                 } else {
1090                                         a = alloc_reg();
1091                                         sprint(n_str, "%d", n1);
1092 fprint ( codefile,
1093                                         "sll    %s, %s, %s\n",orig,n_str,a
1094 );
1095                                         b = alloc_reg();
1096 fprint ( codefile,
1097                                         "sub    %s, %s, %s\n",a,orig,b
1098 );
1099                                         free_reg(orig);
1100                                         orig = a;
1101                                         if (c == reg_g0)
1102                                                 c = b;
1103                                         else {
1104                                                 a = alloc_reg();
1105 fprint ( codefile,
1106                                                 "add    %s, %s, %s\n",c,b,a
1107 );
1108                                                 free_reg(b);
1109                                                 free_reg(c);
1110                                                 c = a;
1111                                         }
1112                                 }
1113                         }
1114                         push_reg(c);
1115                         free_reg(orig);
1116                 } else {
1117                         force_alloc_output();
1118                         pop_reg_as(reg_o0);
1119                         pop_reg_as(reg_o1);
1120 fprint ( codefile,
1121                         "call   mli4\n"
1122 );
1123 fprint ( codefile,
1124                         "nop\n"                 
1125 );
1126                         free_output();
1127                         forced_alloc_reg(reg_o0);
1128                         push_reg(reg_o0);
1129                 }
1130         })
1131 .
1132         default ==>
1133 code_combiner(
1134                         )
1135 .
1136
1137 C_mli_narg      ==>
1138 code_combiner(
1139         {
1140                 reg_t a;
1141                 int n;
1142                 
1143                 ;
1144                 if (type_of_tos() == T_cst)
1145                 {
1146                         n= pop_const(0);
1147                         C_mli (n);
1148                 }
1149                 else
1150                 {
1151                         a= pop_reg();
1152                         force_alloc_output();
1153 fprint ( codefile,
1154                         "cmp    %s, 4\n",a
1155 );
1156 fprint ( codefile,
1157                         "be     1f\n"
1158 );
1159 fprint ( codefile,
1160                         "set    EILLINS, %s\n",reg_o0
1161 );
1162 fprint ( codefile,
1163                         "call   trp\n"
1164 );
1165 fprint ( codefile,
1166                         "nop\n"
1167 );
1168 fprint ( codefile,
1169                 "1:\n"
1170 );
1171                         free_reg(a);
1172                         free_output();
1173                 C_mli (4);
1174                 }
1175         })
1176 .
1177
1178
1179
1180 C_dvi
1181         $1 == 4 ==>
1182 code_combiner(
1183         {
1184                 reg_t a;
1185                 reg_t b;
1186                 int n;
1187                 int n_exp;
1188                 const_str_t n_exp_str;
1189
1190                 ;
1191
1192                 {
1193                         force_alloc_output();
1194                         pop_reg_as(reg_o1);     
1195                         pop_reg_as(reg_o0);     
1196
1197 fprint ( codefile,
1198                         "call   dvi4\n"
1199 );
1200
1201 fprint ( codefile,
1202                         "nop\n"
1203 );
1204                         free_output();
1205                         forced_alloc_reg(reg_o0);
1206                         push_reg(reg_o0);
1207                 }
1208         })
1209 .
1210         default ==>
1211 code_combiner(
1212                         )
1213 .
1214
1215 C_dvi_narg      ==>
1216 code_combiner(
1217         {
1218                 reg_t a;
1219                 int n;
1220                 
1221                 ;
1222                 if (type_of_tos() == T_cst)
1223                 {
1224                         n= pop_const(0);
1225                         C_dvi (n);
1226                 }
1227                 else
1228                 {
1229                         a= pop_reg();
1230                         force_alloc_output();
1231 fprint ( codefile,
1232                         "cmp    %s, 4\n",a
1233 );
1234 fprint ( codefile,
1235                         "be     1f\n"
1236 );
1237 fprint ( codefile,
1238                         "set    EILLINS, %s\n",reg_o0
1239 );
1240 fprint ( codefile,
1241                         "call   trp\n"
1242 );
1243 fprint ( codefile,
1244                         "nop\n"
1245 );
1246 fprint ( codefile,
1247                 "1:\n"
1248 );
1249                         free_reg(a);
1250                         free_output();
1251                 C_dvi (4);
1252                 }
1253         })
1254 .
1255
1256
1257
1258 C_rmi
1259         $1 == 4 ==>
1260 code_combiner(
1261                         ;
1262                         {
1263                                 force_alloc_output();
1264                                 pop_reg_as(reg_o1);     
1265                                 pop_reg_as(reg_o0);     
1266
1267 fprint ( codefile,
1268                                 "call   dvi4\n"
1269 );
1270
1271 fprint ( codefile,
1272                                 "nop\n"
1273 );
1274                                 free_output();
1275                                 forced_alloc_reg(reg_o1);
1276                                 push_reg(reg_o1);
1277                         })
1278 .
1279         default ==>
1280 code_combiner(
1281                         )
1282 .
1283
1284 C_rmi_narg      ==>
1285 code_combiner(
1286         {
1287                 reg_t a;
1288                 int n;
1289                 
1290                 ;
1291                 if (type_of_tos() == T_cst)
1292                 {
1293                         n= pop_const(0);
1294                         C_rmi (n);
1295                 }
1296                 else
1297                 {
1298                         a= pop_reg();
1299                         force_alloc_output();
1300 fprint ( codefile,
1301                         "cmp    %s, 4\n",a
1302 );
1303 fprint ( codefile,
1304                         "be     1f\n"
1305 );
1306 fprint ( codefile,
1307                         "set    EILLINS, %s\n",reg_o0
1308 );
1309 fprint ( codefile,
1310                         "call   trp\n"
1311 );
1312 fprint ( codefile,
1313                         "nop\n"
1314 );
1315 fprint ( codefile,
1316                 "1:\n"
1317 );
1318                         free_reg(a);
1319                         free_output();
1320                 C_rmi (4);
1321                 }
1322         })
1323 .
1324
1325
1326
1327 C_ngi
1328         $1 == 4 ==>
1329 code_combiner(
1330                         ;
1331                         {
1332                                 reg_t a;
1333                                 reg_t b;
1334
1335                                 a = pop_reg();
1336                                 b = alloc_reg();
1337 fprint ( codefile,
1338                                 "sub    %%g0, %s, %s\n",a,b
1339 );
1340                                 push_reg(b);
1341                                 free_reg(a);
1342                         })
1343 .
1344         default ==>
1345 code_combiner(
1346                         )
1347 .
1348
1349 C_ngi_narg      ==>
1350 code_combiner(
1351         {
1352                 reg_t a;
1353                 int n;
1354                 
1355                 ;
1356                 if (type_of_tos() == T_cst)
1357                 {
1358                         n= pop_const(0);
1359                         C_ngi (n);
1360                 }
1361                 else
1362                 {
1363                         a= pop_reg();
1364                         force_alloc_output();
1365 fprint ( codefile,
1366                         "cmp    %s, 4\n",a
1367 );
1368 fprint ( codefile,
1369                         "be     1f\n"
1370 );
1371 fprint ( codefile,
1372                         "set    EILLINS, %s\n",reg_o0
1373 );
1374 fprint ( codefile,
1375                         "call   trp\n"
1376 );
1377 fprint ( codefile,
1378                         "nop\n"
1379 );
1380 fprint ( codefile,
1381                 "1:\n"
1382 );
1383                         free_reg(a);
1384                         free_output();
1385                 C_ngi (4);
1386                 }
1387         })
1388 .
1389
1390
1391
1392 C_sli
1393         $1 == 4 ==>
1394 code_combiner(
1395                         ;
1396                         {
1397                                 reg_t a;
1398                                 reg_t b;
1399                                 reg_t c;
1400
1401                                 b = alloc_reg();
1402                                 if ((type_of_tos() == T_cst) &&
1403                                         (((top_const()) > -4096 && (top_const()) < 4096))) {
1404                                         const_str_t n;
1405
1406                                         pop_const(n);
1407                                         a = pop_reg();
1408 fprint ( codefile,
1409                                         "sll    %s, %s, %s\n",a,n,b
1410 );
1411                                 } else {
1412                                         c = pop_reg();
1413                                         a = pop_reg();
1414 fprint ( codefile,
1415                                         "sll    %s, %s, %s\n",a,c,b
1416 );
1417                                         free_reg(c);
1418                                 }
1419                                 free_reg(a);
1420                                 push_reg(b);
1421                         })
1422 .
1423         default ==>
1424 code_combiner(
1425                         )
1426 .
1427
1428 C_sli_narg      ==>
1429 code_combiner(
1430         {
1431                 reg_t a;
1432                 int n;
1433                 
1434                 ;
1435                 if (type_of_tos() == T_cst)
1436                 {
1437                         n= pop_const(0);
1438                         C_sli (n);
1439                 }
1440                 else
1441                 {
1442                         a= pop_reg();
1443                         force_alloc_output();
1444 fprint ( codefile,
1445                         "cmp    %s, 4\n",a
1446 );
1447 fprint ( codefile,
1448                         "be     1f\n"
1449 );
1450 fprint ( codefile,
1451                         "set    EILLINS, %s\n",reg_o0
1452 );
1453 fprint ( codefile,
1454                         "call   trp\n"
1455 );
1456 fprint ( codefile,
1457                         "nop\n"
1458 );
1459 fprint ( codefile,
1460                 "1:\n"
1461 );
1462                         free_reg(a);
1463                         free_output();
1464                 C_sli (4);
1465                 }
1466         })
1467 .
1468
1469
1470
1471 C_sri
1472         $1 == 4         ==>
1473 code_combiner(
1474                         ;
1475                         {
1476                                 reg_t a;
1477                                 reg_t b;
1478                                 reg_t c;
1479
1480                                 b = alloc_reg();
1481                                 if ((type_of_tos() == T_cst) &&
1482                                         (((top_const()) > -4096 && (top_const()) < 4096))) {
1483                                         const_str_t n;
1484
1485                                         pop_const(n);
1486                                         a = pop_reg();
1487 fprint ( codefile,
1488                                         "sra    %s, %s, %s\n",a,n,b
1489 );
1490                                 } else {
1491                                         c = pop_reg();
1492                                         a = pop_reg();
1493 fprint ( codefile,
1494                                         "sra    %s, %s, %s\n",a,c,b
1495 );
1496                                         free_reg(c);
1497                                 }
1498                                 free_reg(a);
1499                                 push_reg(b);
1500                         })
1501 .
1502         default ==>
1503 code_combiner(
1504                         )
1505 .
1506
1507 C_sri_narg      ==>
1508 code_combiner(
1509         {
1510                 reg_t a;
1511                 int n;
1512                 
1513                 ;
1514                 if (type_of_tos() == T_cst)
1515                 {
1516                         n= pop_const(0);
1517                         C_sri (n);
1518                 }
1519                 else
1520                 {
1521                         a= pop_reg();
1522                         force_alloc_output();
1523 fprint ( codefile,
1524                         "cmp    %s, 4\n",a
1525 );
1526 fprint ( codefile,
1527                         "be     1f\n"
1528 );
1529 fprint ( codefile,
1530                         "set    EILLINS, %s\n",reg_o0
1531 );
1532 fprint ( codefile,
1533                         "call   trp\n"
1534 );
1535 fprint ( codefile,
1536                         "nop\n"
1537 );
1538 fprint ( codefile,
1539                 "1:\n"
1540 );
1541                         free_reg(a);
1542                         free_output();
1543                 C_sri (4);
1544                 }
1545         })
1546 .
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556 C_adu           ==>
1557 code_combiner(
1558                         ;
1559                         C_adi( w))
1560 .
1561
1562 C_adu_narg      ==>
1563 code_combiner(
1564         {
1565                 reg_t a;
1566                 int n;
1567                 
1568                 ;
1569                 if (type_of_tos() == T_cst)
1570                 {
1571                         n= pop_const(0);
1572                         C_adu (n);
1573                 }
1574                 else
1575                 {
1576                         a= pop_reg();
1577                         force_alloc_output();
1578 fprint ( codefile,
1579                         "cmp    %s, 4\n",a
1580 );
1581 fprint ( codefile,
1582                         "be     1f\n"
1583 );
1584 fprint ( codefile,
1585                         "set    EILLINS, %s\n",reg_o0
1586 );
1587 fprint ( codefile,
1588                         "call   trp\n"
1589 );
1590 fprint ( codefile,
1591                         "nop\n"
1592 );
1593 fprint ( codefile,
1594                 "1:\n"
1595 );
1596                         free_reg(a);
1597                         free_output();
1598                 C_adu (4);
1599                 }
1600         })
1601 .
1602
1603
1604
1605 C_sbu           ==>
1606 code_combiner(
1607                         ;
1608                         C_sbi( w))
1609 .
1610
1611 C_sbu_narg      ==>
1612 code_combiner(
1613         {
1614                 reg_t a;
1615                 int n;
1616                 
1617                 ;
1618                 if (type_of_tos() == T_cst)
1619                 {
1620                         n= pop_const(0);
1621                         C_sbu (n);
1622                 }
1623                 else
1624                 {
1625                         a= pop_reg();
1626                         force_alloc_output();
1627 fprint ( codefile,
1628                         "cmp    %s, 4\n",a
1629 );
1630 fprint ( codefile,
1631                         "be     1f\n"
1632 );
1633 fprint ( codefile,
1634                         "set    EILLINS, %s\n",reg_o0
1635 );
1636 fprint ( codefile,
1637                         "call   trp\n"
1638 );
1639 fprint ( codefile,
1640                         "nop\n"
1641 );
1642 fprint ( codefile,
1643                 "1:\n"
1644 );
1645                         free_reg(a);
1646                         free_output();
1647                 C_sbu (4);
1648                 }
1649         })
1650 .
1651
1652
1653
1654 C_mlu
1655         $1 == 4 ==>
1656 code_combiner(
1657                 ;
1658                 C_mli($1))
1659 .
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672         default ==>
1673 code_combiner(
1674                         )
1675 .
1676
1677 C_mlu_narg      ==>
1678 code_combiner(
1679         {
1680                 reg_t a;
1681                 int n;
1682                 
1683                 ;
1684                 if (type_of_tos() == T_cst)
1685                 {
1686                         n= pop_const(0);
1687                         C_mlu (n);
1688                 }
1689                 else
1690                 {
1691                         a= pop_reg();
1692                         force_alloc_output();
1693 fprint ( codefile,
1694                         "cmp    %s, 4\n",a
1695 );
1696 fprint ( codefile,
1697                         "be     1f\n"
1698 );
1699 fprint ( codefile,
1700                         "set    EILLINS, %s\n",reg_o0
1701 );
1702 fprint ( codefile,
1703                         "call   trp\n"
1704 );
1705 fprint ( codefile,
1706                         "nop\n"
1707 );
1708 fprint ( codefile,
1709                 "1:\n"
1710 );
1711                         free_reg(a);
1712                         free_output();
1713                 C_mlu (4);
1714                 }
1715         })
1716 .
1717
1718
1719
1720 C_dvu
1721         $1 == 4 ==>
1722 code_combiner(
1723         {
1724                 reg_t a;
1725                 reg_t b;
1726                 unsigned n;
1727                 int n_exp;
1728                 const_str_t n_exp_str;
1729
1730                 ;
1731                 if (type_of_tos() == T_cst &&
1732                         uns_power_of_2(top_const(), &n_exp))
1733                 {
1734                         sprint (n_exp_str, "%d", n_exp);
1735                         n= pop_const(0);
1736                         a= pop_reg();
1737                         b= alloc_reg();
1738 fprint ( codefile,
1739                         "srl    %s, %s, %s\n",a,n_exp_str,b
1740 );
1741                         free_reg(a);
1742                         push_reg(b);
1743                 }
1744                 else
1745                 {
1746                         force_alloc_output();
1747                         pop_reg_as(reg_o1);     
1748                         pop_reg_as(reg_o0);     
1749 fprint ( codefile,
1750                         "call   dvu4\n"
1751 );
1752 fprint ( codefile,
1753                         "nop\n"
1754 );
1755                         free_output();
1756                         forced_alloc_reg(reg_o0);
1757                         push_reg(reg_o0);
1758                 }
1759         })
1760 .
1761         default ==>
1762 code_combiner(
1763                         )
1764 .
1765
1766 C_dvu_narg      ==>
1767 code_combiner(
1768         {
1769                 reg_t a;
1770                 int n;
1771                 
1772                 ;
1773                 if (type_of_tos() == T_cst)
1774                 {
1775                         n= pop_const(0);
1776                         C_dvu (n);
1777                 }
1778                 else
1779                 {
1780                         a= pop_reg();
1781                         force_alloc_output();
1782 fprint ( codefile,
1783                         "cmp    %s, 4\n",a
1784 );
1785 fprint ( codefile,
1786                         "be     1f\n"
1787 );
1788 fprint ( codefile,
1789                         "set    EILLINS, %s\n",reg_o0
1790 );
1791 fprint ( codefile,
1792                         "call   trp\n"
1793 );
1794 fprint ( codefile,
1795                         "nop\n"
1796 );
1797 fprint ( codefile,
1798                 "1:\n"
1799 );
1800                         free_reg(a);
1801                         free_output();
1802                 C_dvu (4);
1803                 }
1804         })
1805 .
1806
1807
1808
1809 C_rmu
1810         $1 == 4 ==>
1811 code_combiner(
1812                 ;
1813                 {
1814                         force_alloc_output();
1815                         pop_reg_as(reg_o1);
1816                         pop_reg_as(reg_o0);
1817 fprint ( codefile,
1818                         "call   dvu4\n"
1819 );
1820 fprint ( codefile,
1821                         "nop\n"
1822 );
1823                         free_output();
1824                         forced_alloc_reg(reg_o1);
1825                         push_reg(reg_o1);
1826                 })
1827 .
1828         default ==>
1829 code_combiner(
1830                         )
1831 .
1832
1833 C_rmu_narg      ==>
1834 code_combiner(
1835         {
1836                 reg_t a;
1837                 int n;
1838                 
1839                 ;
1840                 if (type_of_tos() == T_cst)
1841                 {
1842                         n= pop_const(0);
1843                         C_rmu (n);
1844                 }
1845                 else
1846                 {
1847                         a= pop_reg();
1848                         force_alloc_output();
1849 fprint ( codefile,
1850                         "cmp    %s, 4\n",a
1851 );
1852 fprint ( codefile,
1853                         "be     1f\n"
1854 );
1855 fprint ( codefile,
1856                         "set    EILLINS, %s\n",reg_o0
1857 );
1858 fprint ( codefile,
1859                         "call   trp\n"
1860 );
1861 fprint ( codefile,
1862                         "nop\n"
1863 );
1864 fprint ( codefile,
1865                 "1:\n"
1866 );
1867                         free_reg(a);
1868                         free_output();
1869                 C_rmu (4);
1870                 }
1871         })
1872 .
1873
1874
1875
1876 C_slu           ==>
1877 code_combiner(
1878                         ;
1879                         C_sli($1))
1880 .
1881
1882 C_slu_narg      ==>
1883 code_combiner(
1884         {
1885                 reg_t a;
1886                 int n;
1887                 
1888                 ;
1889                 if (type_of_tos() == T_cst)
1890                 {
1891                         n= pop_const(0);
1892                         C_slu (n);
1893                 }
1894                 else
1895                 {
1896                         a= pop_reg();
1897                         force_alloc_output();
1898 fprint ( codefile,
1899                         "cmp    %s, 4\n",a
1900 );
1901 fprint ( codefile,
1902                         "be     1f\n"
1903 );
1904 fprint ( codefile,
1905                         "set    EILLINS, %s\n",reg_o0
1906 );
1907 fprint ( codefile,
1908                         "call   trp\n"
1909 );
1910 fprint ( codefile,
1911                         "nop\n"
1912 );
1913 fprint ( codefile,
1914                 "1:\n"
1915 );
1916                         free_reg(a);
1917                         free_output();
1918                 C_slu (4);
1919                 }
1920         })
1921 .
1922
1923
1924
1925 C_sru
1926         $1 == 4 ==>
1927 code_combiner(
1928                         {
1929                                 reg_t a;
1930                                 reg_t b;
1931                                 reg_t c;
1932
1933                                 ;
1934                                 b = alloc_reg();
1935                                 if ((type_of_tos() == T_cst) &&
1936                                         (((top_const()) > -4096 && (top_const()) < 4096))) {
1937                                         const_str_t n;
1938
1939                                         pop_const(n);
1940                                         a = pop_reg();
1941 fprint ( codefile,
1942                                         "srl    %s, %s, %s\n",a,n,b
1943 );
1944                                 } else {
1945                                         c = pop_reg();
1946                                         a = pop_reg();
1947 fprint ( codefile,
1948                                         "srl    %s, %s, %s\n",a,c,b
1949 );
1950                                         free_reg(c);
1951                                 }
1952                                 free_reg(a);
1953                                 push_reg(b);
1954                         })
1955 .
1956         default ==>
1957 code_combiner(
1958                         )
1959 .
1960
1961 C_sru_narg      ==>
1962 code_combiner(
1963         {
1964                 reg_t a;
1965                 int n;
1966                 
1967                 ;
1968                 if (type_of_tos() == T_cst)
1969                 {
1970                         n= pop_const(0);
1971                         C_sru (n);
1972                 }
1973                 else
1974                 {
1975                         a= pop_reg();
1976                         force_alloc_output();
1977 fprint ( codefile,
1978                         "cmp    %s, 4\n",a
1979 );
1980 fprint ( codefile,
1981                         "be     1f\n"
1982 );
1983 fprint ( codefile,
1984                         "set    EILLINS, %s\n",reg_o0
1985 );
1986 fprint ( codefile,
1987                         "call   trp\n"
1988 );
1989 fprint ( codefile,
1990                         "nop\n"
1991 );
1992 fprint ( codefile,
1993                 "1:\n"
1994 );
1995                         free_reg(a);
1996                         free_output();
1997                 C_sru (4);
1998                 }
1999         })
2000 .
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010 C_adf           ==>
2011 code_combiner(
2012         {
2013                 ;
2014                 push_const($1);
2015                 C_adf_narg();
2016         })
2017 .
2018
2019 C_adf_narg      ==>
2020 code_combiner(
2021         {       
2022                 reg_t f1;
2023                 reg_t f2;
2024                 reg_t f3;
2025                 int n;
2026
2027                 ;
2028                 if (type_of_tos() == T_cst)
2029                 {
2030                         n= pop_const(0);
2031                         if (n == 4)
2032                         {
2033                                 f1= pop_float();
2034                                 f2= pop_float();
2035                                 f3= alloc_float();
2036 fprint ( codefile,
2037                                 "fadds  %s, %s, %s\n",f2,f1,f3
2038 );
2039                                 free_reg(f1);
2040                                 free_reg(f2);
2041                                 push_reg(f3);
2042                         }
2043                         else if (n == 8)
2044                         {
2045                                 f1= pop_double(0);
2046                                 f2= pop_double(0);
2047                                 f3= alloc_double(0);
2048 fprint ( codefile,
2049                                 "faddd  %s, %s, %s\n",f1,f2,f3
2050 );
2051                                 free_double_reg(f1);
2052                                 free_double_reg(f2);
2053                                 push_double_reg(f3);
2054                         }
2055                         else
2056                                 ;
2057                 }
2058                 else
2059                         not_implemented ("adf_narg");
2060         })
2061 .
2062
2063 C_sbf           ==>
2064 code_combiner(
2065         {
2066                 ;
2067                 push_const($1);
2068                 C_sbf_narg();
2069         })
2070 .
2071
2072 C_sbf_narg      ==>
2073 code_combiner(
2074         {       
2075                 reg_t f1;
2076                 reg_t f2;
2077                 reg_t f3;
2078                 int n;
2079
2080                 ;
2081                 if (type_of_tos() == T_cst)
2082                 {
2083                         n= pop_const(0);
2084                         if (n == 4)
2085                         {
2086                                 f1= pop_float();
2087                                 f2= pop_float();
2088                                 f3= alloc_float();
2089 fprint ( codefile,
2090                                 "fsubs  %s, %s, %s\n",f2,f1,f3
2091 );
2092                                 free_reg(f1);
2093                                 free_reg(f2);
2094                                 push_reg(f3);
2095                         }
2096                         else if (n == 8)
2097                         {
2098                                 f1= pop_double(0);
2099                                 f2= pop_double(0);
2100                                 f3= alloc_double(0);
2101 fprint ( codefile,
2102                                 "fsubd  %s, %s, %s\n",f2,f1,f3
2103 );
2104                                 free_double_reg(f1);
2105                                 free_double_reg(f2);
2106                                 push_double_reg(f3);
2107                         }
2108                         else
2109                                 ;
2110                 }
2111                 else
2112                         not_implemented ("sbf_narg");
2113         })
2114 .
2115
2116 C_mlf           ==>
2117 code_combiner(
2118         {
2119                 ;
2120                 push_const($1);
2121                 C_mlf_narg();
2122         })
2123 .
2124
2125 C_mlf_narg      ==>
2126 code_combiner(
2127         {       
2128                 reg_t f1;
2129                 reg_t f2;
2130                 reg_t f3;
2131                 int n;
2132
2133                 ;
2134                 if (type_of_tos() == T_cst)
2135                 {
2136                         n= pop_const(0);
2137                         if (n == 4)
2138                         {
2139                                 f1= pop_float();
2140                                 f2= pop_float();
2141                                 f3= alloc_float();
2142 fprint ( codefile,
2143                                 "fmuls  %s, %s, %s\n",f2,f1,f3
2144 );
2145                                 free_reg(f1);
2146                                 free_reg(f2);
2147                                 push_reg(f3);
2148                         }
2149                         else if (n == 8)
2150                         {
2151                                 f1= pop_double(0);
2152                                 f2= pop_double(0);
2153                                 f3= alloc_double(0);
2154 fprint ( codefile,
2155                                 "fmuld  %s, %s, %s\n",f2,f1,f3
2156 );
2157                                 free_double_reg(f1);
2158                                 free_double_reg(f2);
2159                                 push_double_reg(f3);
2160                         }
2161                         else
2162                                 ;
2163                 }
2164                 else
2165                         not_implemented ("mlf_narg");
2166         })
2167 .
2168
2169 C_dvf           ==>
2170 code_combiner(
2171         {
2172                 ;
2173                 push_const($1);
2174                 C_dvf_narg();
2175         })
2176 .
2177
2178 C_dvf_narg      ==>
2179 code_combiner(
2180         {       
2181                 reg_t f1;
2182                 reg_t f2;
2183                 reg_t f3;
2184                 int n;
2185
2186                 ;
2187                 if (type_of_tos() == T_cst)
2188                 {
2189                         n= pop_const(0);
2190                         if (n == 4)
2191                         {
2192                                 f1= pop_float();
2193                                 f2= pop_float();
2194                                 f3= alloc_float();
2195 fprint ( codefile,
2196                                 "fdivs  %s, %s, %s\n",f2,f1,f3
2197 );
2198                                 free_reg(f1);
2199                                 free_reg(f2);
2200                                 push_reg(f3);
2201                         }
2202                         else if (n == 8)
2203                         {
2204                                 f1= pop_double(0);
2205                                 f2= pop_double(0);
2206                                 f3= alloc_double(0);
2207 fprint ( codefile,
2208                                 "fdivd  %s, %s, %s\n",f2,f1,f3
2209 );
2210                                 free_double_reg(f1);
2211                                 free_double_reg(f2);
2212                                 push_double_reg(f3);
2213                         }
2214                         else
2215                                 ;
2216                 }
2217                 else
2218                         not_implemented ("dvf_narg");
2219         })
2220 .
2221
2222 C_ngf           ==>
2223 code_combiner(
2224         {
2225                 ;
2226                 push_const($1);
2227                 C_ngf_narg();
2228         })
2229 .
2230
2231 C_ngf_narg      ==>
2232 code_combiner(
2233         {       
2234                 reg_t f1;
2235                 reg_t f2;
2236                 int n;
2237
2238                 ;
2239                 if (type_of_tos() == T_cst)
2240                 {
2241                         n= pop_const(0);
2242                         if (n == 4 || n == 8)
2243                         {
2244                                 f1= pop_float();
2245                                 f2= alloc_float();
2246 fprint ( codefile,
2247                                 "fnegs  %s, %s\n",f1,f2
2248 );
2249                                 free_reg(f1);
2250                                 push_reg(f2);
2251                         }
2252                         else
2253                                 ;
2254                 }
2255                 else
2256                         not_implemented ("ngf_narg");
2257         })
2258 .
2259
2260 C_fif           ==>
2261 code_combiner(
2262         ;
2263         push_const($1);
2264         C_fif_narg())
2265 .
2266
2267 C_fif_narg      ==>
2268 code_combiner(
2269         {
2270                 int n;
2271                 reg_t a;
2272                 reg_t b;
2273                 reg_t c;
2274                 reg_t d;
2275
2276                 ;
2277                 if (type_of_tos() == T_cst)
2278                 {
2279                         n= pop_const(0);
2280
2281                         if (n==4)
2282                         {
2283 fprint ( codefile,
2284                                 "! unimplemented fif 4\n"
2285 );
2286 fprint ( codefile,
2287                                 "st     %%g0, [%%g0]\n" 
2288 );
2289                         }
2290                         else if (n==8)
2291                         {
2292                                 flush_cache();
2293 fprint ( codefile,
2294                                 "call   fif8\n"
2295 );
2296 fprint ( codefile,
2297                                 "nop\n"
2298 );
2299                         }
2300                         else
2301                                 ;
2302                 }
2303                 else
2304                 {
2305                         a= alloc_reg();
2306                         flush_cache();
2307                         force_alloc_output();
2308                         b= alloc_reg();
2309                         c= alloc_reg();
2310                         d= pop_reg();
2311 fprint ( codefile,
2312                         "cmp    8, %s\n",d
2313 );
2314 fprint ( codefile,
2315                         "be     8f\n"
2316 );
2317 fprint ( codefile,
2318                         "nop\n"
2319 );
2320 fprint ( codefile,
2321                         "cmp    4, %s\n",d
2322 );
2323 fprint ( codefile,
2324                         "bne    0f\n"
2325 );
2326 fprint ( codefile,
2327                         "nop\n"
2328 );
2329 fprint ( codefile,
2330                 "4:\n"
2331 );
2332 fprint ( codefile,
2333                         "! unimplemented fif 4\n"
2334 );
2335 fprint ( codefile,
2336                         "st     %%g0, [%%g0]\n"
2337 );
2338 fprint ( codefile,
2339                         "b      1f\n"
2340 );
2341 fprint ( codefile,
2342                 "0:\n"
2343 );
2344 fprint ( codefile,
2345                         "set    EILLINS, %s\n",reg_o0
2346 );
2347 fprint ( codefile,
2348                         "call   trp\n"
2349 );
2350 fprint ( codefile,
2351                         "nop\n"
2352 );
2353 fprint ( codefile,
2354                         "b      1f\n"
2355 );
2356 fprint ( codefile,
2357                 "8:\n"
2358 );
2359 fprint ( codefile,
2360                         "call   fif8\n"
2361 );
2362 fprint ( codefile,
2363                         "nop\n"
2364 );
2365 fprint ( codefile,
2366                 "1:\n"
2367 );
2368                         free_reg(a);
2369                         free_reg(b);
2370                         free_reg(c);
2371                         free_reg(d);
2372                         free_output();
2373                 }
2374         })
2375 .
2376
2377
2378 C_fef           ==>
2379 code_combiner(
2380         ;
2381         push_const($1);
2382         C_fef_narg())
2383 .
2384
2385 C_fef_narg      ==>
2386 code_combiner(
2387         {
2388                 int n;
2389                 reg_t a;
2390                 reg_t b;
2391                 reg_t c;
2392                 reg_t d;
2393                 reg_t e;
2394
2395                 ;
2396                 if (type_of_tos() == T_cst)
2397                 {
2398                         n= pop_const(0);
2399
2400                         if (n==4)
2401                         {
2402 fprint ( codefile,
2403                                 "! unimplemented fef 4\n"
2404 );
2405 fprint ( codefile,
2406                                 "st     %%g0, [%%g0]\n" 
2407 );
2408                         }
2409                         else if (n==8)
2410                         {
2411                                 flush_cache();
2412 fprint ( codefile,
2413                                 "call   fef8\n"
2414 );
2415 fprint ( codefile,
2416                                 "nop\n"
2417 );
2418                         }
2419                         else
2420                                 ;
2421                 }
2422                 else
2423                 {
2424                         a= alloc_reg();
2425                         flush_cache();
2426                         force_alloc_output();
2427                         b= alloc_reg();
2428                         c= alloc_reg();
2429                         d= pop_reg();
2430 fprint ( codefile,
2431                         "cmp    8, %s\n",d
2432 );
2433 fprint ( codefile,
2434                         "be     8f\n"
2435 );
2436 fprint ( codefile,
2437                         "nop\n"
2438 );
2439 fprint ( codefile,
2440                         "cmp    4, %s\n",d
2441 );
2442 fprint ( codefile,
2443                         "bne    0f\n"
2444 );
2445 fprint ( codefile,
2446                         "nop\n"
2447 );
2448 fprint ( codefile,
2449                 "4:\n"
2450 );
2451 fprint ( codefile,
2452                         "! unimplemented fef 4\n"
2453 );
2454 fprint ( codefile,
2455                         "st     %%g0, [%%g0]\n"
2456 );
2457 fprint ( codefile,
2458                         "b      1f\n"
2459 );
2460 fprint ( codefile,
2461                 "0:\n"
2462 );
2463 fprint ( codefile,
2464                         "set    EILLINS, %s\n",reg_o0
2465 );
2466 fprint ( codefile,
2467                         "call   trp\n"
2468 );
2469 fprint ( codefile,
2470                         "nop\n"
2471 );
2472 fprint ( codefile,
2473                         "b      1f\n"
2474 );
2475 fprint ( codefile,
2476                 "8:\n"
2477 );
2478 fprint ( codefile,
2479                         "call   fef8\n"
2480 );
2481 fprint ( codefile,
2482                         "nop\n"
2483 );
2484 fprint ( codefile,
2485                 "1:\n"
2486 );
2487                         free_reg(a);
2488                         free_reg(b);
2489                         free_reg(c);
2490                         free_reg(d);
2491                         free_output();
2492                 }
2493         })
2494 .
2495
2496
2497
2498
2499
2500
2501
2502 C_adp           ==>
2503 code_combiner(
2504                         ;
2505                         inc_tos($1))
2506 .
2507
2508 C_ads
2509         $1 == 4 ==>
2510 code_combiner(
2511                         ;
2512                         if ((type_of_tos()) == T_cst) {
2513                                 arith n;
2514
2515                                 n = pop_const(0);
2516                                 inc_tos(n);
2517                         } else {
2518                                 reg_t a;
2519                                 reg_t b;
2520                                 reg_t c;
2521
2522                                 a = pop_reg();
2523                                 inc_tos_reg(a);
2524                         })
2525 .
2526         default         ==>
2527 code_combiner(
2528                                 )
2529 .
2530
2531 C_ads_narg      ==>
2532 code_combiner(
2533         {
2534                 reg_t a;
2535                 int n;
2536                 
2537                 ;
2538                 if (type_of_tos() == T_cst)
2539                 {
2540                         n= pop_const(0);
2541                         C_ads (n);
2542                 }
2543                 else
2544                 {
2545                         a= pop_reg();
2546                         force_alloc_output();
2547 fprint ( codefile,
2548                         "cmp    %s, 4\n",a
2549 );
2550 fprint ( codefile,
2551                         "be     1f\n"
2552 );
2553 fprint ( codefile,
2554                         "set    EILLINS, %s\n",reg_o0
2555 );
2556 fprint ( codefile,
2557                         "call   trp\n"
2558 );
2559 fprint ( codefile,
2560                         "nop\n"
2561 );
2562 fprint ( codefile,
2563                 "1:\n"
2564 );
2565                         free_reg(a);
2566                         free_output();
2567                 C_ads (4);
2568                 }
2569         })
2570 .
2571
2572
2573
2574 C_sbs
2575         $1 == 4 ==>
2576 code_combiner(
2577                         ;
2578
2579                         if ((type_of_tos()) == T_cst) {
2580                                 arith n;
2581
2582                                 n = pop_const(0);
2583                                 inc_tos(-n);
2584                         } else {
2585                                 reg_t a;
2586                                 reg_t b;
2587                                 reg_t c;
2588
2589                                 a = pop_reg();
2590                                 b = pop_reg();
2591                                 c = alloc_reg();
2592 fprint ( codefile,
2593                                 "sub    %s, %s, %s\n",b,a,c
2594 );
2595                                 free_reg(a);
2596                                 free_reg(b);
2597                                 push_reg(c);
2598                         })
2599 .
2600         default ==>
2601 code_combiner(
2602                         )
2603 .
2604
2605 C_sbs_narg      ==>
2606 code_combiner(
2607         {
2608                 reg_t a;
2609                 int n;
2610                 
2611                 ;
2612                 if (type_of_tos() == T_cst)
2613                 {
2614                         n= pop_const(0);
2615                         C_sbs (n);
2616                 }
2617                 else
2618                 {
2619                         a= pop_reg();
2620                         force_alloc_output();
2621 fprint ( codefile,
2622                         "cmp    %s, 4\n",a
2623 );
2624 fprint ( codefile,
2625                         "be     1f\n"
2626 );
2627 fprint ( codefile,
2628                         "set    EILLINS, %s\n",reg_o0
2629 );
2630 fprint ( codefile,
2631                         "call   trp\n"
2632 );
2633 fprint ( codefile,
2634                         "nop\n"
2635 );
2636 fprint ( codefile,
2637                 "1:\n"
2638 );
2639                         free_reg(a);
2640                         free_output();
2641                 C_sbs (4);
2642                 }
2643         })
2644 .
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654 C_inc           ==>
2655 code_combiner(
2656                         ;
2657                         inc_tos(1))
2658 .
2659
2660 C_inl           ==>
2661 code_combiner(
2662                 ;
2663                 {
2664                         reg_t S1;
2665
2666                         if (S1 = find_local($1, 0)) {
2667                                 change_reg(S1);
2668 fprint ( codefile,
2669                                 "inc    1, %s\n",S1
2670 );
2671                         } else {
2672                                 soft_alloc_reg(reg_lb);
2673                                 push_reg(reg_lb);
2674                                 inc_tos($1);
2675                                 C_loi(4);
2676                                 C_inc();
2677                                 soft_alloc_reg(reg_lb);
2678                                 push_reg(reg_lb);
2679                                 inc_tos($1);
2680                                 C_sti(4);
2681                         }
2682                 })
2683 .
2684
2685 C_ine..         ==>
2686 code_combiner(
2687                 { 
2688                         char *ename;
2689                         const_str_t evalue;
2690                         reg_t a;
2691                         reg_t b;
2692
2693                         ;
2694                         a= alloc_reg();
2695                         b= alloc_reg();
2696
2697                         ename= $1;
2698                         sprint(evalue, "%d", $2);
2699 fprint ( codefile,
2700                         "sethi  %%hi(%s+%s), %s\n",ename,evalue,a
2701 );
2702 fprint ( codefile,
2703                         "ld     [%s+%%lo(%s+%s)], %s\n",a,ename,evalue,b
2704 );
2705 fprint ( codefile,
2706                         "inc    %s\n",b
2707 );
2708 fprint ( codefile,
2709                         "st     %s, [%s+%%lo(%s+%s)]\n",b,a,ename,evalue
2710 );
2711                         free_reg(a);
2712                         free_reg(b);
2713                 })
2714 .
2715
2716
2717 C_dec           ==>
2718 code_combiner(
2719                         ;
2720                         inc_tos(-1))
2721 .
2722
2723 C_del           ==>
2724 code_combiner(
2725                 ;
2726                 {
2727                         reg_t S1;
2728
2729                         if (S1 = find_local($1, 0)) {
2730                                 change_reg(S1);
2731 fprint ( codefile,
2732                                 "dec    1, %s\n",S1
2733 );
2734                         } else {
2735                                 soft_alloc_reg(reg_lb);
2736                                 push_reg(reg_lb);
2737                                 inc_tos($1);
2738                                 C_loi(4);
2739                                 C_dec();
2740                                 soft_alloc_reg(reg_lb);
2741                                 push_reg(reg_lb);
2742                                 inc_tos($1);
2743                                 C_sti(4);
2744                         }
2745                 })
2746 .
2747
2748 C_dee..         ==>
2749 code_combiner(
2750                 { 
2751                         char *ename;
2752                         const_str_t evalue;
2753                         reg_t a;
2754                         reg_t b;
2755
2756                         ;
2757                         a= alloc_reg();
2758                         b= alloc_reg();
2759
2760                         ename= $1;
2761                         sprint(evalue, "%d", $2);
2762 fprint ( codefile,
2763                         "sethi  %%hi(%s+%s), %s\n",ename,evalue,a
2764 );
2765 fprint ( codefile,
2766                         "ld     [%s+%%lo(%s+%s)], %s\n",a,ename,evalue,b
2767 );
2768 fprint ( codefile,
2769                         "dec    %s\n",b
2770 );
2771 fprint ( codefile,
2772                         "st     %s, [%s+%%lo(%s+%s)]\n",b,a,ename,evalue
2773 );
2774                         free_reg(a);
2775                         free_reg(b);
2776                 })
2777 .
2778
2779 C_zrl           ==>
2780 code_combiner(
2781                 ;
2782                 {
2783                         reg_t S1;
2784
2785                         if (S1 = find_local($1, 0)) {
2786                                 change_reg(S1);
2787 fprint ( codefile,
2788                                 "mov    0, %s\n",S1
2789 );
2790                         } else {
2791                                 push_const(0);
2792                                 soft_alloc_reg(reg_lb);
2793                                 push_reg(reg_lb);
2794                                 inc_tos($1);
2795                                 C_sti(4);
2796                         }
2797                 })
2798 .
2799
2800 C_zre..         ==>
2801 code_combiner(
2802                 { 
2803                         char *ename;
2804                         const_str_t evalue;
2805                         reg_t a;
2806
2807                         ;
2808                         a= alloc_reg();
2809
2810                         ename= $1;
2811                         sprint(evalue, "%d", $2);
2812 fprint ( codefile,
2813                         "sethi  %%hi(%s+%s), %s\n",ename,evalue,a
2814 );
2815 fprint ( codefile,
2816                         "st     %%g0, [%s+%%lo(%s+%s)]\n",a,ename,evalue
2817 );
2818                         free_reg(a);
2819                 })
2820 .
2821
2822 C_zrf           ==>
2823 code_combiner(
2824                         ;
2825                         push_const($1);
2826                         C_zrf_narg())
2827 .
2828
2829 C_zrf_narg      ==>
2830 code_combiner(
2831                         ;
2832                         C_zer_narg())
2833 .
2834
2835
2836 C_zer           ==>
2837 code_combiner(
2838                         ;
2839                         push_const($1);
2840                         C_zer_narg())
2841 .
2842
2843 C_zer_narg      ==>
2844 code_combiner(
2845         {
2846                 reg_t a;
2847                 int n;
2848                 const_str_t n_str;
2849
2850                 ;
2851
2852                 if (type_of_tos() == T_cst && top_const() <= 8)
2853                 {
2854                         n= pop_const(n_str);
2855                         if (n == 4)
2856                                 push_const(0);
2857                         else if (n == 8)
2858                         {
2859                                 push_const(0);
2860                                 push_const(0);
2861                         }
2862                         else
2863                                 ;
2864                 }
2865                 else
2866                 {
2867                         a= alloc_reg();
2868                         pop_reg_as(a);
2869                         flush_cache();
2870 fprint ( codefile,
2871                         "sub    %s, %s, %s\n",reg_sp,a,reg_sp
2872 );
2873 fprint ( codefile,
2874                 "1:\n"
2875 );
2876 fprint ( codefile,
2877                         "deccc  4, %s\n"                ,a
2878 );
2879 fprint ( codefile,
2880                         "st     %%g0, [%s+%s]\n",reg_sp,a
2881 );
2882 fprint ( codefile,
2883                         "bne    1b\n"
2884 );
2885 fprint ( codefile,
2886                         "nop\n"
2887 );
2888                         free_reg(a);
2889                 }
2890         })
2891 .
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901 C_cii           ==>
2902 code_combiner(
2903         {
2904                 reg_t a;        
2905                 reg_t b;        
2906                 int n1;         
2907                 int n2;         
2908                 const_str_t n1_str;
2909
2910                 ;
2911                 a= 0;
2912                 b= 0;
2913
2914                 if (type_of_tos() != T_cst)
2915                 {
2916                         a= alloc_reg();
2917                         pop_reg_as(a);
2918                         b= pop_reg();
2919                 }
2920                 else
2921                 {
2922                         n1= pop_const(n1_str);
2923                         if (type_of_tos() != T_cst)
2924                         {
2925                                 a= alloc_reg();
2926 fprint ( codefile,
2927                                 "set    %s, %s\n",n1_str,a
2928 );
2929                                 b= pop_reg();
2930                         }
2931                         else
2932                                 n2= pop_const(0);
2933                 }
2934
2935                 if (!a)
2936                 {
2937                         a = pop_reg();
2938                         if (n1 > 4)
2939                                 ;
2940                         if (n2 > 4)
2941                                 ;
2942                         if (n2 < 4) {
2943                                 b = alloc_reg();
2944                                 if (n2 == 1)
2945                                 {
2946 fprint ( codefile,
2947                                         "sll    %s, 24, %s\n",a,b
2948 );
2949 fprint ( codefile,
2950                                         "sra    %s, 24, %s\n",b,b
2951 );
2952                                 }
2953                                 else if (n2 == 2)
2954                                 {
2955 fprint ( codefile,
2956                                         "sll    %s, 16, %s\n",a,b
2957 );
2958 fprint ( codefile,
2959                                         "sra    %s, 16, %s\n",b,b
2960 );
2961                                 }
2962                                 free_reg(a);
2963                                 push_reg(b);
2964                         }
2965                         else
2966                                 push_reg(a);
2967                 } else {
2968                         flush_cache();
2969 fprint ( codefile,
2970                         "cmp    %s, %s\n",a,b
2971 );
2972 fprint ( codefile,
2973                         "ble    4f\n"
2974 );
2975 fprint ( codefile,
2976                         "nop\n"                 
2977 );
2978 fprint ( codefile,
2979                         "cmp    %s, 1\n",b
2980 );
2981 fprint ( codefile,
2982                         "bne    2f\n"
2983 );
2984 fprint ( codefile,
2985                         "nop\n"                 
2986 );
2987 fprint ( codefile,
2988                 "1:\n"
2989 );
2990 fprint ( codefile,
2991                         "b      3f\n"
2992 );
2993 fprint ( codefile,
2994                         "ldsb   [%s+3], %s\n"   ,reg_sp,a
2995 );
2996 fprint ( codefile,
2997                 "2:\n"
2998 );
2999 fprint ( codefile,
3000                         "ldsh   [%s+2], %s\n",reg_sp,a
3001 );
3002 fprint ( codefile,
3003                 "3:\n"
3004 );
3005 fprint ( codefile,
3006                         "st     %s, [%s]\n",a,reg_sp
3007 );
3008 fprint ( codefile,
3009                 "4:\n"
3010 );
3011                         free_reg(a);
3012                         free_reg(b);
3013                 }
3014         })
3015 .
3016
3017
3018 C_cuu           ==>
3019 code_combiner(
3020                         ;
3021                         pop_nop(2))
3022 .
3023
3024 C_ciu           ==>
3025 code_combiner(
3026                         ;
3027                         pop_nop(2))
3028 .
3029
3030 C_cui           ==>
3031 code_combiner(
3032                         ;
3033                         pop_nop(2))
3034 .
3035
3036 C_cfi           ==>
3037 code_combiner(
3038         {
3039                 reg_t a;        
3040                 reg_t b;        
3041                 reg_t s1;
3042                 reg_t s2;
3043                 reg_t d1;
3044                 reg_t d2;
3045                 int n1;         
3046                 int n2;         
3047                 const_str_t n1_str;
3048
3049                 ;
3050                 a= 0;
3051                 b= 0;
3052                 if (type_of_tos() != T_cst)
3053                 {
3054                         a= pop_reg();
3055                         b= pop_reg();
3056                 }
3057                 else
3058                 {
3059                         n1= pop_const (n1_str);
3060                         if (type_of_tos() != T_cst)
3061                         {
3062                                 a= alloc_reg();
3063 fprint ( codefile,
3064                                 "set    %s, %s\n",n1_str,a
3065 );
3066                                 b= pop_reg();
3067                         }
3068                         else
3069                                 n2= pop_const(0);
3070                 }
3071
3072                 if (!a)
3073                 {
3074                         if (n1 != 4)
3075                                 ;
3076                         if (n2 == 4)
3077                         {
3078                                 s1= pop_float();
3079                                 d1= alloc_float();
3080 fprint ( codefile,
3081                                 "fstoi  %s, %s\n",s1,d1
3082 );
3083                                 free_reg(s1);
3084                                 push_reg(d1);
3085                         }
3086                         else if (n2 == 8)
3087                         {
3088                                 s1= pop_double(0);
3089                                 d1= alloc_float();
3090 fprint ( codefile,
3091                                 "fdtoi  %s, %s\n",s1,d1
3092 );
3093                                 free_double_reg(s1);
3094                                 push_reg(d1);
3095                         }
3096                         else
3097                                 ;
3098                 }
3099                 else
3100                 {
3101
3102                         d1= alloc_float();
3103                         flush_cache();
3104                         force_alloc_output();
3105 fprint ( codefile,
3106                         "cmp    %s, 4\n",a
3107 );
3108 fprint ( codefile,
3109                         "bne    0f\n"
3110 );
3111 fprint ( codefile,
3112                         "nop\n"
3113 );
3114 fprint ( codefile,
3115                         "cmp    %s, 4\n",b
3116 );
3117 fprint ( codefile,
3118                         "be     4f\n"
3119 );
3120 fprint ( codefile,
3121                         "nop\n"
3122 );
3123 fprint ( codefile,
3124                         "cmp    %s, 8\n",b
3125 );
3126 fprint ( codefile,
3127                         "bne    0f\n"
3128 );
3129 fprint ( codefile,
3130                         "nop\n"
3131 );
3132 fprint ( codefile,
3133                 "8:\n"
3134 );
3135 fprint ( codefile,
3136                         "ld     [%s], %%f0\n",reg_sp
3137 );
3138 fprint ( codefile,
3139                         "ld     [%s+4], %%f1\n",reg_sp
3140 );
3141 fprint ( codefile,
3142                         "fdtoi  %%f0, %s\n",d1
3143 );
3144 fprint ( codefile,
3145                         "b      1f\n"
3146 );
3147 fprint ( codefile,
3148                         "inc    2*4, %s\n" ,reg_sp
3149 );
3150 fprint ( codefile,
3151                 "4:\n"
3152 );
3153 fprint ( codefile,
3154                         "ld     [%s+2*4], %%f0\n",reg_sp
3155 );
3156 fprint ( codefile,
3157                         "fstoi  %%f0, %s\n",d1
3158 );
3159 fprint ( codefile,
3160                         "b      1f\n"
3161 );
3162 fprint ( codefile,
3163                         "inc    4, %s\n" ,reg_sp
3164 );
3165 fprint ( codefile,
3166                 "0:\n"
3167 );
3168 fprint ( codefile,
3169                         "set    102, %%o0\n"
3170 );
3171 fprint ( codefile,
3172                         "call   trp\n"
3173 );
3174 fprint ( codefile,
3175                         "nop\n"
3176 );
3177 fprint ( codefile,
3178                 "1:\n"
3179 );
3180                         free_reg(a);
3181                         free_reg(b);
3182                         push_reg(d1);
3183                         free_output();
3184                 }
3185         })
3186 .
3187
3188 C_cfu           ==>
3189 code_combiner(
3190         {
3191                 reg_t a;        
3192                 reg_t b;        
3193                 int n1;         
3194                 int n2;         
3195                 const_str_t n1_str;
3196
3197                 ;
3198                 a= 0;
3199                 b= 0;
3200                 if (type_of_tos() != T_cst)
3201                 {
3202                         a= pop_reg();
3203                         b= pop_reg();
3204                 }
3205                 else
3206                 {
3207                         n1= pop_const (n1_str);
3208                         if (type_of_tos() != T_cst)
3209                         {
3210                                 a= alloc_reg();
3211 fprint ( codefile,
3212                                 "set    %s, %s\n",n1_str,a
3213 );
3214                                 b= pop_reg();
3215                         }
3216                         else
3217                                 n2= pop_const(0);
3218                 }
3219
3220                 if (!a)
3221                 {
3222                         if (n1 != 4)
3223                                 ;
3224                         force_alloc_output();
3225                         flush_cache();
3226                         if (n2 == 4)
3227                         {
3228 fprint ( codefile,
3229                                 "call cfu4\n"
3230 );
3231 fprint ( codefile,
3232                                 "nop\n"
3233 );
3234                         }
3235                         else if (n2 == 8)
3236                         {
3237 fprint ( codefile,
3238                                 "call cfu8\n"
3239 );
3240 fprint ( codefile,
3241                                 "nop\n"
3242 );
3243                         }
3244                         else
3245                                 ;
3246                         soft_alloc_reg(reg_o0);
3247                         free_output();
3248                         push_reg(reg_o0);
3249                 }
3250                 else
3251                 {
3252                         flush_cache();
3253                         force_alloc_output();
3254 fprint ( codefile,
3255                         "cmp    %s, 4\n",a
3256 );
3257 fprint ( codefile,
3258                         "bne    0f\n"
3259 );
3260 fprint ( codefile,
3261                         "nop\n"
3262 );
3263 fprint ( codefile,
3264                         "cmp    %s, 4\n",b
3265 );
3266 fprint ( codefile,
3267                         "be     4f\n"
3268 );
3269 fprint ( codefile,
3270                         "nop\n"
3271 );
3272 fprint ( codefile,
3273                         "cmp    %s, 8\n",b
3274 );
3275 fprint ( codefile,
3276                         "bne    0f\n"
3277 );
3278 fprint ( codefile,
3279                         "nop\n"
3280 );
3281 fprint ( codefile,
3282                 "8:\n"
3283 );
3284 fprint ( codefile,
3285                         "call   cfu8\n"
3286 );
3287 fprint ( codefile,
3288                         "nop\n"
3289 );
3290 fprint ( codefile,
3291                         "b      1f\n"
3292 );
3293 fprint ( codefile,
3294                 "4:\n"
3295 );
3296 fprint ( codefile,
3297                         "call   cfu4\n"
3298 );
3299 fprint ( codefile,
3300                         "nop\n"
3301 );
3302 fprint ( codefile,
3303                         "b      1f\n"
3304 );
3305 fprint ( codefile,
3306                 "0:\n"
3307 );
3308 fprint ( codefile,
3309                         "set    103, %%o0\n"
3310 );
3311 fprint ( codefile,
3312                         "call   trp\n"
3313 );
3314 fprint ( codefile,
3315                         "nop\n"
3316 );
3317 fprint ( codefile,
3318                 "1:\n"
3319 );
3320                         free_reg(a);
3321                         free_reg(b);
3322                         soft_alloc_reg(reg_o0);
3323                         free_output();
3324                         push_reg(reg_o0);
3325                 }
3326         })
3327 .
3328
3329 C_cff           ==>
3330 code_combiner(
3331         {
3332                 reg_t a;        
3333                 reg_t b;        
3334                 int n1;         
3335                 int n2;         
3336                 const_str_t n1_str;
3337
3338                 ;
3339                 a= 0;
3340                 b= 0;
3341                 if (type_of_tos() != T_cst)
3342                 {
3343                         a= pop_reg();
3344                         b= pop_reg();
3345                 }
3346                 else
3347                 {
3348                         n1= pop_const (n1_str);
3349                         if (type_of_tos() != T_cst)
3350                         {
3351                                 a= alloc_reg();
3352 fprint ( codefile,
3353                                 "set    %s, %s\n",n1_str,a
3354 );
3355                                 b= pop_reg();
3356                         }
3357                         else
3358                                 n2= pop_const(0);
3359                 }
3360
3361                 if (!a)
3362                 {
3363                         if (n1 == 4)
3364                         {
3365                                 if (n2 == 8)
3366                                 {
3367                                         a= pop_double(0);
3368                                         b= alloc_float();
3369 fprint ( codefile,
3370                                         "fdtos  %s, %s\n",a,b
3371 );
3372                                         free_double_reg(a);
3373                                         push_reg(b);
3374                                 } else if (n2 != 4)
3375                                         ;
3376                         }
3377                         else if (n1 == 8)
3378                         {
3379                                 if (n2 == 4)
3380                                 {
3381                                         a= pop_float();
3382                                         b= alloc_double(0);
3383 fprint ( codefile,
3384                                         "fstod  %s, %s\n",a,b
3385 );
3386                                         free_reg(a);
3387                                         push_double_reg(b);
3388                                 } else if (n2 != 8)
3389                                         ;
3390                         }
3391                         else
3392                                 ;
3393                 }
3394                 else
3395                 {
3396
3397                         flush_cache();
3398                         force_alloc_output();
3399 fprint ( codefile,
3400                         "cmp    %s, %s\n",b,a
3401 );
3402 fprint ( codefile,
3403                         "be     1f\n"
3404 );
3405 fprint ( codefile,
3406                         "nop\n"         
3407 );
3408 fprint ( codefile,
3409                         "cmp    %s, 4\n",b
3410 );
3411 fprint ( codefile,
3412                         "be     4f\n"
3413 );
3414 fprint ( codefile,
3415                         "nop\n"
3416 );
3417 fprint ( codefile,
3418                         "cmp    %s, 8\n",b
3419 );
3420 fprint ( codefile,
3421                         "be     8f\n"
3422 );
3423 fprint ( codefile,
3424                         "nop\n"
3425 );
3426 fprint ( codefile,
3427                 "0:\n"
3428 );
3429 fprint ( codefile,
3430                         "set    101, %%o0\n"
3431 );
3432 fprint ( codefile,
3433                         "call   trp\n"
3434 );
3435 fprint ( codefile,
3436                         "nop\n"
3437 );
3438 fprint ( codefile,
3439                 "4:\n"
3440 );
3441 fprint ( codefile,
3442                         "cmp    %s, 8\n",a
3443 );
3444 fprint ( codefile,
3445                         "bne    0b\n"
3446 );
3447 fprint ( codefile,
3448                         "nop\n"
3449 );
3450 fprint ( codefile,
3451                         "ld     [%s], %%f0\n",reg_sp
3452 );
3453 fprint ( codefile,
3454                         "fstod  %%f0, %%f2\n"
3455 );
3456 fprint ( codefile,
3457                         "dec    4, %s\n",reg_sp
3458 );
3459 fprint ( codefile,
3460                         "st     %%f2, [%s]\n",reg_sp
3461 );
3462 fprint ( codefile,
3463                         "st     %%f3, [%s+4]\n",reg_sp
3464 );
3465 fprint ( codefile,
3466                         "b      1f\n"
3467 );
3468 fprint ( codefile,
3469                         "nop\n"
3470 );
3471 fprint ( codefile,
3472                 "8:\n"
3473 );
3474 fprint ( codefile,
3475                         "cmp    %s, 4\n",a
3476 );
3477 fprint ( codefile,
3478                         "bne    0b\n"
3479 );
3480 fprint ( codefile,
3481                         "nop\n"
3482 );
3483 fprint ( codefile,
3484                         "ld     [%s], %%f0\n",reg_sp
3485 );
3486 fprint ( codefile,
3487                         "ld     [%s+4], %%f1\n",reg_sp
3488 );
3489 fprint ( codefile,
3490                         "fdtos  %%f0, %%f2\n"
3491 );
3492 fprint ( codefile,
3493                         "inc    4, %s\n",reg_sp
3494 );
3495 fprint ( codefile,
3496                         "st     %%f2, [%s]\n",reg_sp
3497 );
3498 fprint ( codefile,
3499                 "1:\n"
3500 );
3501                         free_reg(a);
3502                         free_reg(b);
3503                         free_output();
3504                 }
3505         })
3506 .
3507
3508 C_cif           ==>
3509 code_combiner(
3510         {
3511                 reg_t a;        
3512                 reg_t b;        
3513                 int n1;         
3514                 int n2;         
3515                 reg_t r1;
3516                 reg_t f1;
3517                 const_str_t n1_str;
3518
3519                 ;
3520                 a= 0;
3521                 b= 0;
3522                 if (type_of_tos() != T_cst)
3523                 {
3524                         a= pop_reg();
3525                         b= pop_reg();
3526                 }
3527                 else
3528                 {
3529                         n1= pop_const (n1_str);
3530                         if (type_of_tos() != T_cst)
3531                         {
3532                                 a= alloc_reg();
3533 fprint ( codefile,
3534                                 "set    %s, %s\n",n1_str,a
3535 );
3536                                 b= pop_reg();
3537                         }
3538                         else
3539                                 n2= pop_const(0);
3540                 }
3541
3542                 if (!a)
3543                 {
3544                         if (n2 != 4)
3545                                 ;
3546                         else
3547                         {
3548                                 if (n1 == 4)
3549                                 {
3550                                         r1= pop_float();
3551                                         f1= alloc_float();
3552 fprint ( codefile,
3553                                         "fitos  %s, %s\n",r1,f1
3554 );
3555                                         free_reg(r1);
3556                                         push_reg(f1);
3557
3558                                 }
3559                                 else if (n1 == 8)
3560                                 {
3561                                         r1= pop_float();
3562                                         f1= alloc_double(0);
3563 fprint ( codefile,
3564                                         "fitod  %s, %s\n",r1,f1
3565 );
3566                                         free_reg(r1);
3567                                         push_double_reg(f1);
3568                                 }
3569                                 else
3570                                         ;
3571                         }
3572                 }
3573                 else
3574                 {
3575                         flush_cache();
3576                         force_alloc_output();
3577 fprint ( codefile,
3578                         "cmp    %s, 4\n",a
3579 );
3580 fprint ( codefile,
3581                         "be     4f\n"
3582 );
3583 fprint ( codefile,
3584                         "nop\n"         
3585 );
3586 fprint ( codefile,
3587                         "cmp    %s, 8\n",a
3588 );
3589 fprint ( codefile,
3590                         "be     8f\n"
3591 );
3592 fprint ( codefile,
3593                         "nop\n"         
3594 );
3595 fprint ( codefile,
3596                 "1:\n"
3597 );
3598 fprint ( codefile,
3599                         "set    100, %%o0\n"
3600 );
3601 fprint ( codefile,
3602                         "call   trp\n"
3603 );
3604 fprint ( codefile,
3605                         "nop\n"
3606 );
3607 fprint ( codefile,
3608                 "4:\n"
3609 );
3610 fprint ( codefile,
3611                         "cmp    %s, 4\n",b
3612 );
3613 fprint ( codefile,
3614                         "bne    1b\n"
3615 );
3616 fprint ( codefile,
3617                         "nop\n"         
3618 );
3619 fprint ( codefile,
3620                         "ld     [%s], %%f0\n",reg_sp
3621 );
3622 fprint ( codefile,
3623                         "fitos  %%f0, %%f1\n"
3624 );
3625 fprint ( codefile,
3626                         "b      0f\n"
3627 );
3628 fprint ( codefile,
3629                         "st     %%f1, [%s]\n"   ,reg_sp
3630 );
3631 fprint ( codefile,
3632                 "8:\n"
3633 );
3634 fprint ( codefile,
3635                         "dec    4, %s\n",reg_sp
3636 );
3637 fprint ( codefile,
3638                         "cmp    %s, 4\n",b
3639 );
3640 fprint ( codefile,
3641                         "bne    1b\n"
3642 );
3643 fprint ( codefile,
3644                         "nop\n"         
3645 );
3646 fprint ( codefile,
3647                         "ld     [%s+4], %%f0\n",reg_sp
3648 );
3649 fprint ( codefile,
3650                         "fitod  %%f0, %%f2\n"
3651 );
3652 fprint ( codefile,
3653                         "st     %%f2, [%s]\n",reg_sp
3654 );
3655 fprint ( codefile,
3656                         "b      0f\n"
3657 );
3658 fprint ( codefile,
3659                         "st     %%f3, [%s+4]\n" ,reg_sp
3660 );
3661 fprint ( codefile,
3662                 "0:\n"
3663 );
3664                         free_reg(a);
3665                         free_reg(b);
3666                         free_output();
3667                 }
3668         })
3669 .
3670
3671
3672 C_cuf           ==>
3673 code_combiner(
3674         {
3675                 reg_t a;        
3676                 reg_t b;        
3677                 reg_t c;
3678                 reg_t fs1;
3679                 reg_t fs2;
3680                 reg_t fd1;
3681                 reg_t fd2;
3682                 int n1;         
3683                 int n2;         
3684                 const_str_t n1_str;
3685
3686                 ;
3687                 a= 0;
3688                 b= 0;
3689                 if (type_of_tos() != T_cst)
3690                 {
3691                         a= pop_reg();
3692                         b= pop_reg();
3693                 }
3694                 else
3695                 {
3696                         n1= pop_const (n1_str);
3697                         if (type_of_tos() != T_cst)
3698                         {
3699                                 a= alloc_reg();
3700 fprint ( codefile,
3701                                 "set    %s, %s\n",n1_str,a
3702 );
3703                                 b= pop_reg();
3704                         }
3705                         else
3706                                 n2= pop_const(0);
3707                 }
3708
3709                 if (!a)
3710                 {
3711                         if (n2 != 4)
3712                                 ;
3713                         else
3714                         {
3715                                 if (n1 == 4)
3716                                 {
3717                                         fs1= pop_float();
3718                                         fs2= alloc_float();
3719                                         a= alloc_reg();
3720 fprint ( codefile,
3721                                         "fitos  %s, %s\n",fs1,fs2
3722 );
3723 fprint ( codefile,
3724                                         "sethi  %%hi(Fs0), %s\n",a
3725 );
3726 fprint ( codefile,
3727                                         "ld     [%s+%%lo(Fs0)], %s\n",a,fs1
3728 );
3729 fprint ( codefile,
3730                                         "fcmpes %s, %s\n",fs2,fs1
3731 );
3732 fprint ( codefile,
3733                                         "nop\n"
3734 );
3735 fprint ( codefile,
3736                                         "fbge   0f\n"
3737 );
3738 fprint ( codefile,
3739                                         "nop\n"
3740 );
3741 fprint ( codefile,
3742                                         "sethi  %%hi(Fs80000000), %s\n",a
3743 );
3744 fprint ( codefile,
3745                                         "ld     [%s+%%lo(Fs80000000)], %s\n",a,fs1
3746 );
3747 fprint ( codefile,
3748                                         "fadds  %s, %s, %s\n",fs1,fs2,fs2
3749 );
3750 fprint ( codefile,
3751                                 "0:\n"
3752 );
3753                                         push_reg(fs2);
3754                                         free_reg(fs1);
3755                                         free_reg(a);
3756                                 }
3757                                 else if (n1 == 8)
3758                                 {
3759                                         fs1= pop_float();
3760                                         fd1= alloc_double(0);
3761                                         fd2= alloc_double(0);
3762                                         a= alloc_reg();
3763 fprint ( codefile,
3764                                         "fitod  %s, %s\n",fs1,fd2
3765 );
3766 fprint ( codefile,
3767                                         "sethi  %%hi(Fd0), %s\n",a
3768 );
3769 fprint ( codefile,
3770                                         "ldd    [%s+%%lo(Fd0)], %s\n",a,fd1
3771 );
3772 fprint ( codefile,
3773                                         "fcmped %s, %s\n",fd2,fd1
3774 );
3775 fprint ( codefile,
3776                                         "nop\n"
3777 );
3778 fprint ( codefile,
3779                                         "fbge   0f\n"
3780 );
3781 fprint ( codefile,
3782                                         "nop\n"
3783 );
3784 fprint ( codefile,
3785                                         "sethi  %%hi(Fd80000000), %s\n",a
3786 );
3787 fprint ( codefile,
3788                                         "ldd    [%s+%%lo(Fd80000000)], %s\n",a,fd1
3789 );
3790 fprint ( codefile,
3791                                         "faddd  %s, %s, %s\n",fd1,fd2,fd2
3792 );
3793 fprint ( codefile,
3794                                 "0:\n"
3795 );
3796                                         free_reg(fs1);
3797                                         free_double_reg(fd1);
3798                                         push_double_reg(fd2);
3799                                         free_reg(a);
3800                                 }
3801                                 else
3802                                         ;
3803                         }
3804                 }
3805                 else
3806                 {
3807
3808         not_implemented ("cuf");
3809
3810                 }
3811         })
3812 .
3813
3814
3815
3816
3817
3818
3819 C_and           ==>
3820 code_combiner(
3821         ;
3822         push_const($1);
3823         C_and_narg())
3824 .
3825
3826 C_and_narg      ==>
3827 code_combiner(
3828         {
3829                 reg_t a;
3830                 reg_t b;
3831                 reg_t c;
3832                 reg_t d;
3833                 reg_t e;
3834                 reg_t f;
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;
3839                 int n;
3840                 const_str_t n_str;
3841
3842                 ;
3843                 if (type_of_tos() == T_cst)
3844                 {
3845                         n= pop_const(n_str);
3846                         if (n == 4)
3847                         {
3848                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3849                                 {
3850                                         a= 0;
3851                                         pop_const (a_cst_str);
3852                                 }
3853                                 else
3854                                         a= pop_reg();
3855                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3856                                 {
3857                                         b= 0;
3858                                         pop_const (b_cst_str);
3859                                 }
3860                                 else
3861                                         b= pop_reg();
3862                                 if (!a && !b)
3863                                 {
3864                                         a= alloc_reg();
3865 fprint ( codefile,
3866                                         "mov    %s, %s\n"       ,a_cst_str,a
3867 );
3868                                 }
3869                                 c= alloc_reg();
3870                                 if (a)
3871                                         if (b)
3872 fprint ( codefile,
3873                                                 "and    %s, %s, %s\n",a,b,c
3874 );
3875                                         else
3876 fprint ( codefile,
3877                                                 "and    %s, %s, %s\n",a,b_cst_str,c
3878 );
3879                                 else
3880 fprint ( codefile,
3881                                         "and    %s, %s, %s\n",b,a_cst_str,c
3882 );
3883                                 free_reg(a);
3884                                 free_reg(b);
3885                                 push_reg(c);
3886                         }
3887                         else if (n == 8)
3888                         {
3889                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3890                                 {
3891                                         a= 0;
3892                                         pop_const (a_cst_str);
3893                                 }
3894                                 else
3895                                         a= pop_reg();
3896                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3897                                 {
3898                                         b= 0;
3899                                         pop_const (b_cst_str);
3900                                 }
3901                                 else
3902                                         b= pop_reg();
3903                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3904                                 {
3905                                         c= 0;
3906                                         pop_const (c_cst_str);
3907                                 }
3908                                 else
3909                                         c= pop_reg();
3910                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
3911                                 {
3912                                         d= 0;
3913                                         pop_const (d_cst_str);
3914                                 }
3915                                 else
3916                                         d= pop_reg();
3917                                 if (!b && !d)
3918                                 {
3919                                         b= alloc_reg();
3920 fprint ( codefile,
3921                                         "mov    %s, %s\n"       ,b_cst_str,b
3922 );
3923                                 }
3924                                 e= alloc_reg();
3925                                 if (b)
3926                                         if (d)
3927 fprint ( codefile,
3928                                                 "and    %s, %s, %s\n",b,d,e
3929 );
3930                                         else
3931 fprint ( codefile,
3932                                                 "and    %s, %s, %s\n",b,d_cst_str,e
3933 );
3934                                 else
3935 fprint ( codefile,
3936                                         "and    %s, %s, %s\n",d,b_cst_str,e
3937 );
3938                                 free_reg(b);
3939                                 free_reg(d);
3940                                 push_reg(e);
3941                                 if (!a && !c)
3942                                 {
3943                                         a= alloc_reg();
3944 fprint ( codefile,
3945                                         "mov    %s, %s\n"       ,a_cst_str,a
3946 );
3947                                 }
3948                                 e= alloc_reg();
3949                                 if (a)
3950                                         if (c)
3951 fprint ( codefile,
3952                                                 "and    %s, %s, %s\n",a,c,e
3953 );
3954                                         else
3955 fprint ( codefile,
3956                                                 "and    %s, %s, %s\n",a,c_cst_str,e
3957 );
3958                                 else
3959 fprint ( codefile,
3960                                         "and    %s, %s, %s\n",c,a_cst_str,e
3961 );
3962                                 free_reg(a);
3963                                 free_reg(c);
3964                                 push_reg(e);
3965                         }
3966                         else if (!(n % 4))
3967                         {
3968                                 a= alloc_reg();
3969                                 b= alloc_reg();
3970                                 c= alloc_reg();
3971                                 d= alloc_reg();
3972                                 e= alloc_reg();
3973                                 f= alloc_reg();
3974                                 flush_cache();
3975
3976 fprint ( codefile,
3977                                 "set    %s, %s\n",n_str,a
3978 );
3979 fprint ( codefile,
3980                                 "add    %s, %s, %s\n",reg_sp,a,b
3981 );
3982 fprint ( codefile,
3983                                 "mov    %s, %s\n",a,c
3984 );
3985 fprint ( codefile,
3986                         "1:\n"
3987 );
3988 fprint ( codefile,
3989                                 "deccc  4, %s\n",c
3990 );
3991 fprint ( codefile,
3992                                 "ld     [%s+%s], %s\n",reg_sp,c,d
3993 );
3994 fprint ( codefile,
3995                                 "ld     [%s+%s], %s\n",b,c,e
3996 );
3997 fprint ( codefile,
3998                                 "and    %s, %s, %s\n",d,e,f
3999 );
4000 fprint ( codefile,
4001                                 "bnz    1b\n"
4002 );
4003 fprint ( codefile,
4004                                 "st     %s, [%s+%s]\n"  ,f,b,c
4005 );
4006 fprint ( codefile,
4007                                 "add    %s, %s, %s\n",reg_sp,a,reg_sp
4008 );
4009                                 free_reg(a);
4010                                 free_reg(b);
4011                                 free_reg(c);
4012                                 free_reg(d);
4013                                 free_reg(e);
4014                                 free_reg(f);
4015                         }
4016                         else
4017                                 ;
4018                 }
4019                 else
4020                 {
4021                         a= pop_reg();
4022                         b= alloc_reg();
4023                         c= alloc_reg();
4024                         d= alloc_reg();
4025                         e= alloc_reg();
4026                         f= alloc_reg();
4027                         flush_cache();
4028
4029 fprint ( codefile,
4030                         "add    %s, %s, %s\n",reg_sp,a,b
4031 );
4032 fprint ( codefile,
4033                         "mov    %s, %s\n",a,c
4034 );
4035 fprint ( codefile,
4036                 "1:\n"
4037 );
4038 fprint ( codefile,
4039                         "deccc  4, %s\n",c
4040 );
4041 fprint ( codefile,
4042                         "ld     [%s+%s], %s\n",reg_sp,c,d
4043 );
4044 fprint ( codefile,
4045                         "ld     [%s+%s], %s\n",b,c,e
4046 );
4047 fprint ( codefile,
4048                         "and    %s, %s, %s\n",d,e,f
4049 );
4050 fprint ( codefile,
4051                         "bnz    1b\n"
4052 );
4053 fprint ( codefile,
4054                         "st     %s, [%s+%s]\n"  ,f,b,c
4055 );
4056 fprint ( codefile,
4057                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
4058 );
4059                         free_reg(a);
4060                         free_reg(b);
4061                         free_reg(c);
4062                         free_reg(d);
4063                         free_reg(e);
4064                         free_reg(f);
4065                         
4066                 }
4067         })
4068 .
4069
4070 C_ior           ==>
4071 code_combiner(
4072         ;
4073         push_const($1);
4074         C_ior_narg())
4075 .
4076
4077 C_ior_narg      ==>
4078 code_combiner(
4079         {
4080                 reg_t a;
4081                 reg_t b;
4082                 reg_t c;
4083                 reg_t d;
4084                 reg_t e;
4085                 reg_t f;
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;
4090                 int n;
4091                 const_str_t n_str;
4092
4093                 ;
4094                 if (type_of_tos() == T_cst)
4095                 {
4096                         n= pop_const(n_str);
4097                         if (n == 4)
4098                         {
4099                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4100                                 {
4101                                         a= 0;
4102                                         pop_const (a_cst_str);
4103                                 }
4104                                 else
4105                                         a= pop_reg();
4106                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4107                                 {
4108                                         b= 0;
4109                                         pop_const (b_cst_str);
4110                                 }
4111                                 else
4112                                         b= pop_reg();
4113                                 if (!a && !b)
4114                                 {
4115                                         a= alloc_reg();
4116 fprint ( codefile,
4117                                         "mov    %s, %s\n"       ,a_cst_str,a
4118 );
4119                                 }
4120                                 c= alloc_reg();
4121                                 if (a)
4122                                         if (b)
4123 fprint ( codefile,
4124                                                 "or     %s, %s, %s\n",a,b,c
4125 );
4126                                         else
4127 fprint ( codefile,
4128                                                 "or     %s, %s, %s\n",a,b_cst_str,c
4129 );
4130                                 else
4131 fprint ( codefile,
4132                                         "or     %s, %s, %s\n",b,a_cst_str,c
4133 );
4134                                 free_reg(a);
4135                                 free_reg(b);
4136                                 push_reg(c);
4137                         }
4138                         else if (n == 8)
4139                         {
4140                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4141                                 {
4142                                         a= 0;
4143                                         pop_const (a_cst_str);
4144                                 }
4145                                 else
4146                                         a= pop_reg();
4147                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4148                                 {
4149                                         b= 0;
4150                                         pop_const (b_cst_str);
4151                                 }
4152                                 else
4153                                         b= pop_reg();
4154                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4155                                 {
4156                                         c= 0;
4157                                         pop_const (c_cst_str);
4158                                 }
4159                                 else
4160                                         c= pop_reg();
4161                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4162                                 {
4163                                         d= 0;
4164                                         pop_const (d_cst_str);
4165                                 }
4166                                 else
4167                                         d= pop_reg();
4168                                 if (!b && !d)
4169                                 {
4170                                         b= alloc_reg();
4171 fprint ( codefile,
4172                                         "mov    %s, %s\n"       ,b_cst_str,b
4173 );
4174                                 }
4175                                 e= alloc_reg();
4176                                 if (b)
4177                                         if (d)
4178 fprint ( codefile,
4179                                                 "or     %s, %s, %s\n",b,d,e
4180 );
4181                                         else
4182 fprint ( codefile,
4183                                                 "or     %s, %s, %s\n",b,d_cst_str,e
4184 );
4185                                 else
4186 fprint ( codefile,
4187                                         "or     %s, %s, %s\n",d,b_cst_str,e
4188 );
4189                                 free_reg(b);
4190                                 free_reg(d);
4191                                 push_reg(e);
4192                                 if (!a && !c)
4193                                 {
4194                                         a= alloc_reg();
4195 fprint ( codefile,
4196                                         "mov    %s, %s\n"       ,a_cst_str,a
4197 );
4198                                 }
4199                                 e= alloc_reg();
4200                                 if (a)
4201                                         if (c)
4202 fprint ( codefile,
4203                                                 "or     %s, %s, %s\n",a,c,e
4204 );
4205                                         else
4206 fprint ( codefile,
4207                                                 "or     %s, %s, %s\n",a,c_cst_str,e
4208 );
4209                                 else
4210 fprint ( codefile,
4211                                         "or     %s, %s, %s\n",c,a_cst_str,e
4212 );
4213                                 free_reg(a);
4214                                 free_reg(c);
4215                                 push_reg(e);
4216                         }
4217                         else if (!(n % 4))
4218                         {
4219                                 a= alloc_reg();
4220                                 b= alloc_reg();
4221                                 c= alloc_reg();
4222                                 d= alloc_reg();
4223                                 e= alloc_reg();
4224                                 f= alloc_reg();
4225                                 flush_cache();
4226
4227 fprint ( codefile,
4228                                 "set    %s, %s\n",n_str,a
4229 );
4230 fprint ( codefile,
4231                                 "add    %s, %s, %s\n",reg_sp,a,b
4232 );
4233 fprint ( codefile,
4234                                 "mov    %s, %s\n",a,c
4235 );
4236 fprint ( codefile,
4237                         "1:\n"
4238 );
4239 fprint ( codefile,
4240                                 "deccc  4, %s\n",c
4241 );
4242 fprint ( codefile,
4243                                 "ld     [%s+%s], %s\n",reg_sp,c,d
4244 );
4245 fprint ( codefile,
4246                                 "ld     [%s+%s], %s\n",b,c,e
4247 );
4248 fprint ( codefile,
4249                                 "or     %s, %s, %s\n",d,e,f
4250 );
4251 fprint ( codefile,
4252                                 "bnz    1b\n"
4253 );
4254 fprint ( codefile,
4255                                 "st     %s, [%s+%s]\n"  ,f,b,c
4256 );
4257 fprint ( codefile,
4258                                 "add    %s, %s, %s\n",reg_sp,a,reg_sp
4259 );
4260                                 free_reg(a);
4261                                 free_reg(b);
4262                                 free_reg(c);
4263                                 free_reg(d);
4264                                 free_reg(e);
4265                                 free_reg(f);
4266                         }
4267                         else
4268                                 ;
4269                 }
4270                 else
4271                 {
4272                         a= pop_reg();
4273                         b= alloc_reg();
4274                         c= alloc_reg();
4275                         d= alloc_reg();
4276                         e= alloc_reg();
4277                         f= alloc_reg();
4278                         flush_cache();
4279
4280 fprint ( codefile,
4281                         "add    %s, %s, %s\n",reg_sp,a,b
4282 );
4283 fprint ( codefile,
4284                         "mov    %s, %s\n",a,c
4285 );
4286 fprint ( codefile,
4287                 "1:\n"
4288 );
4289 fprint ( codefile,
4290                         "deccc  4, %s\n",c
4291 );
4292 fprint ( codefile,
4293                         "ld     [%s+%s], %s\n",reg_sp,c,d
4294 );
4295 fprint ( codefile,
4296                         "ld     [%s+%s], %s\n",b,c,e
4297 );
4298 fprint ( codefile,
4299                         "or     %s, %s, %s\n",d,e,f
4300 );
4301 fprint ( codefile,
4302                         "bnz    1b\n"
4303 );
4304 fprint ( codefile,
4305                         "st     %s, [%s+%s]\n"  ,f,b,c
4306 );
4307 fprint ( codefile,
4308                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
4309 );
4310                         free_reg(a);
4311                         free_reg(b);
4312                         free_reg(c);
4313                         free_reg(d);
4314                         free_reg(e);
4315                         free_reg(f);
4316                 }
4317         })
4318 .
4319
4320
4321
4322 C_xor           ==>
4323 code_combiner(
4324         ;
4325         push_const($1);
4326         C_xor_narg())
4327 .
4328
4329 C_xor_narg      ==>
4330 code_combiner(
4331         {
4332                 reg_t a;
4333                 reg_t b;
4334                 reg_t c;
4335                 reg_t d;
4336                 reg_t e;
4337                 reg_t f;
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;
4342                 int n;
4343                 const_str_t n_str;
4344
4345                 ;
4346                 if (type_of_tos() == T_cst)
4347                 {
4348                         n= pop_const(n_str);
4349                         if (n == 4)
4350                         {
4351                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4352                                 {
4353                                         a= 0;
4354                                         pop_const (a_cst_str);
4355                                 }
4356                                 else
4357                                         a= pop_reg();
4358                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4359                                 {
4360                                         b= 0;
4361                                         pop_const (b_cst_str);
4362                                 }
4363                                 else
4364                                         b= pop_reg();
4365                                 if (!a && !b)
4366                                 {
4367                                         a= alloc_reg();
4368 fprint ( codefile,
4369                                         "mov    %s, %s\n"       ,a_cst_str,a
4370 );
4371                                 }
4372                                 c= alloc_reg();
4373                                 if (a)
4374                                         if (b)
4375 fprint ( codefile,
4376                                                 "xor    %s, %s, %s\n",a,b,c
4377 );
4378                                         else
4379 fprint ( codefile,
4380                                                 "xor    %s, %s, %s\n",a,b_cst_str,c
4381 );
4382                                 else
4383 fprint ( codefile,
4384                                         "xor    %s, %s, %s\n",b,a_cst_str,c
4385 );
4386                                 free_reg(a);
4387                                 free_reg(b);
4388                                 push_reg(c);
4389                         }
4390                         else if (n == 8)
4391                         {
4392                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4393                                 {
4394                                         a= 0;
4395                                         pop_const (a_cst_str);
4396                                 }
4397                                 else
4398                                         a= pop_reg();
4399                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4400                                 {
4401                                         b= 0;
4402                                         pop_const (b_cst_str);
4403                                 }
4404                                 else
4405                                         b= pop_reg();
4406                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4407                                 {
4408                                         c= 0;
4409                                         pop_const (c_cst_str);
4410                                 }
4411                                 else
4412                                         c= pop_reg();
4413                                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4414                                 {
4415                                         d= 0;
4416                                         pop_const (d_cst_str);
4417                                 }
4418                                 else
4419                                         d= pop_reg();
4420                                 if (!b && !d)
4421                                 {
4422                                         b= alloc_reg();
4423 fprint ( codefile,
4424                                         "mov    %s, %s\n"       ,b_cst_str,b
4425 );
4426                                 }
4427                                 e= alloc_reg();
4428                                 if (b)
4429                                         if (d)
4430 fprint ( codefile,
4431                                                 "xor    %s, %s, %s\n",b,d,e
4432 );
4433                                         else
4434 fprint ( codefile,
4435                                                 "xor    %s, %s, %s\n",b,d_cst_str,e
4436 );
4437                                 else
4438 fprint ( codefile,
4439                                         "xor    %s, %s, %s\n",d,b_cst_str,e
4440 );
4441                                 free_reg(b);
4442                                 free_reg(d);
4443                                 push_reg(e);
4444                                 if (!a && !c)
4445                                 {
4446                                         a= alloc_reg();
4447 fprint ( codefile,
4448                                         "mov    %s, %s\n"       ,a_cst_str,a
4449 );
4450                                 }
4451                                 e= alloc_reg();
4452                                 if (a)
4453                                         if (c)
4454 fprint ( codefile,
4455                                                 "xor    %s, %s, %s\n",a,c,e
4456 );
4457                                         else
4458 fprint ( codefile,
4459                                                 "xor    %s, %s, %s\n",a,c_cst_str,e
4460 );
4461                                 else
4462 fprint ( codefile,
4463                                         "xor    %s, %s, %s\n",c,a_cst_str,e
4464 );
4465                                 free_reg(a);
4466                                 free_reg(c);
4467                                 push_reg(e);
4468                         }
4469                         else if (!(n % 4))
4470                         {
4471                                 a= alloc_reg();
4472                                 b= alloc_reg();
4473                                 c= alloc_reg();
4474                                 d= alloc_reg();
4475                                 e= alloc_reg();
4476                                 f= alloc_reg();
4477                                 flush_cache();
4478
4479 fprint ( codefile,
4480                                 "set    %s, %s\n",n_str,a
4481 );
4482 fprint ( codefile,
4483                                 "add    %s, %s, %s\n",reg_sp,a,b
4484 );
4485 fprint ( codefile,
4486                                 "mov    %s, %s\n",a,c
4487 );
4488 fprint ( codefile,
4489                         "1:\n"
4490 );
4491 fprint ( codefile,
4492                                 "deccc  4, %s\n",c
4493 );
4494 fprint ( codefile,
4495                                 "ld     [%s+%s], %s\n",reg_sp,c,d
4496 );
4497 fprint ( codefile,
4498                                 "ld     [%s+%s], %s\n",b,c,e
4499 );
4500 fprint ( codefile,
4501                                 "xor    %s, %s, %s\n",d,e,f
4502 );
4503 fprint ( codefile,
4504                                 "bnz    1b\n"
4505 );
4506 fprint ( codefile,
4507                                 "st     %s, [%s+%s]\n"  ,f,b,c
4508 );
4509 fprint ( codefile,
4510                                 "add    %s, %s, %s\n",reg_sp,a,reg_sp
4511 );
4512                                 free_reg(a);
4513                                 free_reg(b);
4514                                 free_reg(c);
4515                                 free_reg(d);
4516                                 free_reg(e);
4517                                 free_reg(f);
4518                         }
4519                         else
4520                                 ;
4521                 }
4522                 else
4523                 {
4524                         a= pop_reg();
4525                         b= alloc_reg();
4526                         c= alloc_reg();
4527                         d= alloc_reg();
4528                         e= alloc_reg();
4529                         f= alloc_reg();
4530                         flush_cache();
4531
4532 fprint ( codefile,
4533                         "add    %s, %s, %s\n",reg_sp,a,b
4534 );
4535 fprint ( codefile,
4536                         "mov    %s, %s\n",a,c
4537 );
4538 fprint ( codefile,
4539                 "1:\n"
4540 );
4541 fprint ( codefile,
4542                         "deccc  4, %s\n",c
4543 );
4544 fprint ( codefile,
4545                         "ld     [%s+%s], %s\n",reg_sp,c,d
4546 );
4547 fprint ( codefile,
4548                         "ld     [%s+%s], %s\n",b,c,e
4549 );
4550 fprint ( codefile,
4551                         "xor    %s, %s, %s\n",d,e,f
4552 );
4553 fprint ( codefile,
4554                         "bnz    1b\n"
4555 );
4556 fprint ( codefile,
4557                         "st     %s, [%s+%s]\n"  ,f,b,c
4558 );
4559 fprint ( codefile,
4560                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
4561 );
4562                         free_reg(a);
4563                         free_reg(b);
4564                         free_reg(c);
4565                         free_reg(d);
4566                         free_reg(e);
4567                         free_reg(f);
4568                 }
4569         })
4570 .
4571
4572
4573
4574 C_com           ==>
4575 code_combiner(
4576         ;
4577         push_const($1);
4578         C_com_narg())
4579 .
4580
4581 C_com_narg      ==>
4582 code_combiner(
4583         {
4584                 reg_t a;
4585                 reg_t b;
4586                 reg_t c;
4587                 reg_t d;
4588                 int n;
4589                 int i;
4590                 const_str_t i_str;
4591
4592                 ;
4593                 if (type_of_tos() == T_cst && top_const() <= 16)
4594                 {
4595                         n= pop_const(0);
4596                         if (n == 4)
4597                         {
4598                                 a= pop_reg();
4599                                 b= alloc_reg();
4600 fprint ( codefile,
4601                                 "not    %s, %s\n",a,b
4602 );
4603                                 free_reg(a);
4604                                 push_reg(b);
4605                         }
4606                         else if (n == 8)
4607                         {
4608                                 a= pop_reg();
4609                                 b= pop_reg();
4610                                 c= alloc_reg();
4611                                 d= alloc_reg();
4612 fprint ( codefile,
4613                                 "not    %s, %s\n",a,c
4614 );
4615 fprint ( codefile,
4616                                 "not    %s, %s\n",b,d
4617 );
4618                                 push_reg(d);
4619                                 push_reg(c);
4620                                 free_reg(b);
4621                                 free_reg(a);
4622                         }
4623                         else if (n>0 && !(n % 4))
4624                         {
4625                                 flush_cache();
4626                                 a= alloc_reg();
4627                                 b= alloc_reg();
4628                                 for (i= 0; i< n; i += 4)
4629                                 {
4630                                         sprint(i_str, "%d", i);
4631 fprint ( codefile,
4632                                         "ld     [%s+%s], %s\n",reg_sp,i_str,a
4633 );
4634 fprint ( codefile,
4635                                         "not    %s, %s\n",a,b
4636 );
4637 fprint ( codefile,
4638                                         "st     %s, [%s+%s]\n",b,reg_sp,i_str
4639 );
4640                                 }
4641                                 free_reg(b);
4642                                 free_reg(a);
4643                         }
4644                         else
4645                                 ;
4646                 }
4647                 else
4648                 {
4649                         a= alloc_reg();
4650                         pop_reg_as(a);
4651                         b= alloc_reg();
4652                         c= alloc_reg();
4653                         flush_cache();
4654 fprint ( codefile,
4655                 "1:\n"
4656 );
4657 fprint ( codefile,
4658                         "deccc  4, %s\n",a
4659 );
4660 fprint ( codefile,
4661                         "ld     [%s+%s], %s\n",reg_sp,a,b
4662 );
4663 fprint ( codefile,
4664                         "not    %s, %s\n",a,c
4665 );
4666 fprint ( codefile,
4667                         "bnz    1b\n"
4668 );
4669 fprint ( codefile,
4670                         "st     %s, [%s+%s]\n",c,reg_sp,a
4671 );
4672                         free_reg(a);
4673                         free_reg(b);
4674                         free_reg(c);
4675                 }
4676         })
4677 .
4678
4679 C_rol
4680         $1 == 4         ==>
4681 code_combiner(
4682         {
4683                 reg_t a;
4684                 reg_t b;
4685                 reg_t c;
4686                 reg_t d;
4687                 int n;
4688                 const_str_t n_str;
4689
4690                 ;
4691
4692                 if (type_of_tos() == T_cst)
4693                 {
4694                         n= pop_const(0);
4695                         if (n<0)
4696                                 ;
4697                         else
4698                         {
4699                                 n= n % 32;
4700                                 if (n)
4701                                 {
4702                                         a= pop_reg();
4703                                         b= alloc_reg();
4704                                         c= alloc_reg();
4705                                         sprint(n_str, "%d", n);
4706 fprint ( codefile,
4707                                         "sll    %s, %s, %s\n",a,n_str,b
4708 );
4709                                         sprint(n_str, "%d", 32-n);
4710 fprint ( codefile,
4711                                         "srl    %s, %s, %s\n",a,n_str,c
4712 );
4713 fprint ( codefile,
4714                                         "or     %s, %s, %s\n",b,c,c
4715 );
4716                                         free_reg(a);
4717                                         free_reg(b);
4718                                         push_reg(c);
4719                                 }
4720                         }
4721                 }
4722                 else
4723                 {
4724                         a= pop_reg();
4725                         b= pop_reg();
4726                         c= alloc_reg();
4727                         d= alloc_reg();
4728 fprint ( codefile,
4729                         "and    %s, 31, %s\n",a,c
4730 );
4731 fprint ( codefile,
4732                         "mov    32, %s\n",d
4733 );
4734 fprint ( codefile,
4735                         "sub    %s, %s, %s\n",d,c,d
4736 );
4737 fprint ( codefile,
4738                         "sll    %s, %s, %s\n",b,c,c
4739 );
4740 fprint ( codefile,
4741                         "srl    %s, %s, %s\n",b,d,d
4742 );
4743 fprint ( codefile,
4744                         "or     %s, %s, %s\n",c,d,d
4745 );
4746                         free_reg(a);
4747                         free_reg(b);
4748                         free_reg(c);
4749                         push_reg(d);
4750                 }
4751         })
4752 .
4753         default         ==>
4754 code_combiner(
4755                                 )
4756 .
4757
4758 C_rol_narg      ==>
4759 code_combiner(
4760         {
4761                 reg_t a;
4762                 int n;
4763                 
4764                 ;
4765                 if (type_of_tos() == T_cst)
4766                 {
4767                         n= pop_const(0);
4768                         C_rol (n);
4769                 }
4770                 else
4771                 {
4772                         a= pop_reg();
4773                         force_alloc_output();
4774 fprint ( codefile,
4775                         "cmp    %s, 4\n",a
4776 );
4777 fprint ( codefile,
4778                         "be     1f\n"
4779 );
4780 fprint ( codefile,
4781                         "set    EILLINS, %s\n",reg_o0
4782 );
4783 fprint ( codefile,
4784                         "call   trp\n"
4785 );
4786 fprint ( codefile,
4787                         "nop\n"
4788 );
4789 fprint ( codefile,
4790                 "1:\n"
4791 );
4792                         free_reg(a);
4793                         free_output();
4794                 C_rol (4);
4795                 }
4796         })
4797 .
4798
4799
4800
4801 C_ror
4802         $1 == 4         ==>
4803 code_combiner(
4804         {
4805                 reg_t a;
4806                 reg_t b;
4807                 reg_t c;
4808                 reg_t d;
4809                 int n;
4810                 const_str_t n_str;
4811
4812                 ;
4813
4814                 if (type_of_tos() == T_cst)
4815                 {
4816                         n= pop_const(0);
4817                         if (n<0)
4818                                 ;
4819                         else
4820                         {
4821                                 n= n % 32;
4822                                 if (n)
4823                                 {
4824                                         a= pop_reg();
4825                                         b= alloc_reg();
4826                                         c= alloc_reg();
4827                                         sprint(n_str, "%d", n);
4828 fprint ( codefile,
4829                                         "srl    %s, %s, %s\n",a,n_str,b
4830 );
4831                                         sprint(n_str, "%d", 32-n);
4832 fprint ( codefile,
4833                                         "sll    %s, %s, %s\n",a,n_str,c
4834 );
4835 fprint ( codefile,
4836                                         "or     %s, %s, %s\n",b,c,c
4837 );
4838                                         free_reg(a);
4839                                         free_reg(b);
4840                                         push_reg(c);
4841                                 }
4842                         }
4843                 }
4844                 else
4845                 {
4846                         a= pop_reg();
4847                         b= pop_reg();
4848                         c= alloc_reg();
4849                         d= alloc_reg();
4850 fprint ( codefile,
4851                         "and    %s, 31, %s\n",a,c
4852 );
4853 fprint ( codefile,
4854                         "mov    32, %s\n",d
4855 );
4856 fprint ( codefile,
4857                         "sub    %s, %s, %s\n",d,c,d
4858 );
4859 fprint ( codefile,
4860                         "srl    %s, %s, %s\n",b,c,c
4861 );
4862 fprint ( codefile,
4863                         "sll    %s, %s, %s\n",b,d,d
4864 );
4865 fprint ( codefile,
4866                         "or     %s, %s, %s\n",c,d,d
4867 );
4868                         free_reg(a);
4869                         free_reg(b);
4870                         free_reg(c);
4871                         push_reg(d);
4872                 }
4873         })
4874 .
4875         default         ==>
4876 code_combiner(
4877                                 )
4878 .
4879
4880 C_ror_narg      ==>
4881 code_combiner(
4882         {
4883                 reg_t a;
4884                 int n;
4885                 
4886                 ;
4887                 if (type_of_tos() == T_cst)
4888                 {
4889                         n= pop_const(0);
4890                         C_ror (n);
4891                 }
4892                 else
4893                 {
4894                         a= pop_reg();
4895                         force_alloc_output();
4896 fprint ( codefile,
4897                         "cmp    %s, 4\n",a
4898 );
4899 fprint ( codefile,
4900                         "be     1f\n"
4901 );
4902 fprint ( codefile,
4903                         "set    EILLINS, %s\n",reg_o0
4904 );
4905 fprint ( codefile,
4906                         "call   trp\n"
4907 );
4908 fprint ( codefile,
4909                         "nop\n"
4910 );
4911 fprint ( codefile,
4912                 "1:\n"
4913 );
4914                         free_reg(a);
4915                         free_output();
4916                 C_ror (4);
4917                 }
4918         })
4919 .
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929 C_inn           ==>
4930 code_combiner(
4931         ;
4932         push_const($1);
4933         C_inn_narg())
4934 .
4935
4936 C_inn_narg      ==>
4937 code_combiner(
4938         {
4939                 reg_t a;
4940                 reg_t b;
4941                 reg_t c;
4942                 reg_t d;
4943                 int i;
4944                 int n;
4945                 const_str_t i_str;
4946                 const_str_t n_str;
4947
4948                 ;
4949                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
4950                 {
4951                         n= pop_const(n_str);
4952                         if (n == 4)
4953                         {
4954                                 if (type_of_tos() == T_cst)
4955                                 {
4956                                         i= pop_const (i_str);
4957                                         if (i >= n*8)
4958                                                 push_const(0);
4959                                         else
4960                                         {
4961                                                 a= pop_reg();
4962                                                 b= alloc_reg();
4963 fprint ( codefile,
4964                                                 "srl    %s, %s, %s\n",a,i_str,b
4965 );
4966 fprint ( codefile,
4967                                                 "and    %s, 1, %s\n",b,b
4968 );
4969                                                 free_reg(a);
4970                                                 push_reg(b);
4971                                         }
4972                                 }
4973                                 else
4974                                 {
4975                                         a= pop_reg();
4976                                         b= pop_reg();
4977                                         c= alloc_reg();
4978 fprint ( codefile,
4979                                         "srl    %s, %s, %s\n",b,a,c
4980 );
4981 fprint ( codefile,
4982                                         "and    %s, 1, %s\n",c,c
4983 );
4984                                         push_reg(c);
4985                                         free_reg(b);
4986                                         free_reg(a);
4987                                 }
4988                         }
4989                         else if (n == 2*4)
4990                         {
4991                                 if (type_of_tos() == T_cst)
4992                                 {
4993                                         i= pop_const (i_str);
4994                                         if (i >= n*8)
4995                                                 push_const(0);
4996                                         else
4997                                         {
4998                                                 if (i>= 4*8)
4999                                                 {
5000                                                         i -= 4*8;
5001                                                         pop_nop(1);
5002                                                         a= pop_reg();
5003                                                 }
5004                                                 else
5005                                                 {
5006                                                         a= pop_reg();
5007                                                         pop_nop(1);
5008                                                 }
5009                                                 b= alloc_reg();
5010                                                 c= alloc_reg();
5011 fprint ( codefile,
5012                                                 "srl    %s, %s, %s\n",a,i_str,b
5013 );
5014 fprint ( codefile,
5015                                                 "and    %s, 1, %s\n",b,c
5016 );
5017                                                 free_reg(a);
5018                                                 free_reg(b);
5019                                                 push_reg(c);
5020                                         }
5021                                 }
5022                                 else
5023                                 {
5024                                         a= pop_reg();
5025                                         flush_cache();
5026                                         b= alloc_reg();
5027                                         c= alloc_reg();
5028                                         d= alloc_reg();
5029                                         flush_cache();
5030 fprint ( codefile,
5031                                         "andn   %s, 31, %s\n",a,b
5032 );
5033 fprint ( codefile,
5034                                         "and    %s, 31, %s\n",a,c
5035 );
5036 fprint ( codefile,
5037                                         "srl    %s, 3, %s\n",b,d
5038 );
5039 fprint ( codefile,
5040                                         "ld     [%s+%s], %s\n",reg_sp,d,b
5041 );
5042 fprint ( codefile,
5043                                         "inc    %s, %s\n",n_str,reg_sp
5044 );
5045 fprint ( codefile,
5046                                         "srl    %s, %s, %s\n",b,c,d
5047 );
5048 fprint ( codefile,
5049                                         "and    %s, 1, %s\n",d,b
5050 );
5051                                         free_reg(a);
5052                                         push_reg(b);
5053                                         free_reg(c);
5054                                         free_reg(d);
5055                                 }
5056                         }
5057                         else if (n % 4)
5058                                 ;
5059                         else
5060                         {
5061                                 a= pop_reg();
5062                                 flush_cache();
5063                                 b= alloc_reg();
5064                                 c= alloc_reg();
5065                                 d= alloc_reg();
5066                                 flush_cache();
5067 fprint ( codefile,
5068                                 "andn   %s, 31, %s\n",a,b
5069 );
5070 fprint ( codefile,
5071                                 "and    %s, 31, %s\n",a,c
5072 );
5073 fprint ( codefile,
5074                                 "srl    %s, 3, %s\n",b,d
5075 );
5076 fprint ( codefile,
5077                                 "ld     [%s+%s], %s\n",reg_sp,d,b
5078 );
5079 fprint ( codefile,
5080                                 "inc    %s, %s\n",n_str,reg_sp
5081 );
5082 fprint ( codefile,
5083                                 "srl    %s, %s, %s\n",b,c,d
5084 );
5085 fprint ( codefile,
5086                                 "and    %s, 1, %s\n",d,b
5087 );
5088                                 free_reg(a);
5089                                 push_reg(b);
5090                                 free_reg(c);
5091                                 free_reg(d);
5092                         }
5093                 }
5094                 else
5095                         not_implemented ("inn_narg");
5096         })
5097 .
5098
5099 C_set   ==>
5100 code_combiner(  ;
5101                 push_const($1);
5102                 C_set_narg())
5103 .
5104
5105 C_set_narg      ==>
5106 code_combiner(
5107         {
5108                 reg_t a;
5109                 reg_t b;
5110                 reg_t c;
5111                 reg_t d;
5112                 int n;
5113                 const_str_t n_str;
5114
5115                 ;
5116
5117                 if (type_of_tos() == T_cst) {
5118                         n = pop_const(n_str);
5119                         if (n == 4) {
5120                                 b = alloc_reg();
5121                                 c = alloc_reg();
5122                                 a = pop_reg();
5123 fprint ( codefile,
5124                                 "set    1, %s\n",c
5125 );
5126 fprint ( codefile,
5127                                 "sll    %s, %s, %s\n",c,a,b
5128 );
5129                                 free_reg(a);
5130                                 free_reg(c);
5131                                 push_reg(b);
5132                         } else {
5133                                 a= alloc_reg();
5134                                 b= pop_reg();
5135                                 c= alloc_reg();
5136                                 d= alloc_reg();
5137                                 flush_cache();
5138                                 sprint(n_str, "%d", n);
5139 fprint ( codefile,
5140                                 "set    %s, %s\n",n_str,a
5141 );
5142 fprint ( codefile,
5143                                 "sub    %s, %s, %s\n",reg_sp,a,reg_sp
5144 );
5145 fprint ( codefile,
5146                         "1:\n"
5147 );
5148 fprint ( codefile,
5149                                 "deccc  4, %s\n",a
5150 );
5151 fprint ( codefile,
5152                                 "bnz    1b\n"
5153 );
5154 fprint ( codefile,
5155                                 "st     %%g0, [%s+%s]\n"        ,reg_sp,a
5156 );
5157 fprint ( codefile,
5158                                 "andn   %s, 31, %s\n",b,c
5159 );
5160 fprint ( codefile,
5161                                 "and    %s, 31, %s\n",b,d
5162 );
5163 fprint ( codefile,
5164                                 "srl    %s, 3, %s\n",c,c
5165 );
5166 fprint ( codefile,
5167                                 "set    1, %s\n",a
5168 );
5169 fprint ( codefile,
5170                                 "sll    %s, %s, %s\n",a,d,d
5171 );
5172 fprint ( codefile,
5173                                 "st     %s, [%s+%s]\n",d,reg_sp,c
5174 );
5175                                 free_reg(a);
5176                                 free_reg(b);
5177                                 free_reg(c);
5178                                 free_reg(d);
5179                         }
5180                 } else {
5181                         a= alloc_reg();
5182                         pop_reg_as(a);
5183                         b= pop_reg();
5184                         flush_cache();
5185                         c= alloc_reg();
5186                         d= alloc_reg();
5187 fprint ( codefile,
5188                         "sub    %s, %s, %s\n",reg_sp,a,reg_sp
5189 );
5190 fprint ( codefile,
5191                 "1:\n"
5192 );
5193 fprint ( codefile,
5194                         "deccc  4, %s\n",a
5195 );
5196 fprint ( codefile,
5197                         "bnz    1b\n"
5198 );
5199 fprint ( codefile,
5200                         "st     %%g0, [%s+%s]\n"        ,reg_sp,a
5201 );
5202 fprint ( codefile,
5203                         "andn   %s, 31, %s\n",b,c
5204 );
5205 fprint ( codefile,
5206                         "and    %s, 31, %s\n",b,d
5207 );
5208 fprint ( codefile,
5209                         "srl    %s, 3, %s\n",c,c
5210 );
5211 fprint ( codefile,
5212                         "set    1, %s\n",a
5213 );
5214 fprint ( codefile,
5215                         "sll    %s, %s, %s\n",a,d,d
5216 );
5217 fprint ( codefile,
5218                         "st     %s, [%s+%s]\n",d,reg_sp,c
5219 );
5220                         free_reg(a);
5221                         free_reg(b);
5222                         free_reg(c);
5223                         free_reg(d);
5224                 }
5225         })
5226 .
5227
5228
5229
5230
5231
5232
5233
5234
5235 C_lar
5236         ($1 == 4) ==>
5237 code_combiner(
5238                         ;
5239                         force_alloc_output();
5240                         pop_reg_as(reg_o0);
5241                         pop_reg_as(reg_o1);
5242                         pop_reg_as(reg_o2);
5243                         flush_cache();
5244 fprint ( codefile,
5245                         "call lar\n"
5246 );
5247 fprint ( codefile,
5248                         "nop\n"
5249 );
5250                         free_output())
5251 .
5252         default ==>
5253 code_combiner(
5254                         )
5255 .
5256
5257 C_lar_narg      ==>
5258 code_combiner(
5259         {
5260                 reg_t a;
5261                 int n;
5262                 
5263                 ;
5264                 if (type_of_tos() == T_cst)
5265                 {
5266                         n= pop_const(0);
5267                         C_lar (n);
5268                 }
5269                 else
5270                 {
5271                         a= pop_reg();
5272                         force_alloc_output();
5273 fprint ( codefile,
5274                         "cmp    %s, 4\n",a
5275 );
5276 fprint ( codefile,
5277                         "be     1f\n"
5278 );
5279 fprint ( codefile,
5280                         "set    EILLINS, %s\n",reg_o0
5281 );
5282 fprint ( codefile,
5283                         "call   trp\n"
5284 );
5285 fprint ( codefile,
5286                         "nop\n"
5287 );
5288 fprint ( codefile,
5289                 "1:\n"
5290 );
5291                         free_reg(a);
5292                         free_output();
5293                 C_lar (4);
5294                 }
5295         })
5296 .
5297
5298
5299
5300 C_sar
5301         ($1 == 4) ==>
5302 code_combiner(
5303                         ;
5304                         force_alloc_output();
5305                         pop_reg_as(reg_o0);
5306                         pop_reg_as(reg_o1);
5307                         pop_reg_as(reg_o2);
5308                         flush_cache();
5309 fprint ( codefile,
5310                         "call   sar\n"
5311 );
5312 fprint ( codefile,
5313                         "nop\n"
5314 );
5315                         free_output())
5316 .
5317         default ==>
5318 code_combiner(
5319                         )
5320 .
5321
5322 C_sar_narg      ==>
5323 code_combiner(
5324         {
5325                 reg_t a;
5326                 int n;
5327                 
5328                 ;
5329                 if (type_of_tos() == T_cst)
5330                 {
5331                         n= pop_const(0);
5332                         C_sar (n);
5333                 }
5334                 else
5335                 {
5336                         a= pop_reg();
5337                         force_alloc_output();
5338 fprint ( codefile,
5339                         "cmp    %s, 4\n",a
5340 );
5341 fprint ( codefile,
5342                         "be     1f\n"
5343 );
5344 fprint ( codefile,
5345                         "set    EILLINS, %s\n",reg_o0
5346 );
5347 fprint ( codefile,
5348                         "call   trp\n"
5349 );
5350 fprint ( codefile,
5351                         "nop\n"
5352 );
5353 fprint ( codefile,
5354                 "1:\n"
5355 );
5356                         free_reg(a);
5357                         free_output();
5358                 C_sar (4);
5359                 }
5360         })
5361 .
5362
5363
5364
5365 C_aar
5366         ($1 == 4) ==>
5367 code_combiner(
5368                         ;
5369                         force_alloc_output();
5370                         pop_reg_as(reg_o0);
5371                         pop_reg_as(reg_o1);
5372                         pop_reg_as(reg_o2);
5373                         flush_cache();
5374 fprint ( codefile,
5375                         "call   aar\n"
5376 );
5377 fprint ( codefile,
5378                         "nop\n"
5379 );
5380                         soft_alloc_reg(reg_o0);
5381                         free_output();
5382                         push_reg(reg_o0))
5383 .
5384         default ==>
5385 code_combiner(
5386                         )
5387 .
5388
5389 C_aar_narg      ==>
5390 code_combiner(
5391         {
5392                 reg_t a;
5393                 int n;
5394                 
5395                 ;
5396                 if (type_of_tos() == T_cst)
5397                 {
5398                         n= pop_const(0);
5399                         C_aar (n);
5400                 }
5401                 else
5402                 {
5403                         a= pop_reg();
5404                         force_alloc_output();
5405 fprint ( codefile,
5406                         "cmp    %s, 4\n",a
5407 );
5408 fprint ( codefile,
5409                         "be     1f\n"
5410 );
5411 fprint ( codefile,
5412                         "set    EILLINS, %s\n",reg_o0
5413 );
5414 fprint ( codefile,
5415                         "call   trp\n"
5416 );
5417 fprint ( codefile,
5418                         "nop\n"
5419 );
5420 fprint ( codefile,
5421                 "1:\n"
5422 );
5423                         free_reg(a);
5424                         free_output();
5425                 C_aar (4);
5426                 }
5427         })
5428 .
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438 C_cmi
5439         $1 == 4         ==>
5440 code_combiner(
5441         {
5442                 reg_t a;
5443                 reg_t b;
5444                 reg_t c;
5445                 const_str_t d;
5446
5447                 ;
5448
5449                 if (type_of_tos() == T_cst && ((top_const()) > -4096 && (top_const()) < 4096))
5450                 {
5451                         pop_const(d);
5452                         a= pop_reg();
5453                         b= alloc_reg();
5454 fprint ( codefile,
5455                         "cmp    %s, %s\n",a,d
5456 );
5457 fprint ( codefile,
5458                         "be,a   1f\n"
5459 );
5460 fprint ( codefile,
5461                         "mov    0, %s\n" ,b
5462 );
5463 fprint ( codefile,
5464                         "bg,a   1f\n"
5465 );
5466 fprint ( codefile,
5467                         "mov    1, %s\n" ,b
5468 );
5469 fprint ( codefile,
5470                         "mov    -1, %s\n",b
5471 );
5472 fprint ( codefile,
5473                 "1:\n"
5474 );
5475                         free_reg(a);
5476                         push_reg(b);
5477                 }
5478                 else
5479                 {
5480                         a= pop_reg();
5481                         b= 0;
5482                         c= alloc_reg();
5483                         if (type_of_tos() == T_cst)
5484                         {
5485                                 pop_const(d);
5486 fprint ( codefile,
5487                                 "cmp    %s, %s\n",a,d
5488 );
5489                         }
5490                         else
5491                         {
5492                                 b= pop_reg();
5493 fprint ( codefile,
5494                                 "cmp    %s, %s\n",a,b
5495 );
5496                         }
5497 fprint ( codefile,
5498                         "be,a   1f\n"
5499 );
5500 fprint ( codefile,
5501                         "mov    0, %s\n" ,c
5502 );
5503 fprint ( codefile,
5504                         "bg,a   1f\n"
5505 );
5506 fprint ( codefile,
5507                         "mov    -1, %s\n" ,c
5508 );
5509 fprint ( codefile,
5510                         "mov    1, %s\n",c
5511 );
5512 fprint ( codefile,
5513                 "1:\n"
5514 );
5515                         free_reg(a);
5516                         if (b)
5517                                 free_reg(b);
5518                         push_reg(c);
5519                 }
5520         })
5521 .
5522         default         ==>
5523 code_combiner(
5524                 )
5525 .
5526
5527 C_cmi_narg      ==>
5528 code_combiner(
5529         {
5530                 reg_t a;
5531                 int n;
5532                 
5533                 ;
5534                 if (type_of_tos() == T_cst)
5535                 {
5536                         n= pop_const(0);
5537                         C_cmi (n);
5538                 }
5539                 else
5540                 {
5541                         a= pop_reg();
5542                         force_alloc_output();
5543 fprint ( codefile,
5544                         "cmp    %s, 4\n",a
5545 );
5546 fprint ( codefile,
5547                         "be     1f\n"
5548 );
5549 fprint ( codefile,
5550                         "set    EILLINS, %s\n",reg_o0
5551 );
5552 fprint ( codefile,
5553                         "call   trp\n"
5554 );
5555 fprint ( codefile,
5556                         "nop\n"
5557 );
5558 fprint ( codefile,
5559                 "1:\n"
5560 );
5561                         free_reg(a);
5562                         free_output();
5563                 C_cmi (4);
5564                 }
5565         })
5566 .
5567
5568
5569
5570 C_cmu   ==>
5571 code_combiner(
5572                 ;
5573                 push_const($1);
5574                 C_cmu_narg())
5575 .
5576
5577 C_cmu_narg      ==>
5578 code_combiner(
5579         {
5580                 int n;
5581                 reg_t a;
5582                 reg_t b;
5583                 reg_t c;
5584                 const_str_t d;
5585
5586                 ;
5587                 if (type_of_tos() == T_cst)
5588                 {
5589                         n= pop_const(0);
5590                         if (n != 4)
5591                                 ;
5592                         else
5593                         {
5594                                 if (type_of_tos() == T_cst &&
5595                                         ((top_const()) > -4096 && (top_const()) < 4096))
5596                                 {
5597                                         pop_const(d);
5598                                         a= pop_reg();
5599                                         b= alloc_reg();
5600 fprint ( codefile,
5601                                         "cmp    %s, %s\n",a,d
5602 );
5603 fprint ( codefile,
5604                                         "be,a   1f\n"
5605 );
5606 fprint ( codefile,
5607                                         "mov    0, %s\n" ,b
5608 );
5609 fprint ( codefile,
5610                                         "bgu,a  1f\n"
5611 );
5612 fprint ( codefile,
5613                                         "mov    1, %s\n" ,b
5614 );
5615 fprint ( codefile,
5616                                         "mov    -1, %s\n",b
5617 );
5618 fprint ( codefile,
5619                                 "1:\n"
5620 );
5621                                         free_reg(a);
5622                                         push_reg(b);
5623                                 }
5624                                 else
5625                                 {
5626                                         a= pop_reg();
5627                                         b= 0;
5628                                         c= alloc_reg();
5629                                         if (type_of_tos() == T_cst &&
5630                                                 ((top_const()) > -4096 && (top_const()) < 4096))
5631                                         {
5632                                                 pop_const(d);
5633 fprint ( codefile,
5634                                                 "cmp    %s, %s\n",a,d
5635 );
5636                                         }
5637                                         else
5638                                         {
5639                                                 b= pop_reg();
5640 fprint ( codefile,
5641                                                 "cmp    %s, %s\n",a,b
5642 );
5643                                         }
5644 fprint ( codefile,
5645                                         "be,a   1f\n"
5646 );
5647 fprint ( codefile,
5648                                         "mov    0, %s\n" ,c
5649 );
5650 fprint ( codefile,
5651                                         "bgu,a  1f\n"
5652 );
5653 fprint ( codefile,
5654                                         "mov    -1, %s\n" ,c
5655 );
5656 fprint ( codefile,
5657                                         "mov    1, %s\n",c
5658 );
5659 fprint ( codefile,
5660                                 "1:\n"
5661 );
5662                                         free_reg(a);
5663                                         if (b)
5664                                                 free_reg(b);
5665                                         push_reg(c);
5666                                 }
5667                         }
5668                 }
5669                 else
5670                         not_implemented ("cmu_narg");
5671         })
5672 .
5673
5674 C_cms   ==>
5675 code_combiner(
5676                 ;
5677                 push_const($1);
5678                 C_cms_narg())
5679 .
5680
5681 C_cms_narg      ==>
5682 code_combiner(
5683         {
5684                 int n;
5685                 reg_t a;
5686                 reg_t b;
5687                 reg_t c;
5688                 reg_t d;
5689                 reg_t e;
5690                 const_str_t b_str;
5691                 const_str_t n_str;
5692
5693                 ;
5694                 if (type_of_tos() == T_cst && top_const() <= 4)
5695                 {
5696                         n= pop_const(n_str);
5697                         if (n == 4)
5698                         {
5699                                 b= 0;
5700                                 c= alloc_reg();
5701                                 if (type_of_tos() == T_cst &&
5702                                     ((top_const()) > -4096 && (top_const()) < 4096))
5703                                 {
5704                                         pop_const(b_str);
5705                                         a= pop_reg();
5706 fprint ( codefile,
5707                                         "cmp    %s, %s\n",a,b_str
5708 );
5709                                 }
5710                                 else
5711                                 {
5712                                         a= pop_reg();
5713                                         b= pop_reg();
5714 fprint ( codefile,
5715                                         "cmp    %s, %s\n",a,b
5716 );
5717                                 }
5718 fprint ( codefile,
5719                                 "be,a   1f\n"
5720 );
5721 fprint ( codefile,
5722                                 "mov    0, %s\n",c
5723 );
5724 fprint ( codefile,
5725                                 "mov    1, %s\n",c
5726 );
5727 fprint ( codefile,
5728                         "1:\n"
5729 );
5730                                 free_reg(a);
5731                                 if (b)
5732                                         free_reg(b);
5733                                 push_reg(c);
5734                         }
5735                         else if (n % 4)
5736                                 ;
5737                 }
5738                 else
5739                 {
5740                         a= pop_reg();
5741                         flush_cache();
5742                         b= alloc_reg();
5743                         c= alloc_reg();
5744                         d= alloc_reg();
5745
5746 fprint ( codefile,
5747                         "add    %s, %s, %s\n",reg_sp,a,b
5748 );
5749 fprint ( codefile,
5750                         "dec    4, %s\n",b
5751 );
5752 fprint ( codefile,
5753                 "1:\n"
5754 );
5755 fprint ( codefile,
5756                         "ld     [%s], %s\n",b,c
5757 );
5758 fprint ( codefile,
5759                         "ld     [%s+%s], %s\n",b,a,d
5760 );
5761 fprint ( codefile,
5762                         "cmp    %s, %s\n",d,c
5763 );
5764 fprint ( codefile,
5765                         "bne,a  2f\n"
5766 );
5767 fprint ( codefile,
5768                         "mov    1, %s\n"        ,b
5769 );
5770 fprint ( codefile,
5771                         "cmp    %s, %s\n",b,reg_sp
5772 );
5773 fprint ( codefile,
5774                         "bg     1b\n"
5775 );
5776 fprint ( codefile,
5777                         "dec    4, %s\n"        ,b
5778 );
5779 fprint ( codefile,
5780                         "mov    0, %s\n",b
5781 );
5782 fprint ( codefile,
5783                 "2:\n"
5784 );
5785 fprint ( codefile,
5786                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
5787 );
5788 fprint ( codefile,
5789                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
5790 );
5791
5792                         free_reg(a);
5793                         push_reg(b);
5794                         free_reg(c);
5795                         free_reg(d);
5796                 }
5797         })
5798 .
5799
5800 C_cmp           ==>
5801 code_combiner(
5802                         ;
5803                         C_cmu( (arith)4))
5804 .
5805
5806 C_tlt   ==>
5807 code_combiner(
5808                 ;
5809                 {
5810                         reg_t a;
5811                         reg_t b;
5812
5813                         a = pop_reg();
5814                         b= alloc_reg();
5815 fprint ( codefile,
5816                         "       tst     %s\n",a
5817 );
5818 fprint ( codefile,
5819                         "       bl,a    1f\n"
5820 );
5821 fprint ( codefile,
5822                         "       mov     1, %s\n"                ,b
5823 );
5824 fprint ( codefile,
5825                         "       set     0, %s\n",b
5826 );
5827 fprint ( codefile,
5828                         "1:\n"
5829 );
5830                         free_reg(a);
5831                         push_reg(b);
5832                 })
5833 .
5834
5835 C_tle   ==>
5836 code_combiner(
5837                 ;
5838                 {
5839                         reg_t a;
5840                         reg_t b;
5841
5842                         a = pop_reg();
5843                         b= alloc_reg();
5844 fprint ( codefile,
5845                         "tst    %s\n",a
5846 );
5847 fprint ( codefile,
5848                         "ble,a  1f\n"
5849 );
5850 fprint ( codefile,
5851                         "mov    1, %s\n"                ,b
5852 );
5853 fprint ( codefile,
5854                         "set    0, %s\n",b
5855 );
5856 fprint ( codefile,
5857                 "1:\n"
5858 );
5859                         free_reg(a);
5860                         push_reg(b);
5861                 })
5862 .
5863
5864 C_tge   ==>
5865 code_combiner(
5866                 ;
5867                 {
5868                         reg_t a;
5869                         reg_t b;
5870
5871                         a = pop_reg();
5872                         b = alloc_reg();
5873 fprint ( codefile,
5874                         "       tst     %s\n",a
5875 );
5876 fprint ( codefile,
5877                         "       bge,a   1f\n"
5878 );
5879 fprint ( codefile,
5880                         "       mov     1, %s\n"                ,b
5881 );
5882 fprint ( codefile,
5883                         "       set     0, %s\n",b
5884 );
5885 fprint ( codefile,
5886                         "1:\n"
5887 );
5888                         free_reg(a);
5889                         push_reg(b);
5890                 })
5891 .
5892
5893 C_tgt   ==>
5894 code_combiner(
5895                 ;
5896                 {
5897                         reg_t a;
5898                         reg_t b;
5899
5900                         a = pop_reg();
5901                         b = alloc_reg();
5902 fprint ( codefile,
5903                         "       tst     %s\n",a
5904 );
5905 fprint ( codefile,
5906                         "       bg,a    1f\n"
5907 );
5908 fprint ( codefile,
5909                         "       mov     1, %s\n"                ,b
5910 );
5911 fprint ( codefile,
5912                         "       set     0, %s\n",b
5913 );
5914 fprint ( codefile,
5915                         "1:\n"
5916 );
5917                         free_reg(a);
5918                         push_reg(b);
5919                 })
5920 .
5921
5922 C_tne   ==>
5923 code_combiner(
5924                 ;
5925                 {
5926                         reg_t a;
5927                         reg_t b;
5928
5929                         a = pop_reg();
5930                         b = alloc_reg();
5931 fprint ( codefile,
5932                         "       tst     %s\n",a
5933 );
5934 fprint ( codefile,
5935                         "       bne,a   1f\n"
5936 );
5937 fprint ( codefile,
5938                         "       mov     1, %s\n"                ,b
5939 );
5940 fprint ( codefile,
5941                         "       set     0, %s\n"                ,b
5942 );
5943 fprint ( codefile,
5944                         "1:\n"
5945 );
5946                         free_reg(a);
5947                         push_reg(b);
5948                 })
5949 .
5950
5951 C_teq   ==>
5952 code_combiner(
5953                 ;
5954                 {
5955                         reg_t a;
5956                         reg_t b;
5957
5958                         a = pop_reg();
5959                         b = alloc_reg();
5960 fprint ( codefile,
5961                         "       tst     %s\n",a
5962 );
5963 fprint ( codefile,
5964                         "       be,a    1f\n"
5965 );
5966 fprint ( codefile,
5967                         "       mov     1, %s\n"                ,b
5968 );
5969 fprint ( codefile,
5970                         "       set     0, %s\n",b
5971 );
5972 fprint ( codefile,
5973                         "1:\n"
5974 );
5975                         free_reg(a);
5976                         push_reg(b);
5977                 })
5978 .
5979 C_cmf           ==>
5980 code_combiner(
5981         ;
5982         push_const($1);
5983         C_cmf_narg())
5984 .
5985
5986 C_cmf_narg      ==>
5987 code_combiner(
5988         {
5989                 reg_t a;
5990                 reg_t b;
5991                 reg_t c;
5992                 int n;
5993
5994                 ;
5995                 if (type_of_tos() == T_cst)
5996                 {
5997                         n= pop_const(0);
5998                         if (n == 4)
5999                         {
6000                                 a= pop_float();
6001                                 b= pop_float();
6002                                 c= alloc_reg();
6003 fprint ( codefile,
6004                                 "fcmpes %s, %s\n",b,a
6005 );
6006 fprint ( codefile,
6007                                 "nop\n"
6008 );
6009 fprint ( codefile,
6010                                 "fbe,a  1f\n"
6011 );
6012 fprint ( codefile,
6013                                 "mov    0, %s\n",c
6014 );
6015 fprint ( codefile,
6016                                 "fbl,a  1f\n"
6017 );
6018 fprint ( codefile,
6019                                 "mov    -1, %s\n",c
6020 );
6021 fprint ( codefile,
6022                                 "mov    1, %s\n",c
6023 );
6024 fprint ( codefile,
6025                         "1:\n"
6026 );
6027                                 free_reg(a);
6028                                 free_reg(b);
6029                                 push_reg(c);
6030                         }
6031                         else if (n == 8)
6032                         {
6033                                 a= pop_double(0);
6034                                 b= pop_double(0);
6035                                 c= alloc_reg();
6036 fprint ( codefile,
6037                                 "fcmped %s, %s\n",b,a
6038 );
6039 fprint ( codefile,
6040                                 "nop\n"
6041 );
6042 fprint ( codefile,
6043                                 "fbe,a  1f\n"
6044 );
6045 fprint ( codefile,
6046                                 "mov    0, %s\n",c
6047 );
6048 fprint ( codefile,
6049                                 "fbl,a  1f\n"
6050 );
6051 fprint ( codefile,
6052                                 "mov    -1, %s\n",c
6053 );
6054 fprint ( codefile,
6055                                 "mov    1, %s\n",c
6056 );
6057 fprint ( codefile,
6058                         "1:\n"
6059 );
6060                                 free_double_reg(a);
6061                                 free_double_reg(b);
6062                                 push_reg(c);
6063                         }
6064                         else
6065                                 ;
6066                 }
6067                 else
6068                         not_implemented ("cmf_narg");
6069         })
6070 .
6071
6072
6073
6074
6075
6076
6077
6078 C_bra           ==>
6079 code_combiner(
6080                         ;
6081                         {
6082                                 char *lbl;
6083
6084                                 flush_cache();
6085                                 lbl = $1;
6086 fprint ( codefile,
6087                                 "b      %s\n",lbl
6088 );
6089 fprint ( codefile,
6090                                 "nop\n"         
6091 );
6092                         })
6093 .
6094
6095 C_bge   ==>
6096 code_combiner(
6097                 ;
6098                 {
6099                         char *lbl = $1;
6100                         reg_t a;
6101                         reg_t b;
6102                         const_str_t n_str;
6103
6104                         a= 0;
6105                         if (type_of_tos() == T_cst &&
6106                                 ((top_const()) > -4096 && (top_const()) < 4096))
6107                                 pop_const(n_str);
6108                         else
6109                                 a = pop_reg();
6110                         b = pop_reg();
6111                         flush_cache();
6112                         if (a)
6113 fprint ( codefile,
6114                                 "cmp    %s, %s\n",b,a
6115 );
6116                         else
6117 fprint ( codefile,
6118                                 "cmp    %s, %s\n",b,n_str
6119 );
6120 fprint ( codefile,
6121                         "bge    %s\n",lbl
6122 );
6123 fprint ( codefile,
6124                         "nop\n"         
6125 );
6126                         free_reg(a);
6127                         free_reg(b);
6128                 })
6129 .
6130
6131 C_bne   ==>
6132 code_combiner(
6133                 ;
6134                 {
6135                         char *lbl = $1;
6136                         reg_t a;
6137                         reg_t b;
6138                         const_str_t n_str;
6139
6140                         a= 0;
6141                         if (type_of_tos() == T_cst &&
6142                                 ((top_const()) > -4096 && (top_const()) < 4096))
6143                                 pop_const(n_str);
6144                         else
6145                                 a = pop_reg();
6146                         b = pop_reg();
6147                         flush_cache();
6148                         if (a)
6149 fprint ( codefile,
6150                                 "cmp    %s, %s\n",b,a
6151 );
6152                         else
6153 fprint ( codefile,
6154                                 "cmp    %s, %s\n",b,n_str
6155 );
6156 fprint ( codefile,
6157                         "bne    %s\n",lbl
6158 );
6159 fprint ( codefile,
6160                         "nop\n"         
6161 );
6162                         free_reg(a);
6163                         free_reg(b);
6164                 })
6165 .
6166
6167 C_beq   ==>
6168 code_combiner(
6169                 ;
6170                 {
6171                         char *lbl = $1;
6172                         reg_t a;
6173                         reg_t b;
6174                         const_str_t n_str;
6175
6176                         a= 0;
6177                         if (type_of_tos() == T_cst &&
6178                                 ((top_const()) > -4096 && (top_const()) < 4096))
6179                                 pop_const(n_str);
6180                         else
6181                                 a = pop_reg();
6182                         b = pop_reg();
6183                         flush_cache();
6184                         if (a)
6185 fprint ( codefile,
6186                                 "cmp    %s, %s\n",b,a
6187 );
6188                         else
6189 fprint ( codefile,
6190                                 "cmp    %s, %s\n",b,n_str
6191 );
6192 fprint ( codefile,
6193                         "beq    %s\n",lbl
6194 );
6195 fprint ( codefile,
6196                         "nop\n"         
6197 );
6198                         free_reg(a);
6199                         free_reg(b);
6200                 })
6201 .
6202
6203 C_ble   ==>
6204 code_combiner(
6205                 ;
6206                 {
6207                         char *lbl = $1;
6208                         reg_t a;
6209                         reg_t b;
6210                         const_str_t n_str;
6211
6212                         a= 0;
6213                         if (type_of_tos() == T_cst &&
6214                                 ((top_const()) > -4096 && (top_const()) < 4096))
6215                                 pop_const(n_str);
6216                         else
6217                                 a = pop_reg();
6218                         b = pop_reg();
6219                         flush_cache();
6220                         if (a)
6221 fprint ( codefile,
6222                                 "cmp    %s, %s\n",b,a
6223 );
6224                         else
6225 fprint ( codefile,
6226                                 "cmp    %s, %s\n",b,n_str
6227 );
6228 fprint ( codefile,
6229                         "ble    %s\n",lbl
6230 );
6231 fprint ( codefile,
6232                         "nop\n"         
6233 );
6234                         free_reg(a);
6235                         free_reg(b);
6236                 })
6237 .
6238
6239 C_blt   ==>
6240 code_combiner(
6241                 ;
6242                 {
6243                         char *lbl = $1;
6244                         reg_t a;
6245                         reg_t b;
6246                         const_str_t n_str;
6247
6248                         a= 0;
6249                         if (type_of_tos() == T_cst &&
6250                                 ((top_const()) > -4096 && (top_const()) < 4096))
6251                                 pop_const(n_str);
6252                         else
6253                                 a = pop_reg();
6254                         b = pop_reg();
6255                         flush_cache();
6256                         if (a)
6257 fprint ( codefile,
6258                                 "cmp    %s, %s\n",b,a
6259 );
6260                         else
6261 fprint ( codefile,
6262                                 "cmp    %s, %s\n",b,n_str
6263 );
6264 fprint ( codefile,
6265                         "bl     %s\n",lbl
6266 );
6267 fprint ( codefile,
6268                         "nop\n"         
6269 );
6270                         free_reg(a);
6271                         free_reg(b);
6272                 })
6273 .
6274
6275 C_bgt   ==>
6276 code_combiner(
6277                 ;
6278                 {
6279                         char *lbl = $1;
6280                         reg_t a;
6281                         reg_t b;
6282                         const_str_t n_str;
6283
6284                         a= 0;
6285                         if (type_of_tos() == T_cst &&
6286                                 ((top_const()) > -4096 && (top_const()) < 4096))
6287                                 pop_const(n_str);
6288                         else
6289                                 a = pop_reg();
6290                         b = pop_reg();
6291                         flush_cache();
6292                         if (a)
6293 fprint ( codefile,
6294                                 "cmp    %s, %s\n",b,a
6295 );
6296                         else
6297 fprint ( codefile,
6298                                 "cmp    %s, %s\n",b,n_str
6299 );
6300 fprint ( codefile,
6301                         "bg     %s\n",lbl
6302 );
6303 fprint ( codefile,
6304                         "nop\n"         
6305 );
6306                         free_reg(a);
6307                         free_reg(b);
6308                 })
6309 .
6310
6311 C_zlt   ==>
6312 code_combiner(
6313                 ;
6314                 {
6315                         char *lbl = $1;
6316                         reg_t a;
6317
6318                         a = pop_reg();
6319                         flush_cache();
6320 fprint ( codefile,
6321                         "tst    %s\n",a
6322 );
6323 fprint ( codefile,
6324                         "bl     %s\n",lbl
6325 );
6326 fprint ( codefile,
6327                         "nop\n"         
6328 );
6329                         free_reg(a);
6330                 }
6331                 )
6332 .
6333
6334 C_zle   ==>
6335 code_combiner(
6336                 ;
6337                 {
6338                         char *lbl = $1;
6339                         reg_t a;
6340
6341                         a = pop_reg();
6342                         flush_cache();
6343 fprint ( codefile,
6344                         "tst    %s\n",a
6345 );
6346 fprint ( codefile,
6347                         "ble    %s\n",lbl
6348 );
6349 fprint ( codefile,
6350                         "nop\n"         
6351 );
6352                         free_reg(a);
6353                 }
6354                 )
6355 .
6356
6357 C_zeq   ==>
6358 code_combiner(
6359                 ;
6360                 {
6361                         char *lbl = $1;
6362                         reg_t a;
6363
6364                         a = pop_reg();
6365                         flush_cache();
6366 fprint ( codefile,
6367                         "tst    %s\n",a
6368 );
6369 fprint ( codefile,
6370                         "be     %s\n",lbl
6371 );
6372 fprint ( codefile,
6373                         "nop\n"         
6374 );
6375                         free_reg(a);
6376                 }
6377                 )
6378 .
6379
6380 C_zne   ==>
6381 code_combiner(
6382                 ;
6383                 {
6384                         char *lbl = $1;
6385                         reg_t a;
6386
6387                         a = pop_reg();
6388                         flush_cache();
6389 fprint ( codefile,
6390                         "tst    %s\n",a
6391 );
6392 fprint ( codefile,
6393                         "bne    %s\n",lbl
6394 );
6395 fprint ( codefile,
6396                         "nop\n"         
6397 );
6398                         free_reg(a);
6399                 }
6400                 )
6401 .
6402
6403 C_zge   ==>
6404 code_combiner(
6405                 ;
6406                 {
6407                         char *lbl = $1;
6408                         reg_t a;
6409
6410                         a = pop_reg();
6411                         flush_cache();
6412 fprint ( codefile,
6413                         "tst    %s\n",a
6414 );
6415 fprint ( codefile,
6416                         "bge    %s\n",lbl
6417 );
6418 fprint ( codefile,
6419                         "nop\n"         
6420 );
6421                         free_reg(a);
6422                 }
6423                 )
6424 .
6425
6426 C_zgt   ==>
6427 code_combiner(
6428                 ;
6429                 {
6430                         char *lbl = $1;
6431                         reg_t a;
6432
6433                         a = pop_reg();
6434                         flush_cache();
6435 fprint ( codefile,
6436                         "tst    %s\n",a
6437 );
6438 fprint ( codefile,
6439                         "bg     %s\n",lbl
6440 );
6441 fprint ( codefile,
6442                         "nop\n"         
6443 );
6444                         free_reg(a);
6445                 }
6446                 )
6447 .
6448
6449
6450
6451
6452
6453
6454 C_cai           ==>
6455 code_combiner(
6456                         ;
6457                         {
6458                                 reg_t a;
6459
6460                                 a= pop_reg();
6461                                 flush_cache();
6462 fprint ( codefile,
6463                                 "call   %s\n",a
6464 );
6465 fprint ( codefile,
6466                                 "nop\n"         
6467 );
6468                                 free_reg(a);
6469                         })
6470 .
6471
6472 C_cal           ==>
6473 code_combiner(
6474                         ;
6475                         {
6476                                 char *lbl = $1;
6477                                 flush_cache();
6478 fprint ( codefile,
6479                                 "call   %s\n",lbl
6480 );
6481 fprint ( codefile,
6482                                 "nop\n"         
6483 );
6484                         })
6485 .
6486
6487 C_lfr
6488         $1 == 4         ==>
6489 code_combiner(
6490         {
6491                 ;
6492                 forced_alloc_reg(reg_o0);
6493                 push_reg(reg_o0);
6494         })
6495 .
6496         $1 == 8         ==>
6497 code_combiner(
6498         {
6499                 ;
6500                 forced_alloc_reg(reg_o0);
6501                 forced_alloc_reg(reg_o1);
6502                 push_reg(reg_o1);
6503                 push_reg(reg_o0);
6504         })
6505 .
6506         default         ==>
6507 code_combiner(
6508                 )
6509 .
6510
6511 C_ret
6512         $1 == 0         ==>
6513 code_combiner(
6514         {
6515                 ;
6516                 load_float_regs();
6517                 if (debug)
6518                         free_all_reg_vars();
6519 fprint ( codefile,
6520                 "restore\n"
6521 );
6522 fprint ( codefile,
6523                 "retl\n"
6524 );
6525 fprint ( codefile,
6526                 "add    %%sp, %s, %%sp\n",reg_gap
6527 );
6528                 if (debug)
6529                         alloc_all_reg_vars();
6530         })
6531 .
6532         $1 == 4         ==>
6533 code_combiner(
6534         {
6535                 ;
6536                 soft_alloc_reg(reg_i0);
6537                 pop_reg_as(reg_i0);
6538                 free_reg(reg_i0);
6539                 load_float_regs();
6540                 if (debug)
6541                         free_all_reg_vars();
6542 fprint ( codefile,
6543                 "restore\n"
6544 );
6545 fprint ( codefile,
6546                 "retl\n"
6547 );
6548 fprint ( codefile,
6549                 "add    %%sp, %s, %%sp\n",reg_gap
6550 );
6551                 if (debug)
6552                         alloc_all_reg_vars();
6553         })
6554 .
6555         $1 == 8         ==>
6556 code_combiner(
6557         {
6558                 ;
6559                 soft_alloc_reg(reg_i0);
6560                 soft_alloc_reg(reg_i1);
6561                 pop_reg_as(reg_i0);
6562                 pop_reg_as(reg_i1);
6563                 free_reg(reg_i0);
6564                 free_reg(reg_i1);
6565                 load_float_regs();
6566                 if (debug)
6567                         free_all_reg_vars();
6568 fprint ( codefile,
6569                 "restore\n"
6570 );
6571 fprint ( codefile,
6572                 "retl\n"
6573 );
6574 fprint ( codefile,
6575                 "add    %%sp, %s, %%sp\n",reg_gap
6576 );
6577                 if (debug)
6578                         alloc_all_reg_vars();
6579         })
6580 .
6581         default         ==>
6582 code_combiner(
6583                                 )
6584 .
6585
6586
6587
6588
6589
6590
6591
6592 C_asp           ==>
6593 code_combiner(
6594         ;
6595         push_const($1);
6596         C_ass(4))
6597 .
6598
6599
6600 C_ass
6601         $1 == 4         ==>
6602 code_combiner(
6603         {
6604                 int n;
6605                 const_str_t n_str;
6606                 reg_t a;
6607
6608                 if (type_of_tos() == T_cst)
6609                 {
6610                         n= pop_const(n_str);
6611                         if (n % 4)
6612                                 ;
6613                         else
6614                                 if (n>=0)
6615                                         pop_nop (n/4);
6616                                 else
6617                                 {
6618                                         flush_cache();
6619                                         if (((n) > -4096 && (n) < 4096))
6620 fprint ( codefile,
6621                                                 "inc    %s, %s\n",n_str,reg_sp
6622 );
6623                                         else
6624                                         {
6625                                                 a= alloc_reg();
6626 fprint ( codefile,
6627                                                 "set    %s, %s\n",n_str,a
6628 );
6629 fprint ( codefile,
6630                                                 "add    %s, %s, %s\n",reg_sp,a,reg_sp
6631 );
6632                                                 free_reg(a);
6633                                         }
6634                                 }
6635                 }
6636                 else
6637                 {
6638                         a= pop_reg();
6639                         flush_cache();
6640 fprint ( codefile,
6641                         "add    %s, %s, %s\n",reg_sp,a,reg_sp
6642 );
6643                         free_reg(a);
6644                 }
6645         })
6646 .
6647         default         ==>
6648 code_combiner(
6649                                 )
6650 .
6651
6652
6653 C_ass_narg      ==>
6654 code_combiner(
6655         {
6656                 reg_t a;
6657                 int n;
6658                 
6659                 ;
6660                 if (type_of_tos() == T_cst)
6661                 {
6662                         n= pop_const(0);
6663                         C_ass (n);
6664                 }
6665                 else
6666                 {
6667                         a= pop_reg();
6668                         force_alloc_output();
6669 fprint ( codefile,
6670                         "cmp    %s, 4\n",a
6671 );
6672 fprint ( codefile,
6673                         "be     1f\n"
6674 );
6675 fprint ( codefile,
6676                         "set    EILLINS, %s\n",reg_o0
6677 );
6678 fprint ( codefile,
6679                         "call   trp\n"
6680 );
6681 fprint ( codefile,
6682                         "nop\n"
6683 );
6684 fprint ( codefile,
6685                 "1:\n"
6686 );
6687                         free_reg(a);
6688                         free_output();
6689                 C_ass (4);
6690                 }
6691         })
6692 .
6693
6694
6695
6696 C_blm           ==>
6697 code_combiner(
6698         ;
6699         push_const($1);
6700         C_bls (4))
6701 .
6702
6703 C_bls
6704         $1 == 4 ==>
6705 code_combiner(
6706         {
6707                 reg_t a;
6708                 reg_t b;
6709                 reg_t c;
6710                 reg_t d;
6711                 reg_t e;
6712                 reg_t ao_reg;
6713                 reg_t bo_reg;
6714                 int n;
6715                 int i;
6716                 const_str_t n_str;
6717                 const_str_t ac_str;
6718                 const_str_t bc_str;
6719                 
6720                 ;
6721                 if (type_of_tos() == T_cst)
6722                 {
6723                         n= pop_const(n_str);
6724                         if (n % 4)
6725                                 ;
6726                         else if (n <= 16)
6727                         {
6728                                 c= alloc_reg();
6729                                 for (i=0; i<n; i += 4)
6730                                 {
6731                                         if (type_of_tos() & T_reg2) 
6732                                                 a= pop_reg_reg (&ao_reg);
6733                                         else
6734                                         {
6735                                                 ao_reg= 0;
6736                                                 a= pop_reg_c13(ac_str);
6737                                         }
6738                                         if (type_of_tos() & T_reg2) 
6739                                                 b= pop_reg_reg (&bo_reg);
6740                                         else
6741                                         {
6742                                                 bo_reg= 0;
6743                                                 b= pop_reg_c13(bc_str);
6744                                         }
6745                                         if (bo_reg)
6746 fprint ( codefile,
6747                                                 "ld     [%s+%s], %s\n",b,bo_reg,c
6748 );
6749                                         else
6750 fprint ( codefile,
6751                                                 "ld     [%s+%s], %s\n",b,bc_str,c
6752 );
6753                                         if (ao_reg)
6754 fprint ( codefile,
6755                                                 "st     %s, [%s+%s]\n",c,a,ao_reg
6756 );
6757                                         else
6758 fprint ( codefile,
6759                                                 "st     %s, [%s+%s]\n",c,a,ac_str
6760 );
6761                                         if (bo_reg)
6762                                         {
6763                                                 push_reg(b);
6764                                                 inc_tos_reg(bo_reg);
6765                                         }
6766                                         else if (bc_str[0] == '-' ||
6767                                                 isdigit(bc_str[0]))
6768                                         {
6769                                                 push_reg(b);
6770                                                 inc_tos(atoi(bc_str));
6771                                         }
6772                                         else
6773                                         {
6774 fprint ( codefile,
6775                                                 "add    %s, %s, %s\n",b,bc_str,c
6776 );
6777                                                 push_reg(c);
6778                                                 free_reg(b);
6779                                                 c= alloc_reg();
6780                                         }
6781                                         inc_tos(4);
6782                                         if (ao_reg)
6783                                         {
6784                                                 push_reg(a);
6785                                                 inc_tos_reg(ao_reg);
6786                                         }
6787                                         else if (ac_str[0] == '-' ||
6788                                                 isdigit(ac_str[0]))
6789                                         {
6790                                                 push_reg(a);
6791                                                 inc_tos(atoi(ac_str));
6792                                         }
6793                                         else
6794                                         {
6795 fprint ( codefile,
6796                                                 "add    %s, %s, %s\n",a,ac_str,c
6797 );
6798                                                 push_reg(c);
6799                                                 free_reg(a);
6800                                                 c= alloc_reg();
6801                                         }
6802                                         inc_tos(4);
6803                                 }
6804                                 pop_nop(2);
6805                                 free_reg(c);
6806                         }
6807                         else
6808                         {
6809                                 a= pop_reg();   
6810                                 b= pop_reg();   
6811                                 c= alloc_reg();
6812                                 d= alloc_reg();
6813                                 e = alloc_reg();
6814 fprint ( codefile,
6815                                 "set    %s-4, %s\n",n_str,c
6816 );
6817 fprint ( codefile,
6818                                 "set    -4, %s\n",e
6819 );
6820 fprint ( codefile,
6821                         "1:\n"
6822 );
6823 fprint ( codefile,
6824                                 "inc    4, %s\n",e
6825 );
6826 fprint ( codefile,
6827                                 "ld     [%s+%s], %s\n",b,e,d
6828 );
6829 fprint ( codefile,
6830                                 "cmp    %s,%s\n",e,c
6831 );
6832 fprint ( codefile,
6833                                 "bnz    1b\n"
6834 );
6835 fprint ( codefile,
6836                                 "st     %s, [%s+%s]\n",d,a,e
6837 );
6838                                 free_reg(a);
6839                                 free_reg(b);
6840                                 free_reg(c);
6841                                 free_reg(d);
6842                                 free_reg(e);
6843                         }
6844                 }
6845                 else
6846                 {
6847
6848                         c= alloc_reg(); 
6849                         pop_reg_as(c);
6850                         a= pop_reg();   
6851                         b= pop_reg();   
6852                         d= alloc_reg();
6853                         e= alloc_reg();
6854 fprint ( codefile,
6855                         "ba     2f\n"
6856 );
6857 fprint ( codefile,
6858                         "clr    %s\n",e
6859 );
6860 fprint ( codefile,
6861                 "1:\n"
6862 );
6863 fprint ( codefile,
6864                         "st     %s, [%s+%s]\n",d,a,e
6865 );
6866 fprint ( codefile,
6867                         "inc    4, %s\n",e
6868 );
6869 fprint ( codefile,
6870                 "2:\n"
6871 );
6872 fprint ( codefile,
6873                         "cmp    %s, %s\n",e,c
6874 );
6875 fprint ( codefile,
6876                         "bnz    1b\n"
6877 );
6878 fprint ( codefile,
6879                         "ld     [%s+%s], %s\n",b,e,d
6880 );
6881                         free_reg(a);
6882                         free_reg(b);
6883                         free_reg(c);
6884                         free_reg(d);
6885                         free_reg(e);
6886                 }
6887         })
6888 .
6889
6890         default         ==>
6891 code_combiner(
6892                                 )
6893 .
6894
6895 C_bls_narg      ==>
6896 code_combiner(
6897         {
6898                 reg_t a;
6899                 int n;
6900                 
6901                 ;
6902                 if (type_of_tos() == T_cst)
6903                 {
6904                         n= pop_const(0);
6905                         C_bls (n);
6906                 }
6907                 else
6908                 {
6909                         a= pop_reg();
6910                         force_alloc_output();
6911 fprint ( codefile,
6912                         "cmp    %s, 4\n",a
6913 );
6914 fprint ( codefile,
6915                         "be     1f\n"
6916 );
6917 fprint ( codefile,
6918                         "set    EILLINS, %s\n",reg_o0
6919 );
6920 fprint ( codefile,
6921                         "call   trp\n"
6922 );
6923 fprint ( codefile,
6924                         "nop\n"
6925 );
6926 fprint ( codefile,
6927                 "1:\n"
6928 );
6929                         free_reg(a);
6930                         free_output();
6931                 C_bls (4);
6932                 }
6933         })
6934 .
6935
6936
6937
6938 C_csa
6939         $1 == 4 ==>
6940 code_combiner(
6941                 ;
6942                 {
6943                         force_alloc_output();
6944                         pop_reg_as(reg_o0);
6945                         pop_reg_as(reg_o1);
6946                         flush_cache();
6947                         free_output();
6948 fprint ( codefile,
6949                         "set    csa, %s\n",reg_tmp
6950 );
6951 fprint ( codefile,
6952                         "jmp    %s\n",reg_tmp
6953 );
6954 fprint ( codefile,
6955                         "nop\n"
6956 );
6957                 })
6958 .
6959         default ==>
6960 code_combiner(
6961                 )
6962 .
6963
6964 C_csa_narg      ==>
6965 code_combiner(
6966         {
6967                 reg_t a;
6968                 int n;
6969                 
6970                 ;
6971                 if (type_of_tos() == T_cst)
6972                 {
6973                         n= pop_const(0);
6974                         C_csa (n);
6975                 }
6976                 else
6977                 {
6978                         a= pop_reg();
6979                         force_alloc_output();
6980 fprint ( codefile,
6981                         "cmp    %s, 4\n",a
6982 );
6983 fprint ( codefile,
6984                         "be     1f\n"
6985 );
6986 fprint ( codefile,
6987                         "set    EILLINS, %s\n",reg_o0
6988 );
6989 fprint ( codefile,
6990                         "call   trp\n"
6991 );
6992 fprint ( codefile,
6993                         "nop\n"
6994 );
6995 fprint ( codefile,
6996                 "1:\n"
6997 );
6998                         free_reg(a);
6999                         free_output();
7000                 C_csa (4);
7001                 }
7002         })
7003 .
7004
7005
7006
7007 C_csb
7008         $1 == 4         ==>
7009 code_combiner(
7010                         ;
7011                         {
7012                                 force_alloc_output();
7013                                 pop_reg_as(reg_o0);
7014                                 pop_reg_as(reg_o1);
7015                                 flush_cache();
7016                                 free_output();
7017 fprint ( codefile,
7018                                 "set    csb, %s\n",reg_tmp
7019 );
7020 fprint ( codefile,
7021                                 "jmp    %s\n",reg_tmp
7022 );
7023 fprint ( codefile,
7024                                 "nop\n"
7025 );
7026                         })
7027 .
7028         default         ==>
7029 code_combiner(
7030                                 )
7031 .
7032
7033 C_csb_narg      ==>
7034 code_combiner(
7035         {
7036                 reg_t a;
7037                 int n;
7038                 
7039                 ;
7040                 if (type_of_tos() == T_cst)
7041                 {
7042                         n= pop_const(0);
7043                         C_csb (n);
7044                 }
7045                 else
7046                 {
7047                         a= pop_reg();
7048                         force_alloc_output();
7049 fprint ( codefile,
7050                         "cmp    %s, 4\n",a
7051 );
7052 fprint ( codefile,
7053                         "be     1f\n"
7054 );
7055 fprint ( codefile,
7056                         "set    EILLINS, %s\n",reg_o0
7057 );
7058 fprint ( codefile,
7059                         "call   trp\n"
7060 );
7061 fprint ( codefile,
7062                         "nop\n"
7063 );
7064 fprint ( codefile,
7065                 "1:\n"
7066 );
7067                         free_reg(a);
7068                         free_output();
7069                 C_csb (4);
7070                 }
7071         })
7072 .
7073
7074
7075
7076 C_dch           ==>
7077 code_combiner(
7078         {
7079                 reg_t a;
7080                 reg_t b;
7081                 reg_t c;
7082
7083                 ;
7084                 a= pop_reg();           
7085                 b= alloc_reg();
7086                 c= alloc_reg();
7087 fprint ( codefile,
7088                 "ta     3\n"            
7089 );
7090 fprint ( codefile,
7091                 "add    %s, 7, %s\n",a,b
7092 );
7093 fprint ( codefile,
7094                 "andn   %s, 7, %s\n"    ,b,c
7095 );
7096 fprint ( codefile,
7097                 "ld     [%s+4], %s\n"   ,c,b
7098 );
7099                 free_reg(a);
7100                 push_reg(b);
7101                 free_reg(c);
7102         })
7103 .
7104
7105 C_dup   ==>
7106 code_combiner(
7107                 ;
7108                 push_const($1);
7109                 C_dus(4))
7110 .
7111
7112 C_dus
7113         $1 == 4 ==>
7114 code_combiner(
7115         {
7116                 int n;
7117                 int i;
7118                 const_str_t n_str;
7119                 const_str_t i_str;
7120                 reg_t a;
7121                 reg_t b;
7122                 reg_t c;
7123
7124                 ;
7125
7126                 if (type_of_tos() == T_cst && top_const() <= 16)
7127                 {
7128                         n= pop_const(n_str);
7129                         if (n == 4 || n == 8 || n<=32)
7130                                 dup_tos(n/4);
7131                         else if (n<0 || n % 4)
7132                                 ;
7133                         else
7134                         {
7135                                 flush_cache();
7136                                 a= alloc_reg();
7137 fprint ( codefile,
7138                                 "sub    %s, %s, %s\n",reg_sp,n_str,reg_sp
7139 );
7140                                 for (i=0; i<n; i += 4)
7141                                 {
7142                                         sprint(i_str, "%d", i);
7143 fprint ( codefile,
7144                                         "ld     [%s+%s+%s], %s\n",reg_sp,i_str,n_str,a
7145 );
7146 fprint ( codefile,
7147                                         "st     %s, [%s+%s]\n",a,reg_sp,i_str
7148 );
7149                                 }
7150                                 free_reg(a);
7151                         }
7152                 }
7153                 else
7154                 {
7155                         a= pop_reg();
7156                         flush_cache();
7157                         b= alloc_reg();
7158                         c= alloc_reg();
7159 fprint ( codefile,
7160                         "mov    %s, %s\n",a,b
7161 );
7162 fprint ( codefile,
7163                 "1:\n"
7164 );
7165 fprint ( codefile,
7166                         "dec    4, %s\n",reg_sp
7167 );
7168 fprint ( codefile,
7169                         "ld     [%s+ %s], %s\n",reg_sp,a,c
7170 );
7171 fprint ( codefile,
7172                         "deccc  4, %s\n",b
7173 );
7174 fprint ( codefile,
7175                         "bne    1b\n"
7176 );
7177 fprint ( codefile,
7178                         "st     %s, [%s+ %s]\n" ,c,reg_sp,a
7179 );
7180                         free_reg(a);
7181                         free_reg(b);
7182                         free_reg(c);
7183                 }
7184         })
7185 .
7186         default         ==>
7187 code_combiner(
7188                                 )
7189 .
7190
7191 C_dus_narg      ==>
7192 code_combiner(
7193         {
7194                 reg_t a;
7195                 int n;
7196                 
7197                 ;
7198                 if (type_of_tos() == T_cst)
7199                 {
7200                         n= pop_const(0);
7201                         C_dus (n);
7202                 }
7203                 else
7204                 {
7205                         a= pop_reg();
7206                         force_alloc_output();
7207 fprint ( codefile,
7208                         "cmp    %s, 4\n",a
7209 );
7210 fprint ( codefile,
7211                         "be     1f\n"
7212 );
7213 fprint ( codefile,
7214                         "set    EILLINS, %s\n",reg_o0
7215 );
7216 fprint ( codefile,
7217                         "call   trp\n"
7218 );
7219 fprint ( codefile,
7220                         "nop\n"
7221 );
7222 fprint ( codefile,
7223                 "1:\n"
7224 );
7225                         free_reg(a);
7226                         free_output();
7227                 C_dus (4);
7228                 }
7229         })
7230 .
7231
7232
7233
7234 C_exg           ==>
7235 code_combiner(
7236         ;
7237         push_const($1);
7238         C_exg_narg())
7239 .
7240
7241 C_exg_narg      ==>
7242 code_combiner(
7243         {
7244                 reg_t a;
7245                 reg_t b;
7246                 reg_t c;
7247                 reg_t d;
7248                 int n;
7249                 int i;
7250                 const_str_t i_str;
7251                 const_str_t in_str;
7252
7253                 ;
7254                 if (type_of_tos() == T_cst && top_const() <= 16)
7255                 {
7256                         n= pop_const(0);
7257                         if (n==4)
7258                         {
7259                                         a= pop_reg();
7260                                         b= pop_reg();
7261                                         push_reg(a);
7262                                         push_reg(b);
7263                         }
7264                         else if (n==8)
7265                         {
7266                                 a= pop_reg();
7267                                 b= pop_reg();
7268                                 c= pop_reg();
7269                                 d= pop_reg();
7270                                 push_reg(b);
7271                                 push_reg(a);
7272                                 push_reg(d);
7273                                 push_reg(c);
7274                         }
7275                         else if (n>0 && !(n % 4))
7276                         {
7277                                 a= alloc_reg();
7278                                 b= alloc_reg();
7279                                 flush_cache();
7280                                 for (i=0; i<n; i += 4)
7281                                 {
7282                                         sprint(i_str, "%d", i);
7283                                         sprint(in_str, "%d", i+n);
7284 fprint ( codefile,
7285                                         "ld     [%s+%s], %s\n",reg_sp,i_str,a
7286 );
7287 fprint ( codefile,
7288                                         "ld     [%s+%s], %s\n",reg_sp,in_str,b
7289 );
7290 fprint ( codefile,
7291                                         "st     %s, [%s+%s]\n",b,reg_sp,i_str
7292 );
7293 fprint ( codefile,
7294                                         "st     %s, [%s+%s]\n",a,reg_sp,in_str
7295 );
7296                                 }
7297                                 free_reg(a);
7298                                 free_reg(b);
7299                         }
7300                         else
7301                                 ;
7302                 }
7303                 else
7304                 {
7305                         a= pop_reg();
7306                         flush_cache();
7307                         b= alloc_reg();
7308                         c= alloc_reg();
7309                         d= alloc_reg();
7310 fprint ( codefile,
7311                         "add    %s, %s, %s\n",reg_sp,a,b
7312 );
7313 fprint ( codefile,
7314                 "1:\n"
7315 );
7316 fprint ( codefile,
7317                         "dec    4, %s\n",b
7318 );
7319 fprint ( codefile,
7320                         "cmp    %s, %s\n",reg_sp,b
7321 );
7322 fprint ( codefile,
7323                         "ld     [%s], %s\n",b,c
7324 );
7325 fprint ( codefile,
7326                         "ld     [%s+%s], %s\n",b,a,d
7327 );
7328 fprint ( codefile,
7329                         "st     %s, [%s]\n",d,b
7330 );
7331 fprint ( codefile,
7332                         "bne    1b\n"
7333 );
7334 fprint ( codefile,
7335                         "st     %s, [%s+%s]\n"  ,c,b,a
7336 );
7337                         free_reg(a);
7338                         free_reg(b);
7339                         free_reg(c);
7340                         free_reg(d);
7341                 }
7342         })
7343 .
7344
7345 C_fil..         ==>
7346 code_combiner(
7347                         ;
7348
7349                         push_ext($1);
7350                         inc_tos($2);
7351                         push_ext("filn");
7352                         push_const(4);
7353                         C_sts(4))
7354 .
7355
7356
7357
7358 C_gto..         ==>
7359 code_combiner(
7360         {
7361                 char *ext;
7362                 reg_t a;
7363                 reg_t b;
7364                 reg_t c;
7365                 reg_t d;
7366
7367                 ;
7368
7369                 flush_cache();
7370                 a= reg_g1;
7371                 b= reg_g2;
7372                 c= reg_g3;
7373                 d= reg_g5;
7374                 forced_alloc_reg(a);
7375                 forced_alloc_reg(b);
7376                 forced_alloc_reg(c);
7377                 forced_alloc_reg(d);
7378                 ext= $1;
7379                 push_ext(ext);
7380                 inc_tos($2);
7381                 pop_reg_as(a);
7382 fprint ( codefile,
7383                 "ld     [%s+8], %s\n",a,b
7384 );
7385 fprint ( codefile,
7386                 "mov    %s, %s\n",reg_o0,c
7387 );
7388 fprint ( codefile,
7389                 "mov    %s, %s\n",reg_o1,d
7390 );
7391 fprint ( codefile,
7392         "1:\n"
7393 );
7394 fprint ( codefile,
7395                 "cmp    %s, %s\n",b,reg_lb
7396 );
7397 fprint ( codefile,
7398                 "bne,a  1b\n"
7399 );
7400 fprint ( codefile,
7401                 "restore\n"
7402 );
7403 fprint ( codefile,
7404                 "ld     [%s+4], %s\n",a,reg_sp
7405 );
7406 fprint ( codefile,
7407                 "ld     [%s], %s\n",a,b
7408 );
7409 fprint ( codefile,
7410                 "mov    %s, %s\n",c,reg_o0
7411 );
7412 fprint ( codefile,
7413                 "jmp    %s\n",b
7414 );
7415 fprint ( codefile,
7416                 "mov    %s, %s\n"       ,d,reg_o1
7417 );
7418                 free_reg(a);
7419                 free_reg(b);
7420                 free_reg(c);
7421                 free_reg(d);
7422         })
7423 .
7424
7425 C_lim           ==>
7426 code_combiner(
7427                         ;
7428                         push_ext("trpim");
7429                         C_loi(4))
7430 .
7431
7432 C_lin           ==>
7433 code_combiner(
7434                         ;
7435
7436                         push_const($1);
7437                         push_ext("lino");
7438                         push_const(4);
7439                         C_sts(4))
7440 .
7441
7442
7443 C_lni           ==>
7444 code_combiner(
7445
7446                         {
7447                                 reg_t a;
7448                                 reg_t b;
7449
7450                                 ;
7451                                 a = alloc_reg();
7452                                 b = alloc_reg();
7453 fprint ( codefile,
7454                                 "sethi  %%hi(lino), %s\n",a
7455 );
7456 fprint ( codefile,
7457                                 "ld     [%s+%%lo(lino)], %s\n",a,b
7458 );
7459 fprint ( codefile,
7460                                 "inc    %s\n",b
7461 );
7462 fprint ( codefile,
7463                                 "st     %s, [%s+%%lo(lino)]\n",b,a
7464 );
7465                                 free_reg(a);
7466                                 free_reg(b);
7467                         })
7468 .
7469
7470
7471
7472 C_lor
7473         $1 == 0         ==>
7474 code_combiner(
7475                                 ;
7476                                 soft_alloc_reg(reg_lb);
7477                                 push_reg(reg_lb))
7478 .
7479         $1 == 1         ==>
7480 code_combiner(
7481         {
7482                 reg_t a;
7483
7484                 ;
7485                 a= alloc_reg();
7486                 flush_cache();
7487 fprint ( codefile,
7488                 "mov    %s, %s\n",reg_sp,a
7489 );
7490                 push_reg(a);
7491         })
7492 .
7493         $1 == 2         ==>
7494 code_combiner(
7495                                 ;
7496                                 {
7497                                         reg_t a;
7498                                         reg_t b;
7499
7500                                         a= alloc_reg();
7501                                         b= alloc_reg();
7502 fprint ( codefile,
7503                                         "set    reghp, %s\n",a
7504 );
7505 fprint ( codefile,
7506                                         "ld     [%s], %s\n",a,b
7507 );
7508                                         push_reg(b);
7509                                         free_reg(a);
7510                                 })
7511 .
7512
7513         default         ==>
7514 code_combiner(
7515                                 )
7516 .
7517
7518
7519 C_lpb           ==>
7520 code_combiner(
7521                         ;
7522                         C_adp( (arith)((16*4) + 8 + 4 + (16 * 4))))
7523 .
7524
7525
7526 C_mon           ==>
7527 code_combiner(
7528                         ;
7529                         force_alloc_output();
7530                         pop_reg_as(reg_o0);
7531 fprint ( codefile,
7532                         "call mon\n"
7533 );
7534 fprint ( codefile,
7535                         "nop\n"
7536 );
7537                         free_output())
7538 .
7539
7540 C_nop   ==>
7541 code_combiner(
7542                         ;
7543                         flush_cache();
7544                         )
7545 .
7546
7547
7548 C_rck
7549         $1 == 4         ==>
7550 code_combiner(
7551         {
7552                 reg_t a;
7553                 reg_t b;
7554                 reg_t c;
7555
7556                 ;
7557                 force_alloc_output();
7558                 a= pop_reg();
7559                 b= pop_reg();
7560                 soft_alloc_reg(b);
7561                 push_reg(b);
7562                 c= alloc_reg();
7563 fprint ( codefile,
7564                 "ld     [%s], %s\n",a,c
7565 );
7566 fprint ( codefile,
7567                 "cmp    %s, %s\n",b,c
7568 );
7569 fprint ( codefile,
7570                 "bl     1f\n"
7571 );
7572 fprint ( codefile,
7573                 "ld     [%s+4], %s\n",a,c
7574 );
7575 fprint ( codefile,
7576                 "cmp    %s, %s\n",b,c
7577 );
7578 fprint ( codefile,
7579                 "ble    2f\n"
7580 );
7581 fprint ( codefile,
7582                 "nop\n"
7583 );
7584 fprint ( codefile,
7585         "1:\n"
7586 );
7587 fprint ( codefile,
7588                 "set    ERANGE, %s\n",reg_o0
7589 );
7590 fprint ( codefile,
7591                 "call   trp\n"
7592 );
7593 fprint ( codefile,
7594                 "nop\n"
7595 );
7596 fprint ( codefile,
7597         "2:\n"
7598 );
7599                 free_reg(a);
7600                 free_reg(b);
7601                 free_reg(c);
7602                 free_output();
7603         })
7604 .
7605         default         ==>
7606 code_combiner(
7607                 )
7608 .
7609
7610 C_rck_narg      ==>
7611 code_combiner(
7612         {
7613                 reg_t a;
7614                 int n;
7615                 
7616                 ;
7617                 if (type_of_tos() == T_cst)
7618                 {
7619                         n= pop_const(0);
7620                         C_rck (n);
7621                 }
7622                 else
7623                 {
7624                         a= pop_reg();
7625                         force_alloc_output();
7626 fprint ( codefile,
7627                         "cmp    %s, 4\n",a
7628 );
7629 fprint ( codefile,
7630                         "be     1f\n"
7631 );
7632 fprint ( codefile,
7633                         "set    EILLINS, %s\n",reg_o0
7634 );
7635 fprint ( codefile,
7636                         "call   trp\n"
7637 );
7638 fprint ( codefile,
7639                         "nop\n"
7640 );
7641 fprint ( codefile,
7642                 "1:\n"
7643 );
7644                         free_reg(a);
7645                         free_output();
7646                 C_rck (4);
7647                 }
7648         })
7649 .
7650
7651
7652
7653 C_rtt           ==>
7654 code_combiner(
7655                         ;
7656                         C_ret( (arith)0))
7657 .
7658
7659
7660 C_sig           ==>
7661 code_combiner(
7662                         ;
7663                         {
7664                                 reg_t a;
7665                                 reg_t b;
7666                                 reg_t c;
7667
7668                                 a= pop_reg();
7669                                 b= alloc_reg();
7670                                 c= alloc_reg();
7671 fprint ( codefile,
7672                                 "set    trppc, %s\n",b
7673 );
7674 fprint ( codefile,
7675                                 "ld     [%s], %s\n",b,c
7676 );
7677 fprint ( codefile,
7678                                 "st     %s, [%s]\n",a,b
7679 );
7680                                 free_reg(a);
7681                                 free_reg(b);
7682                                 push_reg(c);
7683                         })
7684 .
7685
7686
7687 C_sim           ==>
7688 code_combiner(
7689                         ;
7690                         {
7691                                 reg_t a;
7692                                 reg_t b;
7693
7694                                 a= pop_reg();
7695                                 b= alloc_reg();
7696 fprint ( codefile,
7697                                 "set    trpim, %s\n",b
7698 );
7699 fprint ( codefile,
7700                                 "st     %s, [%s]\n",a,b
7701 );
7702                                 free_reg(a);
7703                                 free_reg(b);
7704                         })
7705 .
7706
7707
7708 C_str
7709         $1 == 0         ==>
7710 code_combiner(
7711                                 ;
7712                                 flush_cache();
7713 fprint ( codefile,
7714                                 "ld     [%s], %s\n",reg_sp,reg_lb
7715 );
7716 fprint ( codefile,
7717                                 "add    %s, 4, %%fp\n",reg_lb
7718 );
7719 fprint ( codefile,
7720                                 "and    %%fp, -8, %%fp\n"
7721 );
7722 fprint ( codefile,
7723                                 "inc    4, %s\n",reg_sp
7724 );
7725                                 )
7726 .
7727         $1 == 1         ==>
7728 code_combiner(
7729         {
7730                 ;
7731                 flush_cache();
7732 fprint ( codefile,
7733                 "ld [%s], %s\n",reg_sp,reg_sp
7734 );
7735         })
7736 .
7737         $1 == 2         ==>
7738 code_combiner(
7739         {
7740                 ;
7741                 force_alloc_output();
7742                 pop_reg_as(reg_o0);
7743 fprint ( codefile,
7744                 "call   strhp\n"
7745 );
7746 fprint ( codefile,
7747                 "nop\n"
7748 );
7749                 free_output();
7750         })
7751 .
7752         default         ==>
7753 code_combiner(
7754                                 )
7755 .
7756
7757
7758 C_trp           ==>
7759 code_combiner(
7760                         ;
7761                         force_alloc_output();
7762                         pop_reg_as(reg_o0);
7763                         flush_cache();
7764 fprint ( codefile,
7765                         "call   trp\n"
7766 );
7767 fprint ( codefile,
7768                         "nop\n"
7769 );
7770                         free_output())
7771 .
7772
7773
7774
7775 ..icon
7776         $2 == 1         ==>
7777 code_combiner(
7778                                 ;
7779                                 gen1( (int) atoi( $1)))
7780 .
7781         $2 == 2         ==>
7782 code_combiner(
7783                                 ;
7784                                 gen2( (int) atoi( $1)))
7785 .
7786         $2 == 4         ==>
7787 code_combiner(
7788                                 ;
7789                                 gen4( (long) atol( $1)))
7790 .
7791         default         ==>
7792 code_combiner(
7793                                 )
7794 .
7795
7796 ..ucon
7797         $2 == 1         ==>
7798 code_combiner(
7799                                 ;
7800                                 gen1( (int) atoi( $1)))
7801 .
7802         $2 == 2         ==>
7803 code_combiner(
7804                                 ;
7805                                 gen2( (int) atoi( $1)))
7806 .
7807         $2 == 4         ==>
7808 code_combiner(
7809                                 ;
7810                                 gen4( (long) atol( $1)))
7811 .
7812         default         ==>
7813 code_combiner(
7814                                 )
7815 .
7816
7817 ..fcon                  ==>
7818 code_combiner(
7819                                 ;
7820                                 con_float($1, $2))
7821 .
7822
7823
7824
7825 C_prolog                ==>
7826 code_combiner(
7827         ;
7828         init_cache();
7829 fprint ( codefile,
7830         "sub    %s, (((16*4) + 8 + 4 + (16 * 4))-4), %%g1\n",reg_sp
7831 );
7832 fprint ( codefile,
7833         "and    %%g1, -8, %%sp\n"
7834 );
7835 fprint ( codefile,
7836         "mov    %s, %%g1\n",reg_sp
7837 );
7838 fprint ( codefile,
7839         "save   %%sp, %s, %%sp\n",reg_gap
7840 );
7841 fprint ( codefile,
7842         "st     %%g0, [%%sp+(16*4)]\n"
7843 );
7844 fprint ( codefile,
7845         "sub    %%g1, ((16*4) + 8 + 4 + (16 * 4)), %s\n",reg_lb
7846 );
7847         init_reg_man();
7848         forced_alloc_reg(reg_sp);
7849         forced_alloc_reg(reg_lb);
7850         forced_alloc_reg(reg_gap);
7851
7852         )
7853 .
7854 C_jump                  ==>
7855 code_combiner(
7856         {
7857                 char *l;
7858
7859                 ;
7860                 l= $1;
7861 fprint ( codefile,
7862                 "b      %s\n",l
7863 );
7864 fprint ( codefile,
7865                 "nop\n" 
7866 );
7867         })
7868 .
7869
7870 C_locals                ==>
7871 code_combiner(
7872         {
7873                 ;
7874
7875                 soft_alloc_reg(reg_lb);
7876                 push_reg(reg_lb);
7877                 inc_tos(-($1));
7878                 pop_reg_as(reg_sp);
7879         })
7880 .