[Bug target/77270] Flag -mprftchw is shared with 3dnow for -march=k8

vekumar at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Aug 21 07:31:00 GMT 2016


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

vekumar at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vekumar at gcc dot gnu.org

--- Comment #8 from vekumar at gcc dot gnu.org ---
There are 2 issues .

#issue1 
-mprfchw should be enabled only for targets that supports (3DNowprefetch).
On K8, 3DNowprefetch is not available and -march=k8 should not set this flag.

I can see behavior now corrected with Uros flag. 
Although I have to verify changes done other targets. 

#2 issue2
prefetchw ISA is also available in 3DNow!. Generating prefetchw by the GCC
backend is functionally correct if write prefetches are requested.

Looking at the test case why write prefetches are requested.

void f() {
    extern int size;
    int i;
    float * fvec;
    float * fptr = (float *) get();
    for(i = 0; i < size; ++i)
        fvec[i] = fptr[i];
    get();
}

I have to keep one more call statement so that "fvec" definition is not killed. 
prefetchw is generated for memory stores via fvec.  They are written only.


More information about the Gcc-bugs mailing list