Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 1442753008: Reserve space for scalar FP returns in the stack frame (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add hyphen to comment Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/commutativity.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 27f9ae00064e6fc8f57fcce995becebd6c91eee1..24c22ff23a857800f1ac8622cebb29cd58e5afa3 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -497,6 +497,18 @@ void TargetX8632::addProlog(CfgNode *Node) {
uint32_t GlobalsAndSubsequentPaddingSize =
GlobalsSize + LocalsSlotsPaddingBytes;
+ // Functions returning scalar floating point types may need to convert values
+ // from an in-register xmm value to the top of the x87 floating point stack.
+ // This is done by a movp[sd] and an fld[sd]. Ensure there is enough scratch
+ // space on the stack for this.
+ Type ReturnType = Func->getReturnType();
Jim Stichnoth 2015/11/16 23:54:09 const
+ if (isScalarFloatingType(ReturnType)) {
+ // Avoid misaligned double-precicion load/store.
+ NeedsStackAlignment = true;
+ SpillAreaSizeBytes =
+ std::max(typeWidthInBytesOnStack(ReturnType), SpillAreaSizeBytes);
+ }
+
// Align esp if necessary.
if (NeedsStackAlignment) {
uint32_t StackOffset =
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/commutativity.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698