| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 not_zero = not_equal, | 139 not_zero = not_equal, |
| 140 sign = negative, | 140 sign = negative, |
| 141 not_sign = positive | 141 not_sign = positive |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 | 144 |
| 145 // Returns the equivalent of !cc. | 145 // Returns the equivalent of !cc. |
| 146 // Negation of the default no_condition (-1) results in a non-default | 146 // Negation of the default no_condition (-1) results in a non-default |
| 147 // no_condition value (-2). As long as tests for no_condition check | 147 // no_condition value (-2). As long as tests for no_condition check |
| 148 // for condition < 0, this will work as expected. | 148 // for condition < 0, this will work as expected. |
| 149 inline Condition NegateCondition(Condition cc); | 149 inline Condition NegateCondition(Condition cc) { |
| 150 return static_cast<Condition>(cc ^ 1); |
| 151 } |
| 152 |
| 150 | 153 |
| 151 // Corresponds to transposing the operands of a comparison. | 154 // Corresponds to transposing the operands of a comparison. |
| 152 inline Condition ReverseCondition(Condition cc) { | 155 inline Condition ReverseCondition(Condition cc) { |
| 153 switch (cc) { | 156 switch (cc) { |
| 154 case below: | 157 case below: |
| 155 return above; | 158 return above; |
| 156 case above: | 159 case above: |
| 157 return below; | 160 return below; |
| 158 case above_equal: | 161 case above_equal: |
| 159 return below_equal; | 162 return below_equal; |
| 160 case below_equal: | 163 case below_equal: |
| 161 return above_equal; | 164 return above_equal; |
| 162 case less: | 165 case less: |
| 163 return greater; | 166 return greater; |
| 164 case greater: | 167 case greater: |
| 165 return less; | 168 return less; |
| 166 case greater_equal: | 169 case greater_equal: |
| 167 return less_equal; | 170 return less_equal; |
| 168 case less_equal: | 171 case less_equal: |
| 169 return greater_equal; | 172 return greater_equal; |
| 170 default: | 173 default: |
| 171 return cc; | 174 return cc; |
| 172 }; | 175 }; |
| 173 } | 176 } |
| 174 | 177 |
| 178 |
| 175 enum Hint { | 179 enum Hint { |
| 176 no_hint = 0, | 180 no_hint = 0, |
| 177 not_taken = 0x2e, | 181 not_taken = 0x2e, |
| 178 taken = 0x3e | 182 taken = 0x3e |
| 179 }; | 183 }; |
| 180 | 184 |
| 185 |
| 181 // The result of negating a hint is as if the corresponding condition | 186 // The result of negating a hint is as if the corresponding condition |
| 182 // were negated by NegateCondition. That is, no_hint is mapped to | 187 // were negated by NegateCondition. That is, no_hint is mapped to |
| 183 // itself and not_taken and taken are mapped to each other. | 188 // itself and not_taken and taken are mapped to each other. |
| 184 inline Hint NegateHint(Hint hint) { | 189 inline Hint NegateHint(Hint hint) { |
| 185 return (hint == no_hint) | 190 return (hint == no_hint) |
| 186 ? no_hint | 191 ? no_hint |
| 187 : ((hint == not_taken) ? taken : not_taken); | 192 : ((hint == not_taken) ? taken : not_taken); |
| 188 } | 193 } |
| 189 | 194 |
| 190 | 195 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 private: | 958 private: |
| 954 Assembler* assembler_; | 959 Assembler* assembler_; |
| 955 #ifdef DEBUG | 960 #ifdef DEBUG |
| 956 int space_before_; | 961 int space_before_; |
| 957 #endif | 962 #endif |
| 958 }; | 963 }; |
| 959 | 964 |
| 960 } } // namespace v8::internal | 965 } } // namespace v8::internal |
| 961 | 966 |
| 962 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 967 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |