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

            Bug ID: 100093
           Summary: different behavior between -mtune=cpu_type and
                    target_attribute (“arch=cputype”)
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
                CC: hjl.tools at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-*-* i?86-*-*

Refer to https://godbolt.org/z/31nv3T8Tf

__attribute__((target("tune=skylake-avx512")))
void fill_avx2(double *__restrict__ data, int n, double value)
{
    for (int i = 0; i < n * 16; i++) {
        data[i] = value;
    }
}

Shouldn't command line gcc -O3 -march=znver1 generate same codes gcc -O3
-march=znver1 -mtune=skylake-avx512?

Reply via email to