Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceTargetLoweringX8632Traits.h - x86-32 traits -*- C++ -*-=// | 1 //===- subzero/src/IceTargetLoweringX8632Traits.h - x86-32 traits -*- C++ -*-=// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 655 } | 655 } |
| 656 | 656 |
| 657 static int32_t getRaxOrDie() { | 657 static int32_t getRaxOrDie() { |
| 658 llvm::report_fatal_error("no rax in non-64-bit mode."); | 658 llvm::report_fatal_error("no rax in non-64-bit mode."); |
| 659 } | 659 } |
| 660 | 660 |
| 661 static int32_t getRdxOrDie() { | 661 static int32_t getRdxOrDie() { |
| 662 llvm::report_fatal_error("no rdx in non-64-bit mode."); | 662 llvm::report_fatal_error("no rdx in non-64-bit mode."); |
| 663 } | 663 } |
| 664 | 664 |
| 665 // x86-32 calling convention: | |
| 666 // | |
| 667 // * The first four arguments of vector type, regardless of their position | |
| 668 // relative to the other arguments in the argument list, are placed in | |
| 669 // registers xmm0 - xmm3. | |
| 670 // | |
| 671 // This intends to match the section "IA-32 Function Calling Convention" of | |
| 672 // the document "OS X ABI Function Call Guide" by Apple. | |
| 673 | |
| 665 /// The maximum number of arguments to pass in XMM registers | 674 /// The maximum number of arguments to pass in XMM registers |
| 666 static const uint32_t X86_MAX_XMM_ARGS = 4; | 675 static const uint32_t X86_MAX_XMM_ARGS = 4; |
| 667 /// The maximum number of arguments to pass in GPR registers | 676 /// The maximum number of arguments to pass in GPR registers |
| 668 static const uint32_t X86_MAX_GPR_ARGS = 0; | 677 static const uint32_t X86_MAX_GPR_ARGS = 0; |
| 678 /// Whether scalar floating point arguments are passed in XMM registers | |
| 679 static const bool X86_PASS_SCALAR_FP_IN_XMM = false; | |
|
Jim Stichnoth
2016/01/19 20:54:05
Can this be constexpr?
sehr
2016/01/19 21:47:35
Done.
| |
| 680 /// Get the register for a given argument slot in the XMM registers. | |
| 681 static inline int32_t getRegisterForXmmArgNum(uint32_t ArgNum) { | |
|
Jim Stichnoth
2016/01/19 20:54:05
Remove "inline" for consistency?
sehr
2016/01/19 21:47:35
Done.
| |
| 682 if (ArgNum >= X86_MAX_XMM_ARGS) { | |
| 683 return Variable::NoRegister; | |
| 684 } | |
| 685 return static_cast<int32_t>(RegisterSet::Reg_xmm0 + ArgNum); | |
|
Jim Stichnoth
2016/01/19 20:54:05
This would break if we for some reason decided to
sehr
2016/01/19 21:47:35
Done.
| |
| 686 } | |
| 687 /// Get the register for a given argument slot in the GPRs. | |
| 688 static inline int32_t getRegisterForGprArgNum(Type Ty, uint32_t ArgNum) { | |
| 689 assert(Ty == IceType_i64 || Ty == IceType_i32); | |
| 690 (void)Ty; | |
| 691 (void)ArgNum; | |
| 692 return Variable::NoRegister; | |
| 693 } | |
| 694 | |
| 669 /// The number of bits in a byte | 695 /// The number of bits in a byte |
| 670 static const uint32_t X86_CHAR_BIT = 8; | 696 static const uint32_t X86_CHAR_BIT = 8; |
| 671 /// Stack alignment. This is defined in IceTargetLoweringX8632.cpp because it | 697 /// Stack alignment. This is defined in IceTargetLoweringX8632.cpp because it |
| 672 /// is used as an argument to std::max(), and the default std::less<T> has an | 698 /// is used as an argument to std::max(), and the default std::less<T> has an |
| 673 /// operator(T const&, T const&) which requires this member to have an | 699 /// operator(T const&, T const&) which requires this member to have an |
| 674 /// address. | 700 /// address. |
| 675 static const uint32_t X86_STACK_ALIGNMENT_BYTES; | 701 static const uint32_t X86_STACK_ALIGNMENT_BYTES; |
| 676 /// Size of the return address on the stack | 702 /// Size of the return address on the stack |
| 677 static const uint32_t X86_RET_IP_SIZE_BYTES = 4; | 703 static const uint32_t X86_RET_IP_SIZE_BYTES = 4; |
| 678 /// The number of different NOP instructions | 704 /// The number of different NOP instructions |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 962 | 988 |
| 963 static uint8_t InstSegmentPrefixes[]; | 989 static uint8_t InstSegmentPrefixes[]; |
| 964 }; | 990 }; |
| 965 | 991 |
| 966 using Traits = ::Ice::X8632::TargetX8632Traits; | 992 using Traits = ::Ice::X8632::TargetX8632Traits; |
| 967 } // end of namespace X8632 | 993 } // end of namespace X8632 |
| 968 | 994 |
| 969 } // end of namespace Ice | 995 } // end of namespace Ice |
| 970 | 996 |
| 971 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H | 997 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H |
| OLD | NEW |