| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // doing certain constant folds, which may significantly reduce the | 56 // doing certain constant folds, which may significantly reduce the |
| 57 // code generated for some assembly instructions (because they boil down | 57 // code generated for some assembly instructions (because they boil down |
| 58 // to a few constants). If this is a problem, we could change the code | 58 // to a few constants). If this is a problem, we could change the code |
| 59 // such that we use an enum in optimized mode, and the struct in debug | 59 // such that we use an enum in optimized mode, and the struct in debug |
| 60 // mode. This way we get the compile-time error checking in debug mode | 60 // mode. This way we get the compile-time error checking in debug mode |
| 61 // and best performance in optimized code. | 61 // and best performance in optimized code. |
| 62 // | 62 // |
| 63 struct Register { | 63 struct Register { |
| 64 bool is_valid() const { return 0 <= code_ && code_ < 8; } | 64 bool is_valid() const { return 0 <= code_ && code_ < 8; } |
| 65 bool is(Register reg) const { return code_ == reg.code_; } | 65 bool is(Register reg) const { return code_ == reg.code_; } |
| 66 // eax, ebx, ecx and edx are byte registers, the rest are not. |
| 67 bool is_byte_register() const { return code_ <= 3; } |
| 66 int code() const { | 68 int code() const { |
| 67 ASSERT(is_valid()); | 69 ASSERT(is_valid()); |
| 68 return code_; | 70 return code_; |
| 69 } | 71 } |
| 70 int bit() const { | 72 int bit() const { |
| 71 ASSERT(is_valid()); | 73 ASSERT(is_valid()); |
| 72 return 1 << code_; | 74 return 1 << code_; |
| 73 } | 75 } |
| 74 | 76 |
| 75 // (unfortunately we can't make this private in a struct) | 77 // (unfortunately we can't make this private in a struct) |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 void ftst(); | 674 void ftst(); |
| 673 void fucomp(int i); | 675 void fucomp(int i); |
| 674 void fucompp(); | 676 void fucompp(); |
| 675 void fcompp(); | 677 void fcompp(); |
| 676 void fnstsw_ax(); | 678 void fnstsw_ax(); |
| 677 void fwait(); | 679 void fwait(); |
| 678 | 680 |
| 679 void frndint(); | 681 void frndint(); |
| 680 | 682 |
| 681 void sahf(); | 683 void sahf(); |
| 684 void setcc(Condition cc, Register reg); |
| 682 | 685 |
| 683 void cpuid(); | 686 void cpuid(); |
| 684 | 687 |
| 685 // SSE2 instructions | 688 // SSE2 instructions |
| 686 void cvttss2si(Register dst, const Operand& src); | 689 void cvttss2si(Register dst, const Operand& src); |
| 687 void cvttsd2si(Register dst, const Operand& src); | 690 void cvttsd2si(Register dst, const Operand& src); |
| 688 | 691 |
| 689 void cvtsi2sd(XMMRegister dst, const Operand& src); | 692 void cvtsi2sd(XMMRegister dst, const Operand& src); |
| 690 | 693 |
| 691 void addsd(XMMRegister dst, XMMRegister src); | 694 void addsd(XMMRegister dst, XMMRegister src); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 private: | 845 private: |
| 843 Assembler* assembler_; | 846 Assembler* assembler_; |
| 844 #ifdef DEBUG | 847 #ifdef DEBUG |
| 845 int space_before_; | 848 int space_before_; |
| 846 #endif | 849 #endif |
| 847 }; | 850 }; |
| 848 | 851 |
| 849 } } // namespace v8::internal | 852 } } // namespace v8::internal |
| 850 | 853 |
| 851 #endif // V8_ASSEMBLER_IA32_H_ | 854 #endif // V8_ASSEMBLER_IA32_H_ |
| OLD | NEW |