diff mbox series

[i386] : Fix PR 32413 in a correct way

Message ID CAFULd4Z-YcH6_tKYRL1HwaTKrc21-Np6+gC+0kGK8t8BcirzJQ@mail.gmail.com
State New
Headers show
Series [i386] : Fix PR 32413 in a correct way | expand

Commit Message

Uros Bizjak Sept. 4, 2019, 6:33 p.m. UTC
Attached patch fixes PR 32413 by forcing secondary memory for QI and
HImode moves between SSE and integer registers. This works together
with (existing) ix86_secondary_memory_needed_mode, where QI and HImode
secondary memory mode is extended to SImode.

The previous patch that fixe PR 32413 forced the limitation of
SSE->integer cost to minimum 8, which was enough to fix the testcase.
We want to get rid of this artificial limitation, but still have to
prevent unsupported move modes.

The patch should have no effect on benchmarks.

2019-09-04  Uroš Bizjak  <ubizjak@gmail.com>

    PR target/32413
    * config/i386/i386.c (inline_secondary_memory_needed): Return true
    for QI and HImode moves between SSE and general registers.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.
diff mbox series

Patch

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 275375)
+++ config/i386/i386.c	(working copy)
@@ -18328,6 +18328,7 @@  inline_secondary_memory_needed (machine_mode mode,
 
       /* Between SSE and general, we have moves no larger than word size.  */
       if (!(INTEGER_CLASS_P (class1) || INTEGER_CLASS_P (class2))
+	  || GET_MODE_SIZE (mode) < GET_MODE_SIZE (SImode)
 	  || GET_MODE_SIZE (mode) > UNITS_PER_WORD)
 	return true;