OLD | NEW |
---|---|
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 uint32_t SpillAreaPaddingBytes = 0; | 490 uint32_t SpillAreaPaddingBytes = 0; |
491 uint32_t LocalsSlotsPaddingBytes = 0; | 491 uint32_t LocalsSlotsPaddingBytes = 0; |
492 alignStackSpillAreas(Traits::X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes, | 492 alignStackSpillAreas(Traits::X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes, |
493 SpillAreaAlignmentBytes, GlobalsSize, | 493 SpillAreaAlignmentBytes, GlobalsSize, |
494 LocalsSlotsAlignmentBytes, &SpillAreaPaddingBytes, | 494 LocalsSlotsAlignmentBytes, &SpillAreaPaddingBytes, |
495 &LocalsSlotsPaddingBytes); | 495 &LocalsSlotsPaddingBytes); |
496 SpillAreaSizeBytes += SpillAreaPaddingBytes + LocalsSlotsPaddingBytes; | 496 SpillAreaSizeBytes += SpillAreaPaddingBytes + LocalsSlotsPaddingBytes; |
497 uint32_t GlobalsAndSubsequentPaddingSize = | 497 uint32_t GlobalsAndSubsequentPaddingSize = |
498 GlobalsSize + LocalsSlotsPaddingBytes; | 498 GlobalsSize + LocalsSlotsPaddingBytes; |
499 | 499 |
500 // Functions returning scalar floating point types may need to convert values | |
501 // from an in-register xmm value to the top of the x87 floating point stack. | |
502 // This is done by a movp[sd] and an fld[sd]. Ensure there is enough scratch | |
503 // space on the stack for this. | |
504 Type ReturnType = Func->getReturnType(); | |
Jim Stichnoth
2015/11/16 23:54:09
const
| |
505 if (isScalarFloatingType(ReturnType)) { | |
506 // Avoid misaligned double-precicion load/store. | |
507 NeedsStackAlignment = true; | |
508 SpillAreaSizeBytes = | |
509 std::max(typeWidthInBytesOnStack(ReturnType), SpillAreaSizeBytes); | |
510 } | |
511 | |
500 // Align esp if necessary. | 512 // Align esp if necessary. |
501 if (NeedsStackAlignment) { | 513 if (NeedsStackAlignment) { |
502 uint32_t StackOffset = | 514 uint32_t StackOffset = |
503 Traits::X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes; | 515 Traits::X86_RET_IP_SIZE_BYTES + PreservedRegsSizeBytes; |
504 uint32_t StackSize = | 516 uint32_t StackSize = |
505 Traits::applyStackAlignment(StackOffset + SpillAreaSizeBytes); | 517 Traits::applyStackAlignment(StackOffset + SpillAreaSizeBytes); |
506 SpillAreaSizeBytes = StackSize - StackOffset; | 518 SpillAreaSizeBytes = StackSize - StackOffset; |
507 } | 519 } |
508 | 520 |
509 // Generate "sub esp, SpillAreaSizeBytes" | 521 // Generate "sub esp, SpillAreaSizeBytes" |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
975 // case the high-level table has extra entries. | 987 // case the high-level table has extra entries. |
976 #define X(tag, sizeLog2, align, elts, elty, str) \ | 988 #define X(tag, sizeLog2, align, elts, elty, str) \ |
977 static_assert(_table1_##tag == _table2_##tag, \ | 989 static_assert(_table1_##tag == _table2_##tag, \ |
978 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); | 990 "Inconsistency between ICETYPEX8632_TABLE and ICETYPE_TABLE"); |
979 ICETYPE_TABLE | 991 ICETYPE_TABLE |
980 #undef X | 992 #undef X |
981 } // end of namespace dummy3 | 993 } // end of namespace dummy3 |
982 } // end of anonymous namespace | 994 } // end of anonymous namespace |
983 | 995 |
984 } // end of namespace Ice | 996 } // end of namespace Ice |
OLD | NEW |