Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

There may be ABI compatibility issues prior to commit b29f052. #128

Open
the-die opened this issue Apr 24, 2023 · 0 comments
Open

There may be ABI compatibility issues prior to commit b29f052. #128

the-die opened this issue Apr 24, 2023 · 0 comments

Comments

@the-die
Copy link

the-die commented Apr 24, 2023

System V ABI 3.5.7 When a function taking variable-arguments is called, %al must be set to the total number of floating point parameters passed to the function in vector registers.
So variable argument tests with floating-point parameters may fail on some platforms.
Before commit b29f052 changing code

if (depth % 2 == 0) {
  println("  call *%%rax");
} else {
  println("  sub $8, %%rsp");
  println("  call *%%rax");
  println("  add $8, %%rsp");
}

to code

if (depth % 2 == 0) {
  println("  mov %%rax, %%r10");
  println("  mov $%d, %%rax", fp);
  println("  call *%%r10");
} else {
  println("  sub $8, %%rsp");
  println("  mov %%rax, %%r10");
  println("  mov $%d, %%rax", fp);
  println("  call *%%r10");
  println("  add $8, %%rsp");
}

can fix this issue.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant