OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_MIPS_CONSTANTS_H_ | 5 #ifndef V8_MIPS_CONSTANTS_H_ |
6 #define V8_MIPS_CONSTANTS_H_ | 6 #define V8_MIPS_CONSTANTS_H_ |
7 | 7 |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/base/macros.h" | 9 #include "src/base/macros.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 return eq; | 1085 return eq; |
1086 case ueq: | 1086 case ueq: |
1087 return ogl; | 1087 return ogl; |
1088 case ogl: | 1088 case ogl: |
1089 return ueq; | 1089 return ueq; |
1090 default: | 1090 default: |
1091 return cc; | 1091 return cc; |
1092 } | 1092 } |
1093 } | 1093 } |
1094 | 1094 |
| 1095 enum MSABranchCondition { |
| 1096 all_not_zero = 0, // Branch If All Elements Are Not Zero |
| 1097 one_elem_not_zero, // Branch If At Least One Element of Any Format Is Not |
| 1098 // Zero |
| 1099 one_elem_zero, // Branch If At Least One Element Is Zero |
| 1100 all_zero // Branch If All Elements of Any Format Are Zero |
| 1101 }; |
| 1102 |
| 1103 inline MSABranchCondition NegateMSABranchCondition(MSABranchCondition cond) { |
| 1104 switch (cond) { |
| 1105 case all_not_zero: |
| 1106 return one_elem_zero; |
| 1107 case one_elem_not_zero: |
| 1108 return all_zero; |
| 1109 case one_elem_zero: |
| 1110 return all_not_zero; |
| 1111 case all_zero: |
| 1112 return one_elem_not_zero; |
| 1113 default: |
| 1114 return cond; |
| 1115 } |
| 1116 } |
| 1117 |
| 1118 enum MSABranchDF { |
| 1119 MSA_BRANCH_B = 0, |
| 1120 MSA_BRANCH_H, |
| 1121 MSA_BRANCH_W, |
| 1122 MSA_BRANCH_D, |
| 1123 MSA_BRANCH_V |
| 1124 }; |
1095 | 1125 |
1096 // Commute a condition such that {a cond b == b cond' a}. | 1126 // Commute a condition such that {a cond b == b cond' a}. |
1097 inline Condition CommuteCondition(Condition cc) { | 1127 inline Condition CommuteCondition(Condition cc) { |
1098 switch (cc) { | 1128 switch (cc) { |
1099 case Uless: | 1129 case Uless: |
1100 return Ugreater; | 1130 return Ugreater; |
1101 case Ugreater: | 1131 case Ugreater: |
1102 return Uless; | 1132 return Uless; |
1103 case Ugreater_equal: | 1133 case Ugreater_equal: |
1104 return Uless_equal; | 1134 return Uless_equal; |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 return true; | 1941 return true; |
1912 default: | 1942 default: |
1913 return false; | 1943 return false; |
1914 } | 1944 } |
1915 break; | 1945 break; |
1916 case COP1: | 1946 case COP1: |
1917 switch (instr & kRsFieldMask) { | 1947 switch (instr & kRsFieldMask) { |
1918 case BC1: | 1948 case BC1: |
1919 case BC1EQZ: | 1949 case BC1EQZ: |
1920 case BC1NEZ: | 1950 case BC1NEZ: |
| 1951 case BZ_V: |
| 1952 case BZ_B: |
| 1953 case BZ_H: |
| 1954 case BZ_W: |
| 1955 case BZ_D: |
| 1956 case BNZ_V: |
| 1957 case BNZ_B: |
| 1958 case BNZ_H: |
| 1959 case BNZ_W: |
| 1960 case BNZ_D: |
1921 return true; | 1961 return true; |
1922 break; | 1962 break; |
1923 default: | 1963 default: |
1924 return false; | 1964 return false; |
1925 } | 1965 } |
1926 break; | 1966 break; |
1927 default: | 1967 default: |
1928 return false; | 1968 return false; |
1929 } | 1969 } |
1930 } | 1970 } |
1931 } // namespace internal | 1971 } // namespace internal |
1932 } // namespace v8 | 1972 } // namespace v8 |
1933 | 1973 |
1934 #endif // #ifndef V8_MIPS_CONSTANTS_H_ | 1974 #endif // #ifndef V8_MIPS_CONSTANTS_H_ |
OLD | NEW |