Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: src/x64/assembler-x64.h

Issue 2825008: Move definition of NegateConditon from assembler*-inl.h files to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 sign = negative, 208 sign = negative,
209 not_sign = positive, 209 not_sign = positive,
210 last_condition = greater 210 last_condition = greater
211 }; 211 };
212 212
213 213
214 // Returns the equivalent of !cc. 214 // Returns the equivalent of !cc.
215 // Negation of the default no_condition (-1) results in a non-default 215 // Negation of the default no_condition (-1) results in a non-default
216 // no_condition value (-2). As long as tests for no_condition check 216 // no_condition value (-2). As long as tests for no_condition check
217 // for condition < 0, this will work as expected. 217 // for condition < 0, this will work as expected.
218 inline Condition NegateCondition(Condition cc); 218 inline Condition NegateCondition(Condition cc) {
219 return static_cast<Condition>(cc ^ 1);
220 }
221
219 222
220 // Corresponds to transposing the operands of a comparison. 223 // Corresponds to transposing the operands of a comparison.
221 inline Condition ReverseCondition(Condition cc) { 224 inline Condition ReverseCondition(Condition cc) {
222 switch (cc) { 225 switch (cc) {
223 case below: 226 case below:
224 return above; 227 return above;
225 case above: 228 case above:
226 return below; 229 return below;
227 case above_equal: 230 case above_equal:
228 return below_equal; 231 return below_equal;
229 case below_equal: 232 case below_equal:
230 return above_equal; 233 return above_equal;
231 case less: 234 case less:
232 return greater; 235 return greater;
233 case greater: 236 case greater:
234 return less; 237 return less;
235 case greater_equal: 238 case greater_equal:
236 return less_equal; 239 return less_equal;
237 case less_equal: 240 case less_equal:
238 return greater_equal; 241 return greater_equal;
239 default: 242 default:
240 return cc; 243 return cc;
241 }; 244 };
242 } 245 }
243 246
247
244 enum Hint { 248 enum Hint {
245 no_hint = 0, 249 no_hint = 0,
246 not_taken = 0x2e, 250 not_taken = 0x2e,
247 taken = 0x3e 251 taken = 0x3e
248 }; 252 };
249 253
250 // The result of negating a hint is as if the corresponding condition 254 // The result of negating a hint is as if the corresponding condition
251 // were negated by NegateCondition. That is, no_hint is mapped to 255 // were negated by NegateCondition. That is, no_hint is mapped to
252 // itself and not_taken and taken are mapped to each other. 256 // itself and not_taken and taken are mapped to each other.
253 inline Hint NegateHint(Hint hint) { 257 inline Hint NegateHint(Hint hint) {
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 private: 1415 private:
1412 Assembler* assembler_; 1416 Assembler* assembler_;
1413 #ifdef DEBUG 1417 #ifdef DEBUG
1414 int space_before_; 1418 int space_before_;
1415 #endif 1419 #endif
1416 }; 1420 };
1417 1421
1418 } } // namespace v8::internal 1422 } } // namespace v8::internal
1419 1423
1420 #endif // V8_X64_ASSEMBLER_X64_H_ 1424 #endif // V8_X64_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698