https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67406

--- Comment #4 from vincenzo Innocente <vincenzo.innocente at cern dot ch> ---
#pragma omp declare simd notinbranch
float __attribute__ ((__target__ ("default")))
fma(float x,float y, float z) {
   return x+y*z;
}
#pragma omp declare simd notinbranch
float __attribute__ ((__target__ ("arch=haswell")))
fma(float x,float y, float z) {
   return x+y*z;
}
#pragma omp declare simd notinbranch
float __attribute__ ((__target__ ("arch=bdver1")))
fma(float x,float y, float z) {
   return x+y*z;
}

seems to generate a real fat library
c++ -Ofast -fopenmp -S simdCloning.cc; grep fmafff simdCloning.s
        .globl __Z3fmafff
__Z3fmafff:
        .globl __Z3fmafff.arch_haswell
__Z3fmafff.arch_haswell:
        .globl __Z3fmafff.arch_bdver1
__Z3fmafff.arch_bdver1:
        .globl __ZGVbN4vvv__Z3fmafff.arch_bdver1
__ZGVbN4vvv__Z3fmafff.arch_bdver1:
        .globl __ZGVcN8vvv__Z3fmafff.arch_bdver1
__ZGVcN8vvv__Z3fmafff.arch_bdver1:
        .globl __ZGVdN8vvv__Z3fmafff.arch_bdver1
__ZGVdN8vvv__Z3fmafff.arch_bdver1:
        .globl __ZGVbN4vvv__Z3fmafff.arch_haswell
__ZGVbN4vvv__Z3fmafff.arch_haswell:
        .globl __ZGVcN8vvv__Z3fmafff.arch_haswell
__ZGVcN8vvv__Z3fmafff.arch_haswell:
        .globl __ZGVdN8vvv__Z3fmafff.arch_haswell
__ZGVdN8vvv__Z3fmafff.arch_haswell:
        .globl __ZGVbN4vvv__Z3fmafff
__ZGVbN4vvv__Z3fmafff:
        .globl __ZGVcN8vvv__Z3fmafff
__ZGVcN8vvv__Z3fmafff:
        .globl __ZGVdN8vvv__Z3fmafff
__ZGVdN8vvv__Z3fmafff:

have now to test that it uses the correct one!

Reply via email to