| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 SMI_CODE_INLINED | 612 SMI_CODE_INLINED |
| 613 }; | 613 }; |
| 614 | 614 |
| 615 | 615 |
| 616 class GenericBinaryOpStub: public CodeStub { | 616 class GenericBinaryOpStub: public CodeStub { |
| 617 public: | 617 public: |
| 618 GenericBinaryOpStub(Token::Value op, | 618 GenericBinaryOpStub(Token::Value op, |
| 619 OverwriteMode mode, | 619 OverwriteMode mode, |
| 620 GenericBinaryFlags flags) | 620 GenericBinaryFlags flags) |
| 621 : op_(op), mode_(mode), flags_(flags) { | 621 : op_(op), mode_(mode), flags_(flags) { |
| 622 use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); |
| 622 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 623 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 623 } | 624 } |
| 624 | 625 |
| 625 void GenerateSmiCode(MacroAssembler* masm, Label* slow); | 626 void GenerateSmiCode(MacroAssembler* masm, Label* slow); |
| 626 | 627 |
| 627 private: | 628 private: |
| 628 Token::Value op_; | 629 Token::Value op_; |
| 629 OverwriteMode mode_; | 630 OverwriteMode mode_; |
| 630 GenericBinaryFlags flags_; | 631 GenericBinaryFlags flags_; |
| 632 bool use_sse3_; |
| 631 | 633 |
| 632 const char* GetName(); | 634 const char* GetName(); |
| 633 | 635 |
| 634 #ifdef DEBUG | 636 #ifdef DEBUG |
| 635 void Print() { | 637 void Print() { |
| 636 PrintF("GenericBinaryOpStub (op %s), (mode %d, flags %d)\n", | 638 PrintF("GenericBinaryOpStub (op %s), (mode %d, flags %d)\n", |
| 637 Token::String(op_), | 639 Token::String(op_), |
| 638 static_cast<int>(mode_), | 640 static_cast<int>(mode_), |
| 639 static_cast<int>(flags_)); | 641 static_cast<int>(flags_)); |
| 640 } | 642 } |
| 641 #endif | 643 #endif |
| 642 | 644 |
| 643 // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. | 645 // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. |
| 644 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | 646 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; |
| 645 class OpBits: public BitField<Token::Value, 2, 13> {}; | 647 class OpBits: public BitField<Token::Value, 2, 12> {}; |
| 648 class SSE3Bits: public BitField<bool, 14, 1> {}; |
| 646 class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; | 649 class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; |
| 647 | 650 |
| 648 Major MajorKey() { return GenericBinaryOp; } | 651 Major MajorKey() { return GenericBinaryOp; } |
| 649 int MinorKey() { | 652 int MinorKey() { |
| 650 // Encode the parameters in a unique 16 bit value. | 653 // Encode the parameters in a unique 16 bit value. |
| 651 return OpBits::encode(op_) | 654 return OpBits::encode(op_) |
| 652 | ModeBits::encode(mode_) | 655 | ModeBits::encode(mode_) |
| 653 | FlagBits::encode(flags_); | 656 | FlagBits::encode(flags_) |
| 657 | SSE3Bits::encode(use_sse3_); |
| 654 } | 658 } |
| 655 void Generate(MacroAssembler* masm); | 659 void Generate(MacroAssembler* masm); |
| 656 }; | 660 }; |
| 657 | 661 |
| 658 | 662 |
| 659 } } // namespace v8::internal | 663 } } // namespace v8::internal |
| 660 | 664 |
| 661 #endif // V8_X64_CODEGEN_X64_H_ | 665 #endif // V8_X64_CODEGEN_X64_H_ |
| OLD | NEW |