Commit c577727f by Jim Stichnoth

Subzero: Fix frame size for floating-point register out-args.

The code that calculates maximum out-arg stack space was neglecting the fact that on x86-64, the first N scalar floating-point arguments are passed through xmm registers, not the stack. As a result, stack frames were sometimes larger than necessary. BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/2076663006 .
parent e450656d
......@@ -7020,6 +7020,9 @@ uint32_t TargetX86Base<TraitsType>::getCallStackArgumentsSizeBytes(
assert(typeWidthInBytes(Ty) >= 4);
if (isVectorType(Ty) && XmmArgCount < Traits::X86_MAX_XMM_ARGS) {
++XmmArgCount;
} else if (isScalarFloatingType(Ty) && Traits::X86_PASS_SCALAR_FP_IN_XMM &&
XmmArgCount < Traits::X86_MAX_XMM_ARGS) {
++XmmArgCount;
} else if (isScalarIntegerType(Ty) &&
GprArgCount < Traits::X86_MAX_GPR_ARGS) {
// The 64 bit ABI allows some integers to be passed in GPRs.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment