[Bug target/102811] vcvtph2ps and vcvtps2ph should be used to convert _Float16 to SFmode with -mf16c

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Nov 26 13:28:41 GMT 2021


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

--- Comment #11 from Hongtao.liu <crazylht at gmail dot com> ---

> The above dumps show inconsistendy for PEXTRW (it should be VPEXTRW) and
> also open a question, why unpatched gcc prefers memory temp instead of GPR
> temp for PEXTRW/PINSRW.
> 
Because RA thought memory is needed to move between GPR and SSE.
modified   gcc/config/i386/i386.c
@@ -19438,7 +19438,7 @@ inline_secondary_memory_needed (machine_mode mode,
reg_class_t class1,
        return true;

       /* In addition to SImode moves, AVX512FP16 also enables HImode moves. 
*/
-      int minsize = GET_MODE_SIZE (TARGET_AVX512FP16 ? HImode : SImode);
+      int minsize = GET_MODE_SIZE (TARGET_SSE2 ? HImode : SImode);

       if (msize < minsize)
> The patch improves HI/HFmode inserts to element 0 in general.


More information about the Gcc-bugs mailing list