| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 SMI_CODE_INLINED | 611 SMI_CODE_INLINED |
| 612 }; | 612 }; |
| 613 | 613 |
| 614 | 614 |
| 615 class GenericBinaryOpStub: public CodeStub { | 615 class GenericBinaryOpStub: public CodeStub { |
| 616 public: | 616 public: |
| 617 GenericBinaryOpStub(Token::Value op, | 617 GenericBinaryOpStub(Token::Value op, |
| 618 OverwriteMode mode, | 618 OverwriteMode mode, |
| 619 GenericBinaryFlags flags) | 619 GenericBinaryFlags flags) |
| 620 : op_(op), mode_(mode), flags_(flags) { | 620 : op_(op), mode_(mode), flags_(flags) { |
| 621 use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); |
| 621 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 622 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 622 } | 623 } |
| 623 | 624 |
| 624 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 625 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
| 625 | 626 |
| 626 private: | 627 private: |
| 627 Token::Value op_; | 628 Token::Value op_; |
| 628 OverwriteMode mode_; | 629 OverwriteMode mode_; |
| 629 GenericBinaryFlags flags_; | 630 GenericBinaryFlags flags_; |
| 631 bool use_sse3_; |
| 630 | 632 |
| 631 const char* GetName(); | 633 const char* GetName(); |
| 632 | 634 |
| 633 #ifdef DEBUG | 635 #ifdef DEBUG |
| 634 void Print() { | 636 void Print() { |
| 635 PrintF("GenericBinaryOpStub (op %s), (mode %d, flags %d)\n", | 637 PrintF("GenericBinaryOpStub (op %s), (mode %d, flags %d)\n", |
| 636 Token::String(op_), | 638 Token::String(op_), |
| 637 static_cast<int>(mode_), | 639 static_cast<int>(mode_), |
| 638 static_cast<int>(flags_)); | 640 static_cast<int>(flags_)); |
| 639 } | 641 } |
| 640 #endif | 642 #endif |
| 641 | 643 |
| 642 // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. | 644 // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. |
| 643 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | 645 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; |
| 644 class OpBits: public BitField<Token::Value, 2, 13> {}; | 646 class OpBits: public BitField<Token::Value, 2, 12> {}; |
| 647 class SSE3Bits: public BitField<bool, 14, 1> {}; |
| 645 class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; | 648 class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; |
| 646 | 649 |
| 647 Major MajorKey() { return GenericBinaryOp; } | 650 Major MajorKey() { return GenericBinaryOp; } |
| 648 int MinorKey() { | 651 int MinorKey() { |
| 649 // Encode the parameters in a unique 16 bit value. | 652 // Encode the parameters in a unique 16 bit value. |
| 650 return OpBits::encode(op_) | 653 return OpBits::encode(op_) |
| 651 | ModeBits::encode(mode_) | 654 | ModeBits::encode(mode_) |
| 652 | FlagBits::encode(flags_); | 655 | FlagBits::encode(flags_) |
| 656 | SSE3Bits::encode(use_sse3_); |
| 653 } | 657 } |
| 654 void Generate(MacroAssembler* masm); | 658 void Generate(MacroAssembler* masm); |
| 655 }; | 659 }; |
| 656 | 660 |
| 657 | 661 |
| 658 } } // namespace v8::internal | 662 } } // namespace v8::internal |
| 659 | 663 |
| 660 #endif // V8_IA32_CODEGEN_IA32_H_ | 664 #endif // V8_IA32_CODEGEN_IA32_H_ |
| OLD | NEW |