修訂 | 400c3c549bd998614a3b14b012010791b479799b (tree) |
---|---|
時間 | 2018-12-23 23:29:33 |
作者 | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
add rxv3-dfpu
@@ -120,6 +120,7 @@ static void rtsd_immediate (expressionS); | ||
120 | 120 | static void rx_range (expressionS, int, int); |
121 | 121 | static void rx_check_v2 (void); |
122 | 122 | static void rx_check_v3 (void); |
123 | +static void rx_check_dfpu (void); | |
123 | 124 | |
124 | 125 | static int need_flag = 0; |
125 | 126 | static int rx_in_brackets = 0; |
@@ -916,88 +917,88 @@ statement : | ||
916 | 917 | | SAVE { rx_check_v3(); sub_op = 0; } op_save_rstr |
917 | 918 | |
918 | 919 | /* ---------------------------------------------------------------------- */ |
919 | - | DABS { rx_check_v3(); sub_op = 0x0c; sub_op2 = 0x01; } double2_op | |
920 | - | DNEG { rx_check_v3(); sub_op = 0x0c; sub_op2 = 0x02; } double2_op | |
921 | - | DROUND { rx_check_v3(); sub_op = 0x0d; sub_op2 = 0x0d; } double2_op | |
922 | - | DSQRT { rx_check_v3(); sub_op = 0x0d; sub_op2 = 0x00; } double2_op | |
923 | - | DTOF { rx_check_v3(); sub_op = 0x0d; sub_op2 = 0x0c; } double2_op | |
924 | - | DTOI { rx_check_v3(); sub_op = 0x0d; sub_op2 = 0x08;} double2_op | |
925 | - | DTOU { rx_check_v3(); sub_op = 0x0d; sub_op2 = 0x09; } double2_op | |
926 | - | DADD { rx_check_v3(); sub_op = 0x00; } double3_op | |
927 | - | DDIV { rx_check_v3(); sub_op = 0x05; } double3_op | |
928 | - | DMUL { rx_check_v3(); sub_op = 0x02; } double3_op | |
929 | - | DSUB { rx_check_v3(); sub_op = 0x01; } double3_op | |
930 | - | DCMP DREG ',' DREG { rx_check_v3(); | |
920 | + | DABS { rx_check_dfpu(); sub_op = 0x0c; sub_op2 = 0x01; } double2_op | |
921 | + | DNEG { rx_check_dfpu(); sub_op = 0x0c; sub_op2 = 0x02; } double2_op | |
922 | + | DROUND { rx_check_dfpu(); sub_op = 0x0d; sub_op2 = 0x0d; } double2_op | |
923 | + | DSQRT { rx_check_dfpu(); sub_op = 0x0d; sub_op2 = 0x00; } double2_op | |
924 | + | DTOF { rx_check_dfpu(); sub_op = 0x0d; sub_op2 = 0x0c; } double2_op | |
925 | + | DTOI { rx_check_dfpu(); sub_op = 0x0d; sub_op2 = 0x08;} double2_op | |
926 | + | DTOU { rx_check_dfpu(); sub_op = 0x0d; sub_op2 = 0x09; } double2_op | |
927 | + | DADD { rx_check_dfpu(); sub_op = 0x00; } double3_op | |
928 | + | DDIV { rx_check_dfpu(); sub_op = 0x05; } double3_op | |
929 | + | DMUL { rx_check_dfpu(); sub_op = 0x02; } double3_op | |
930 | + | DSUB { rx_check_dfpu(); sub_op = 0x01; } double3_op | |
931 | + | DCMP DREG ',' DREG { rx_check_dfpu(); | |
931 | 932 | B4(0x76, 0x90, 0x08, 0x00); F($1, 24, 4); F($2, 28, 4); F($4, 16, 4); } |
932 | 933 | | DMOV DOT_D REG ',' DREGH |
933 | - { rx_check_v3(); | |
934 | + { rx_check_dfpu(); | |
934 | 935 | B4(0xfd, 0x77, 0x80, 0x03); F($3, 20, 4); F($5, 24, 4); } |
935 | 936 | | DMOV DOT_L REG ',' DREGH |
936 | - { rx_check_v3(); | |
937 | + { rx_check_dfpu(); | |
937 | 938 | B4(0xfd, 0x77, 0x80, 0x02); F($3, 20, 4); F($5, 24, 4); } |
938 | 939 | | DMOV DOT_L REG ',' DREGL |
939 | - { rx_check_v3(); | |
940 | + { rx_check_dfpu(); | |
940 | 941 | B4(0xfd, 0x77, 0x80, 0x00); F($3, 20, 4); F($5, 24, 4); } |
941 | 942 | | DMOV DOT_L DREGH ',' REG |
942 | - { rx_check_v3(); | |
943 | + { rx_check_dfpu(); | |
943 | 944 | B4(0xfd, 0x75, 0x80, 0x02); F($3, 24, 4); F($5, 20, 4); } |
944 | 945 | | DMOV DOT_L DREGL ',' REG |
945 | - { rx_check_v3(); | |
946 | + { rx_check_dfpu(); | |
946 | 947 | B4(0xfd, 0x75, 0x80, 0x00); F($3, 24, 4); F($5, 20, 4); } |
947 | 948 | | DMOV DOT_D DREG ',' DREG |
948 | - { rx_check_v3(); | |
949 | + { rx_check_dfpu(); | |
949 | 950 | B4(0x76, 0x90, 0x0c, 0x00); F($3, 16, 4); F($5, 24, 4); } |
950 | 951 | | DMOV DOT_D DREG ',' '[' REG ']' |
951 | - { rx_check_v3(); | |
952 | + { rx_check_dfpu(); | |
952 | 953 | B4(0xfc, 0x78, 0x08, 0x00); F($6, 16, 4); F($3, 24, 4); } |
953 | 954 | | DMOV DOT_D DREG ',' disp '[' REG ']' |
954 | - { rx_check_v3(); | |
955 | + { rx_check_dfpu(); | |
955 | 956 | B3(0xfc, 0x78, 0x08); F($7, 16, 4); DSP($5, 14, DSIZE); |
956 | 957 | POST($3 << 4); } |
957 | 958 | | DMOV DOT_D '[' REG ']' ',' DREG |
958 | - { rx_check_v3(); | |
959 | + { rx_check_dfpu(); | |
959 | 960 | B4(0xfc, 0xc8, 0x08, 0x00); F($4, 16, 4); F($7, 24, 4); } |
960 | 961 | | DMOV DOT_D disp '[' REG ']' ',' DREG |
961 | - { rx_check_v3(); | |
962 | + { rx_check_dfpu(); | |
962 | 963 | B3(0xfc, 0xc8, 0x08); F($5, 16, 4); DSP($3, 14, DSIZE); |
963 | 964 | POST($8 << 4); } |
964 | 965 | | DMOV DOT_D '#' EXPR ',' DREGH |
965 | - { rx_check_v3(); | |
966 | + { rx_check_dfpu(); | |
966 | 967 | B3(0xf9, 0x03, 0x03); F($6, 16, 4); IMM($4, -1); } |
967 | 968 | | DMOV DOT_L '#' EXPR ',' DREGH |
968 | - { rx_check_v3(); | |
969 | + { rx_check_dfpu(); | |
969 | 970 | B3(0xf9, 0x03, 0x02); F($6, 16, 4); IMM($4, -1); } |
970 | 971 | | DMOV DOT_L '#' EXPR ',' DREGL |
971 | - { rx_check_v3(); | |
972 | + { rx_check_dfpu(); | |
972 | 973 | B3(0xf9, 0x03, 0x00); F($6, 16, 4); IMM($4, -1); } |
973 | 974 | | DPOPM DOT_D DREG '-' DREG |
974 | - { rx_check_v3(); | |
975 | + { rx_check_dfpu(); | |
975 | 976 | B3(0x75, 0xb8, 0x00); F($3, 16, 4); F($5 - $3, 20, 4); } |
976 | 977 | | DPOPM DOT_L DCREG '-' DCREG |
977 | - { rx_check_v3(); | |
978 | + { rx_check_dfpu(); | |
978 | 979 | B3(0x75, 0xa8, 0x00); F($3, 16, 4); F($5 - $3, 20, 4); } |
979 | 980 | | DPUSHM DOT_D DREG '-' DREG |
980 | - { rx_check_v3(); | |
981 | + { rx_check_dfpu(); | |
981 | 982 | B3(0x75, 0xb0, 0x00); F($3, 16, 4); F($5 - $3, 20, 4); } |
982 | 983 | | DPUSHM DOT_L DCREG '-' DCREG |
983 | - { rx_check_v3(); | |
984 | + { rx_check_dfpu(); | |
984 | 985 | B3(0x75, 0xa0, 0x00); F($3, 16, 4); F($5 - $3, 20, 4); } |
985 | 986 | | MVFDC DCREG ',' REG |
986 | - { rx_check_v3(); | |
987 | + { rx_check_dfpu(); | |
987 | 988 | B4(0xfd, 0x75, 0x80, 0x04); F($2, 24, 4); F($4, 20, 4); } |
988 | 989 | | MVFDR |
989 | - { rx_check_v3(); B3(0x75, 0x90, 0x1b); } | |
990 | + { rx_check_dfpu(); B3(0x75, 0x90, 0x1b); } | |
990 | 991 | | MVTDC REG ',' DCREG |
991 | - { rx_check_v3(); | |
992 | + { rx_check_dfpu(); | |
992 | 993 | B4(0xfd, 0x77, 0x80, 0x04); F($2, 24, 4); F($4, 20, 4); } |
993 | 994 | | FTOD REG ',' DREG |
994 | - { rx_check_v3(); | |
995 | + { rx_check_dfpu(); | |
995 | 996 | B4(0xfd, 0x77, 0x80, 0x0a); F($2, 24, 4); F($4, 20, 4); } |
996 | 997 | | ITOD REG ',' DREG |
997 | - { rx_check_v3(); | |
998 | + { rx_check_dfpu(); | |
998 | 999 | B4(0xfd, 0x77, 0x80, 0x09); F($2, 24, 4); F($4, 20, 4); } |
999 | 1000 | | UTOD REG ',' DREG |
1000 | - { rx_check_v3(); | |
1001 | + { rx_check_dfpu(); | |
1001 | 1002 | B4(0xfd, 0x77, 0x80, 0x0d); F($2, 24, 4); F($4, 20, 4); } |
1002 | 1003 | |
1003 | 1004 | /* ---------------------------------------------------------------------- */ |
@@ -2073,3 +2074,10 @@ rx_check_v3 (void) | ||
2073 | 2074 | if (rx_cpu < RXV3) |
2074 | 2075 | rx_error (_("target CPU type does not support v3 instructions")); |
2075 | 2076 | } |
2077 | + | |
2078 | +static void | |
2079 | +rx_check_dfpu (void) | |
2080 | +{ | |
2081 | + if (rx_cpu != RXV3FPU) | |
2082 | + rx_error (_("target CPU type does not support double float instructions")); | |
2083 | +} |