Hi gcc-patches mailing list,
Saurabh Jha <[email protected]> has requested that the following 
forgejo pull request
be published on the mailing list.

Created on: 2025-10-28 12:52:52+00:00
Latest update: 2025-10-28 13:06:28+00:00
Changes: 16 changed files, 716 additions, 23 deletions
Head revision: saurabh.jha/gcc-TEST ref mingw-data-types-abi commit 
350a5e6f20a26298de8ae24ec3de798d1bdb46b1
Base revision: gcc/gcc-TEST ref trunk commit 
f6eb93dec5d355933cd0478db6bf43dfdb3aad06 r16-4692-gf6eb93dec5d355
Merge base: f6eb93dec5d355933cd0478db6bf43dfdb3aad06
Full diff url: https://forge.sourceware.org/gcc/gcc-TEST/pulls/118.diff
Discussion:  https://forge.sourceware.org/gcc/gcc-TEST/pulls/118
Requested Reviewers:

Hey,

This work is done on top of this patch:
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/691216.html.

This patch series makes two changes specific to the aarch64-w64-mingw32 target:
1. Make long double 8 bytes. This is done in the second commit.
2. Add support for variadic ABI. This is done in the third commit.

The documentation for ARM64 Windows ABI is here:
https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions.

In order to test changes for this target, we need to add support for the
new target in check-function-bodies function in scanasm.exp. This is
done in the first commit.

Regression tested on two targets:
1. aarch64-unknown-linux-gnu
2. aarch64-w64-mingw32

Built aarch64-unknown-linux-gnu natively and found no regressions.

For aarch64-w64-mingw32, I built a cross compiler with host and build
aarch64-unknown-linux-gnu and target aarch64-w64-mingw32. I built the
compiler in two stages using the following steps:
1. Build binutils for aarch64-w64-mingw32 target using the native
aarch64-unknown-linux-gnu compiler.
2. Build mingw headers, which just involves placing header files in the
right directories.
3. Build gcc using binutils from step 1 and the native
aarch64-unknown-linux-gnu compiler.
4. Build mingw-crt using gcc from step 3.
5. Build mingw-winpthreads using gcc from step 3.
6. Build gcc that uses mingw-crt and mingw-winpthreads from previous
steps and using native gcc.
7. Build mingw using gcc from step 6.

For master, it fails on step 4 because mingw-crt needs long double to be
8 bytes. So I couldn't run regression tests for aarch64-w64-mingw32 on
master. After these commits are applied, the test summary looks like
this.

# of expected passes            312151
# of unexpected failures        55879
# of unexpected successes       6
# of expected failures          1667
# of unresolved testcases       1413
# of unsupported tests          7384

We have some way to go to achieve parity with aarch64-unknown-linux-gnu
and the future work should make these numbers better.

Ok for master?

Thanks,
Saurabh

Saurabh Jha (3):
  mingw: emit end of procedure directive as comment
  aarch64: mingw: Make long double 64 bit
  aarch64: mingw: Implement support for variadic ABI

 gcc/config/aarch64/aarch64-builtins.cc        |  33 ++
 gcc/config/aarch64/aarch64-coff.h             |  17 +-
 gcc/config/aarch64/aarch64-protos.h           |   1 +
 gcc/config/aarch64/aarch64.cc                 | 354 +++++++++++++++++-
 gcc/config/aarch64/aarch64.h                  |  11 +
 gcc/config/aarch64/cygming.h                  |  13 +-
 gcc/config/mingw/winnt.cc                     |  22 ++
 gcc/config/mingw/winnt.h                      |   1 +
 .../aarch64/mingw/long_double_size.c          |  25 ++
 .../gcc.target/aarch64/mingw/mingw.exp        |  41 ++
 .../gcc.target/aarch64/mingw/variadic_hfa.c   |  71 ++++
 .../gcc.target/aarch64/mingw/variadic_hva.c   |  89 +++++
 .../gcc.target/aarch64/mingw/variadic_int.c   |  41 ++
 gcc/testsuite/lib/scanasm.exp                 |   2 +
 libgfortran/configure                         |  10 +-
 libgfortran/configure.ac                      |   7 +-
 16 files changed, 715 insertions(+), 23 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c


Changed files:
- A: gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c
- A: gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp
- A: gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c
- A: gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c
- A: gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c
- M: gcc/config/aarch64/aarch64-builtins.cc
- M: gcc/config/aarch64/aarch64-coff.h
- M: gcc/config/aarch64/aarch64-protos.h
- M: gcc/config/aarch64/aarch64.cc
- M: gcc/config/aarch64/aarch64.h
- M: gcc/config/aarch64/cygming.h
- M: gcc/config/mingw/winnt.cc
- M: gcc/config/mingw/winnt.h
- M: gcc/testsuite/lib/scanasm.exp
- M: libgfortran/configure
- M: libgfortran/configure.ac


Saurabh Jha (3):
  mingw: emit end of procedure directive as comment
  aarch64: mingw: Make long double 64 bit
  aarch64: mingw: Implement support for variadic ABI

 gcc/config/aarch64/aarch64-builtins.cc        |  33 ++
 gcc/config/aarch64/aarch64-coff.h             |  18 +-
 gcc/config/aarch64/aarch64-protos.h           |   1 +
 gcc/config/aarch64/aarch64.cc                 | 354 +++++++++++++++++-
 gcc/config/aarch64/aarch64.h                  |  11 +
 gcc/config/aarch64/cygming.h                  |  13 +-
 gcc/config/mingw/winnt.cc                     |  22 ++
 gcc/config/mingw/winnt.h                      |   1 +
 .../aarch64/mingw/long_double_size.c          |  25 ++
 .../gcc.target/aarch64/mingw/mingw.exp        |  41 ++
 .../gcc.target/aarch64/mingw/variadic_hfa.c   |  71 ++++
 .../gcc.target/aarch64/mingw/variadic_hva.c   |  89 +++++
 .../gcc.target/aarch64/mingw/variadic_int.c   |  41 ++
 gcc/testsuite/lib/scanasm.exp                 |   2 +
 libgfortran/configure                         |  10 +-
 libgfortran/configure.ac                      |   7 +-
 16 files changed, 716 insertions(+), 23 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/long_double_size.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/mingw.exp
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_hfa.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_hva.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/mingw/variadic_int.c

-- 
2.51.1

Reply via email to