Print this page




 645 stuff:
 646         /* stick the result in the destination */
 647         if (opf & 0x80) { /* conversion */
 648                 if (opf & 0x10) { /* result is an int */
 649                         switch (info->res.type) {
 650                         case fex_llong:
 651                                 info->res.val.i = (int) info->res.val.l;
 652                                 break;
 653 
 654                         case fex_float:
 655                                 info->res.val.i = (int) info->res.val.f;
 656                                 break;
 657 
 658                         case fex_double:
 659                                 info->res.val.i = (int) info->res.val.d;
 660                                 break;
 661 
 662                         case fex_ldouble:
 663                                 info->res.val.i = (int) info->res.val.q;
 664                                 break;



 665                         }
 666                         *(int*)FPreg(rd) = info->res.val.i;
 667                         return;
 668                 }
 669 
 670                 switch (opf & 0xc) {
 671                 case 0: /* result is long long */
 672                         switch (info->res.type) {
 673                         case fex_int:
 674                                 info->res.val.l = (long long) info->res.val.i;
 675                                 break;
 676 
 677                         case fex_float:
 678                                 info->res.val.l = (long long) info->res.val.f;
 679                                 break;
 680 
 681                         case fex_double:
 682                                 info->res.val.l = (long long) info->res.val.d;
 683                                 break;
 684 
 685                         case fex_ldouble:
 686                                 info->res.val.l = (long long) info->res.val.q;
 687                                 break;



 688                         }
 689                         *(long long*)FPREG(rd) = info->res.val.l;
 690                         break;
 691 
 692                 case 0x4: /* result is float */
 693                         switch (info->res.type) {
 694                         case fex_int:
 695                                 info->res.val.f = (float) info->res.val.i;
 696                                 break;
 697 
 698                         case fex_llong:
 699                                 info->res.val.f = (float) info->res.val.l;
 700                                 break;
 701 
 702                         case fex_double:
 703                                 info->res.val.f = (float) info->res.val.d;
 704                                 break;
 705 
 706                         case fex_ldouble:
 707                                 info->res.val.f = (float) info->res.val.q;
 708                                 break;



 709                         }
 710                         *(float*)FPreg(rd) = info->res.val.f;
 711                         break;
 712 
 713                 case 0x8: /* result is double */
 714                         switch (info->res.type) {
 715                         case fex_int:
 716                                 info->res.val.d = (double) info->res.val.i;
 717                                 break;
 718 
 719                         case fex_llong:
 720                                 info->res.val.d = (double) info->res.val.l;
 721                                 break;
 722 
 723                         case fex_float:
 724                                 info->res.val.d = (double) info->res.val.f;
 725                                 break;
 726 
 727                         case fex_ldouble:
 728                                 info->res.val.d = (double) info->res.val.q;
 729                                 break;



 730                         }
 731                         *(double*)FPREG(rd) = info->res.val.d;
 732                         break;
 733 
 734                 case 0xc: /* result is long double */
 735                         switch (info->res.type) {
 736                         case fex_int:
 737                                 info->res.val.q = (long double) info->res.val.i;
 738                                 break;
 739 
 740                         case fex_llong:
 741                                 info->res.val.q = (long double) info->res.val.l;
 742                                 break;
 743 
 744                         case fex_float:
 745                                 info->res.val.q = (long double) info->res.val.f;
 746                                 break;
 747 
 748                         case fex_double:
 749                                 info->res.val.q = (long double) info->res.val.d;
 750                                 break;



 751                         }
 752                         *(long double*)FPREG(rd) = info->res.val.q;
 753                         break;
 754                 }
 755                 return;
 756         }
 757 
 758         if ((opf & 0xf0) == 0x60) { /* fsmuld, fdmulq */
 759                 switch (opf & 0xc0) {
 760                 case 0x8: /* result is double */
 761                         switch (info->res.type) {
 762                         case fex_int:
 763                                 info->res.val.d = (double) info->res.val.i;
 764                                 break;
 765 
 766                         case fex_llong:
 767                                 info->res.val.d = (double) info->res.val.l;
 768                                 break;
 769 
 770                         case fex_float:
 771                                 info->res.val.d = (double) info->res.val.f;
 772                                 break;
 773 
 774                         case fex_ldouble:
 775                                 info->res.val.d = (double) info->res.val.q;
 776                                 break;



 777                         }
 778                         *(double*)FPREG(rd) = info->res.val.d;
 779                         break;
 780 
 781                 case 0xc: /* result is long double */
 782                         switch (info->res.type) {
 783                         case fex_int:
 784                                 info->res.val.q = (long double) info->res.val.i;
 785                                 break;
 786 
 787                         case fex_llong:
 788                                 info->res.val.q = (long double) info->res.val.l;
 789                                 break;
 790 
 791                         case fex_float:
 792                                 info->res.val.q = (long double) info->res.val.f;
 793                                 break;
 794 
 795                         case fex_double:
 796                                 info->res.val.q = (long double) info->res.val.d;
 797                                 break;



 798                         }
 799                         *(long double*)FPREG(rd) = info->res.val.q;
 800                         break;
 801                 }
 802                 return;
 803         }
 804 
 805         switch (opf & 3) { /* other arithmetic op */
 806         case 1: /* result is float */
 807                 switch (info->res.type) {
 808                 case fex_int:
 809                         info->res.val.f = (float) info->res.val.i;
 810                         break;
 811 
 812                 case fex_llong:
 813                         info->res.val.f = (float) info->res.val.l;
 814                         break;
 815 
 816                 case fex_double:
 817                         info->res.val.f = (float) info->res.val.d;
 818                         break;
 819 
 820                 case fex_ldouble:
 821                         info->res.val.f = (float) info->res.val.q;
 822                         break;



 823                 }
 824                 *(float*)FPreg(rd) = info->res.val.f;
 825                 break;
 826 
 827         case 2: /* result is double */
 828                 switch (info->res.type) {
 829                 case fex_int:
 830                         info->res.val.d = (double) info->res.val.i;
 831                         break;
 832 
 833                 case fex_llong:
 834                         info->res.val.d = (double) info->res.val.l;
 835                         break;
 836 
 837                 case fex_float:
 838                         info->res.val.d = (double) info->res.val.f;
 839                         break;
 840 
 841                 case fex_ldouble:
 842                         info->res.val.d = (double) info->res.val.q;
 843                         break;



 844                 }
 845                 *(double*)FPREG(rd) = info->res.val.d;
 846                 break;
 847 
 848         case 3: /* result is long double */
 849                 switch (info->res.type) {
 850                 case fex_int:
 851                         info->res.val.q = (long double) info->res.val.i;
 852                         break;
 853 
 854                 case fex_llong:
 855                         info->res.val.q = (long double) info->res.val.l;
 856                         break;
 857 
 858                 case fex_float:
 859                         info->res.val.q = (long double) info->res.val.f;
 860                         break;
 861 
 862                 case fex_double:
 863                         info->res.val.q = (long double) info->res.val.d;



 864                         break;
 865                 }
 866                 *(long double*)FPREG(rd) = info->res.val.q;
 867                 break;
 868         }
 869 }
 870 #endif  /* defined(__sparc) */


 645 stuff:
 646         /* stick the result in the destination */
 647         if (opf & 0x80) { /* conversion */
 648                 if (opf & 0x10) { /* result is an int */
 649                         switch (info->res.type) {
 650                         case fex_llong:
 651                                 info->res.val.i = (int) info->res.val.l;
 652                                 break;
 653 
 654                         case fex_float:
 655                                 info->res.val.i = (int) info->res.val.f;
 656                                 break;
 657 
 658                         case fex_double:
 659                                 info->res.val.i = (int) info->res.val.d;
 660                                 break;
 661 
 662                         case fex_ldouble:
 663                                 info->res.val.i = (int) info->res.val.q;
 664                                 break;
 665 
 666                         default:
 667                                 break;
 668                         }
 669                         *(int*)FPreg(rd) = info->res.val.i;
 670                         return;
 671                 }
 672 
 673                 switch (opf & 0xc) {
 674                 case 0: /* result is long long */
 675                         switch (info->res.type) {
 676                         case fex_int:
 677                                 info->res.val.l = (long long) info->res.val.i;
 678                                 break;
 679 
 680                         case fex_float:
 681                                 info->res.val.l = (long long) info->res.val.f;
 682                                 break;
 683 
 684                         case fex_double:
 685                                 info->res.val.l = (long long) info->res.val.d;
 686                                 break;
 687 
 688                         case fex_ldouble:
 689                                 info->res.val.l = (long long) info->res.val.q;
 690                                 break;
 691 
 692                         default:
 693                                 break;
 694                         }
 695                         *(long long*)FPREG(rd) = info->res.val.l;
 696                         break;
 697 
 698                 case 0x4: /* result is float */
 699                         switch (info->res.type) {
 700                         case fex_int:
 701                                 info->res.val.f = (float) info->res.val.i;
 702                                 break;
 703 
 704                         case fex_llong:
 705                                 info->res.val.f = (float) info->res.val.l;
 706                                 break;
 707 
 708                         case fex_double:
 709                                 info->res.val.f = (float) info->res.val.d;
 710                                 break;
 711 
 712                         case fex_ldouble:
 713                                 info->res.val.f = (float) info->res.val.q;
 714                                 break;
 715 
 716                         default:
 717                                 break;
 718                         }
 719                         *(float*)FPreg(rd) = info->res.val.f;
 720                         break;
 721 
 722                 case 0x8: /* result is double */
 723                         switch (info->res.type) {
 724                         case fex_int:
 725                                 info->res.val.d = (double) info->res.val.i;
 726                                 break;
 727 
 728                         case fex_llong:
 729                                 info->res.val.d = (double) info->res.val.l;
 730                                 break;
 731 
 732                         case fex_float:
 733                                 info->res.val.d = (double) info->res.val.f;
 734                                 break;
 735 
 736                         case fex_ldouble:
 737                                 info->res.val.d = (double) info->res.val.q;
 738                                 break;
 739 
 740                         default:
 741                                 break;
 742                         }
 743                         *(double*)FPREG(rd) = info->res.val.d;
 744                         break;
 745 
 746                 case 0xc: /* result is long double */
 747                         switch (info->res.type) {
 748                         case fex_int:
 749                                 info->res.val.q = (long double) info->res.val.i;
 750                                 break;
 751 
 752                         case fex_llong:
 753                                 info->res.val.q = (long double) info->res.val.l;
 754                                 break;
 755 
 756                         case fex_float:
 757                                 info->res.val.q = (long double) info->res.val.f;
 758                                 break;
 759 
 760                         case fex_double:
 761                                 info->res.val.q = (long double) info->res.val.d;
 762                                 break;
 763 
 764                         default:
 765                                 break;
 766                         }
 767                         *(long double*)FPREG(rd) = info->res.val.q;
 768                         break;
 769                 }
 770                 return;
 771         }
 772 
 773         if ((opf & 0xf0) == 0x60) { /* fsmuld, fdmulq */
 774                 switch (opf & 0xc0) {
 775                 case 0x8: /* result is double */
 776                         switch (info->res.type) {
 777                         case fex_int:
 778                                 info->res.val.d = (double) info->res.val.i;
 779                                 break;
 780 
 781                         case fex_llong:
 782                                 info->res.val.d = (double) info->res.val.l;
 783                                 break;
 784 
 785                         case fex_float:
 786                                 info->res.val.d = (double) info->res.val.f;
 787                                 break;
 788 
 789                         case fex_ldouble:
 790                                 info->res.val.d = (double) info->res.val.q;
 791                                 break;
 792 
 793                         default:
 794                                 break;
 795                         }
 796                         *(double*)FPREG(rd) = info->res.val.d;
 797                         break;
 798 
 799                 case 0xc: /* result is long double */
 800                         switch (info->res.type) {
 801                         case fex_int:
 802                                 info->res.val.q = (long double) info->res.val.i;
 803                                 break;
 804 
 805                         case fex_llong:
 806                                 info->res.val.q = (long double) info->res.val.l;
 807                                 break;
 808 
 809                         case fex_float:
 810                                 info->res.val.q = (long double) info->res.val.f;
 811                                 break;
 812 
 813                         case fex_double:
 814                                 info->res.val.q = (long double) info->res.val.d;
 815                                 break;
 816 
 817                         default:
 818                                 break;
 819                         }
 820                         *(long double*)FPREG(rd) = info->res.val.q;
 821                         break;
 822                 }
 823                 return;
 824         }
 825 
 826         switch (opf & 3) { /* other arithmetic op */
 827         case 1: /* result is float */
 828                 switch (info->res.type) {
 829                 case fex_int:
 830                         info->res.val.f = (float) info->res.val.i;
 831                         break;
 832 
 833                 case fex_llong:
 834                         info->res.val.f = (float) info->res.val.l;
 835                         break;
 836 
 837                 case fex_double:
 838                         info->res.val.f = (float) info->res.val.d;
 839                         break;
 840 
 841                 case fex_ldouble:
 842                         info->res.val.f = (float) info->res.val.q;
 843                         break;
 844 
 845                 default:
 846                         break;
 847                 }
 848                 *(float*)FPreg(rd) = info->res.val.f;
 849                 break;
 850 
 851         case 2: /* result is double */
 852                 switch (info->res.type) {
 853                 case fex_int:
 854                         info->res.val.d = (double) info->res.val.i;
 855                         break;
 856 
 857                 case fex_llong:
 858                         info->res.val.d = (double) info->res.val.l;
 859                         break;
 860 
 861                 case fex_float:
 862                         info->res.val.d = (double) info->res.val.f;
 863                         break;
 864 
 865                 case fex_ldouble:
 866                         info->res.val.d = (double) info->res.val.q;
 867                         break;
 868 
 869                 default:
 870                         break;
 871                 }
 872                 *(double*)FPREG(rd) = info->res.val.d;
 873                 break;
 874 
 875         case 3: /* result is long double */
 876                 switch (info->res.type) {
 877                 case fex_int:
 878                         info->res.val.q = (long double) info->res.val.i;
 879                         break;
 880 
 881                 case fex_llong:
 882                         info->res.val.q = (long double) info->res.val.l;
 883                         break;
 884 
 885                 case fex_float:
 886                         info->res.val.q = (long double) info->res.val.f;
 887                         break;
 888 
 889                 case fex_double:
 890                         info->res.val.q = (long double) info->res.val.d;
 891                         break;
 892 
 893                 default:
 894                         break;
 895                 }
 896                 *(long double*)FPREG(rd) = info->res.val.q;
 897                 break;
 898         }
 899 }
 900 #endif  /* defined(__sparc) */