On Sat, 5 Nov 2022 08:40:06 +0100 Thomas Koenig wrote: > On 04.11.22 21:59, Bernhard Reutner-Fischer via Fortran wrote: > > And not sure if fellow gfortraners would accept this attribute > > target_clones in there in the first place.. > > It might actually be useful. Is there any change about > the calling sequence or anything else that should be visible > in a Fortran module or the calling sequence? The module interface remains the same. And the call sequence remains the same, too. For a user nothing changes. An example: module m implicit none contains subroutine sub1() !GCC$ ATTRIBUTES target_clones("avx", "sse","default") :: sub1 print *, 4321 end end module m This used to compiles to: $ nm /tmp/pristine.o U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_integer_write 0000000000000000 T __m_MOD_sub1 And now compiles to: $ nm /tmp/new.o U __cpu_indicator_init U __cpu_model U _gfortran_st_write U _gfortran_st_write_done U _gfortran_transfer_integer_write 0000000000000000 i __m_MOD_sub1 000000000000006e t __m_MOD_sub1.avx 0000000000000000 t __m_MOD_sub1.default 0000000000000000 W __m_MOD_sub1.resolver 00000000000000dc t __m_MOD_sub1.sse I.e. the caller still calls __m_MOD_sub1 But this is now an ifunc, which looks at the cpu bits and dispatches to the appropriate ISA version. I'm attaching the assembler input for reference. If you think that we want to add support for that attribute, i can submit a proper patch. Just let me know please. thanks,