Commit 70c05ce8 authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[arm] Comply with hardfloat calling convention for double arguments.

The hardfloat calling convention reserves registers d0 to d7 for passing
double parameters, any parameters after that will be passed on the
stack.

We do not pass more than a couple of double parameters at a time when
calling C functions from generated code in V8, so this hasn't been an
issue but it could be in the future.

Change-Id: I44971ef0943894c201ddb908031ba9cf6fc0bc8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2507692Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#70985}
parent ff2993bb
......@@ -2372,16 +2372,18 @@ void TurboAssembler::FloatMinOutOfLine(DwVfpRegister result, DwVfpRegister left,
}
static const int kRegisterPassedArguments = 4;
// The hardfloat calling convention passes double arguments in registers d0-d7.
static const int kDoubleRegisterPassedArguments = 8;
int TurboAssembler::CalculateStackPassedWords(int num_reg_arguments,
int num_double_arguments) {
int stack_passed_words = 0;
if (use_eabi_hardfloat()) {
// In the hard floating point calling convention, we can use all double
// In the hard floating point calling convention, we can use the first 8
// registers to pass doubles.
if (num_double_arguments > DoubleRegister::SupportedRegisterCount()) {
if (num_double_arguments > kDoubleRegisterPassedArguments) {
stack_passed_words +=
2 * (num_double_arguments - DoubleRegister::SupportedRegisterCount());
2 * (num_double_arguments - kDoubleRegisterPassedArguments);
}
} else {
// In the soft floating point calling convention, every double
......
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