Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 no_condition = -1, | 111 no_condition = -1, |
| 112 | 112 |
| 113 overflow = 0, | 113 overflow = 0, |
| 114 no_overflow = 1, | 114 no_overflow = 1, |
| 115 below = 2, | 115 below = 2, |
| 116 above_equal = 3, | 116 above_equal = 3, |
| 117 equal = 4, | 117 equal = 4, |
| 118 not_equal = 5, | 118 not_equal = 5, |
| 119 below_equal = 6, | 119 below_equal = 6, |
| 120 above = 7, | 120 above = 7, |
| 121 sign = 8, | 121 negative = 8, |
| 122 not_sign = 9, | 122 positive = 9, |
| 123 parity_even = 10, | 123 parity_even = 10, |
| 124 parity_odd = 11, | 124 parity_odd = 11, |
| 125 less = 12, | 125 less = 12, |
| 126 greater_equal = 13, | 126 greater_equal = 13, |
| 127 less_equal = 14, | 127 less_equal = 14, |
| 128 greater = 15, | 128 greater = 15, |
| 129 | 129 |
| 130 // aliases | 130 // aliases |
| 131 carry = below, | |
| 132 not_carry = above_equal, | |
| 131 zero = equal, | 133 zero = equal, |
| 132 not_zero = not_equal, | 134 not_zero = not_equal, |
| 133 negative = sign, | 135 sign = negative, |
| 134 positive = not_sign | 136 not_sign = positive |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 | 139 |
| 138 // Returns the equivalent of !cc. | 140 // Returns the equivalent of !cc. |
| 139 // Negation of the default no_condition (-1) results in a non-default | 141 // Negation of the default no_condition (-1) results in a non-default |
| 140 // no_condition value (-2). As long as tests for no_condition check | 142 // no_condition value (-2). As long as tests for no_condition check |
| 141 // for condition < 0, this will work as expected. | 143 // for condition < 0, this will work as expected. |
| 142 inline Condition NegateCondition(Condition cc); | 144 inline Condition NegateCondition(Condition cc); |
| 143 | 145 |
| 144 // Corresponds to transposing the operands of a comparison. | 146 // Corresponds to transposing the operands of a comparison. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 // | 278 // |
| 277 // next field: position of next displacement in the chain (0 = end of list) | 279 // next field: position of next displacement in the chain (0 = end of list) |
| 278 // type field: instruction type | 280 // type field: instruction type |
| 279 // | 281 // |
| 280 // A next value of null (0) indicates the end of a chain (note that there can | 282 // A next value of null (0) indicates the end of a chain (note that there can |
| 281 // be no displacement at position zero, because there is always at least one | 283 // be no displacement at position zero, because there is always at least one |
| 282 // instruction byte before the displacement). | 284 // instruction byte before the displacement). |
| 283 // | 285 // |
| 284 // Displacement _data field layout | 286 // Displacement _data field layout |
| 285 // | 287 // |
| 286 // |31.....1| ......0| | 288 // |31.....2|1......0| |
| 287 // [ next | type | | 289 // [ next | type | |
| 288 | 290 |
| 289 class Displacement BASE_EMBEDDED { | 291 class Displacement BASE_EMBEDDED { |
| 290 public: | 292 public: |
| 291 enum Type { | 293 enum Type { |
| 292 UNCONDITIONAL_JUMP, | 294 UNCONDITIONAL_JUMP, |
| 295 CODE_RELATIVE, | |
| 293 OTHER | 296 OTHER |
| 294 }; | 297 }; |
| 295 | 298 |
| 296 int data() const { return data_; } | 299 int data() const { return data_; } |
| 297 Type type() const { return TypeField::decode(data_); } | 300 Type type() const { return TypeField::decode(data_); } |
| 298 void next(Label* L) const { | 301 void next(Label* L) const { |
| 299 int n = NextField::decode(data_); | 302 int n = NextField::decode(data_); |
| 300 n > 0 ? L->link_to(n) : L->Unuse(); | 303 n > 0 ? L->link_to(n) : L->Unuse(); |
| 301 } | 304 } |
| 302 void link_to(Label* L) { init(L, type()); } | 305 void link_to(Label* L) { init(L, type()); } |
| 303 | 306 |
| 304 explicit Displacement(int data) { data_ = data; } | 307 explicit Displacement(int data) { data_ = data; } |
| 305 | 308 |
| 306 Displacement(Label* L, Type type) { init(L, type); } | 309 Displacement(Label* L, Type type) { init(L, type); } |
| 307 | 310 |
| 308 void print() { | 311 void print() { |
| 309 PrintF("%s (%x) ", (type() == UNCONDITIONAL_JUMP ? "jmp" : "[other]"), | 312 PrintF("%s (%x) ", (type() == UNCONDITIONAL_JUMP ? "jmp" : "[other]"), |
| 310 NextField::decode(data_)); | 313 NextField::decode(data_)); |
| 311 } | 314 } |
| 312 | 315 |
| 313 private: | 316 private: |
| 314 int data_; | 317 int data_; |
| 315 | 318 |
| 316 class TypeField: public BitField<Type, 0, 1> {}; | 319 class TypeField: public BitField<Type, 0, 2> {}; |
| 317 class NextField: public BitField<int, 1, 32-1> {}; | 320 class NextField: public BitField<int, 2, 32-2> {}; |
| 318 | 321 |
| 319 void init(Label* L, Type type); | 322 void init(Label* L, Type type); |
| 320 }; | 323 }; |
| 321 | 324 |
| 322 | 325 |
| 323 | 326 |
| 324 // CpuFeatures keeps track of which features are supported by the target CPU. | 327 // CpuFeatures keeps track of which features are supported by the target CPU. |
| 325 // Supported features must be enabled by a Scope before use. | 328 // Supported features must be enabled by a Scope before use. |
| 326 // Example: | 329 // Example: |
| 327 // if (CpuFeatures::IsSupported(SSE2)) { | 330 // if (CpuFeatures::IsSupported(SSE2)) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 // Stack | 436 // Stack |
| 434 void pushad(); | 437 void pushad(); |
| 435 void popad(); | 438 void popad(); |
| 436 | 439 |
| 437 void pushfd(); | 440 void pushfd(); |
| 438 void popfd(); | 441 void popfd(); |
| 439 | 442 |
| 440 void push(const Immediate& x); | 443 void push(const Immediate& x); |
| 441 void push(Register src); | 444 void push(Register src); |
| 442 void push(const Operand& src); | 445 void push(const Operand& src); |
| 446 void push(Label* label, RelocInfo::Mode relocation_mode = RelocInfo::NONE); | |
|
Erik Corry
2008/11/21 13:03:04
This should be without a default argument to help
Lasse Reichstein
2008/11/24 08:32:33
Indeed this actually hid an error where push(0) wa
| |
| 443 | 447 |
| 444 void pop(Register dst); | 448 void pop(Register dst); |
| 445 void pop(const Operand& dst); | 449 void pop(const Operand& dst); |
| 446 | 450 |
| 447 void enter(const Immediate& size); | 451 void enter(const Immediate& size); |
| 448 void leave(); | 452 void leave(); |
| 449 | 453 |
| 450 // Moves | 454 // Moves |
| 451 void mov_b(Register dst, const Operand& src); | 455 void mov_b(Register dst, const Operand& src); |
| 452 void mov_b(const Operand& dst, int8_t imm8); | 456 void mov_b(const Operand& dst, int8_t imm8); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 | 538 |
| 535 void shld(Register dst, const Operand& src); | 539 void shld(Register dst, const Operand& src); |
| 536 | 540 |
| 537 void shl(Register dst, uint8_t imm8); | 541 void shl(Register dst, uint8_t imm8); |
| 538 void shl(Register dst); | 542 void shl(Register dst); |
| 539 | 543 |
| 540 void shrd(Register dst, const Operand& src); | 544 void shrd(Register dst, const Operand& src); |
| 541 | 545 |
| 542 void shr(Register dst, uint8_t imm8); | 546 void shr(Register dst, uint8_t imm8); |
| 543 void shr(Register dst); | 547 void shr(Register dst); |
| 548 void shr_cl(Register dst); | |
| 544 | 549 |
| 545 void sub(const Operand& dst, const Immediate& x); | 550 void sub(const Operand& dst, const Immediate& x); |
| 546 void sub(Register dst, const Operand& src); | 551 void sub(Register dst, const Operand& src); |
| 547 void sub(const Operand& dst, Register src); | 552 void sub(const Operand& dst, Register src); |
| 548 | 553 |
| 549 void test(Register reg, const Immediate& imm); | 554 void test(Register reg, const Immediate& imm); |
| 550 void test(Register reg, const Operand& op); | 555 void test(Register reg, const Operand& op); |
| 551 void test(const Operand& op, const Immediate& imm); | 556 void test(const Operand& op, const Immediate& imm); |
| 552 | 557 |
| 553 void xor_(Register dst, int32_t imm32); | 558 void xor_(Register dst, int32_t imm32); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 private: | 815 private: |
| 811 Assembler* assembler_; | 816 Assembler* assembler_; |
| 812 #ifdef DEBUG | 817 #ifdef DEBUG |
| 813 int space_before_; | 818 int space_before_; |
| 814 #endif | 819 #endif |
| 815 }; | 820 }; |
| 816 | 821 |
| 817 } } // namespace v8::internal | 822 } } // namespace v8::internal |
| 818 | 823 |
| 819 #endif // V8_ASSEMBLER_IA32_H_ | 824 #endif // V8_ASSEMBLER_IA32_H_ |
| OLD | NEW |