This patch is an experimental implementation of multi-target clones
clones for Fortran, allowing the use of the `TARGET_CLONES` attribute.
It is designed to work with the syntax like:
`!GCC$ ATTRIBUTES TARGET_CLONES("default", "avx", "avx512f") :: MySub`
It is now worked with both `SUBROUTINE` and `FUNCTION`, using
infrastructures provided by the GCC. Here is a brief request for
comments (RFC) on the implementation:
- Which syntax is preferred for the attribute? For now I've
implemented C-like syntax, which supports single or multiple quotes
wrapped strings splitted by commas.
- The difference between Fortran and C/C++ ABI in generating decls.
Eg. Fortran functions in `CONTAINS` block are not public or
regarded as in file scope. Which leads to generating counters
before processing multiple-targets, and leads to
`somefunc.1.default` like names.
- The binding result in readelf's symbol table is different.
While C/C++ generates `WEAK` resolver functions, but Fortran gives
a `LOCAL` one while in `CONTAINS` block.
If upstreams have any suggestions or comments, please let me know!
ZAMBAR (2):
Fortran: target clones basic support
Fortran: removed RTL at function start
gcc/fortran/decl.cc | 116 ++++++++++++++++++++++++++++++++++++++
gcc/fortran/f95-lang.cc | 34 +++++++++++
gcc/fortran/gfortran.h | 5 ++
gcc/fortran/symbol.cc | 8 +++
gcc/fortran/trans-decl.cc | 26 ++++++++-
5 files changed, 187 insertions(+), 2 deletions(-)
--
2.34.1