: [PATCH, reginfo.c, i386.c] Backport fix for PR58139 to 4.8

Submitted by Peter Bergner on Jan. 16, 2014, 12:39 p.m.

Details

Message ID 1389875985.5729.779.camel@otta
State New
Headers show

Commit Message

Peter Bergner Jan. 16, 2014, 12:39 p.m.
On Thu, 2014-01-16 at 09:11 +0100, Uros Bizjak wrote:
> On Wed, Jan 15, 2014 at 2:19 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> >         Backport from mainline
> >         2013-09-06  Jan Hubicka  <jh@suse.cz>
> >
> >         * config/i386/i386.c (ix86_hard_regno_mode_ok): AVX modes are valid
> >         only when AVX is enabled.
> 
> OK for x86, with slight update, as suggested below.
> 
> > Index: gcc/config/i386/i386.c
> > ===================================================================
> > --- gcc/config/i386/i386.c      (revision 206582)
> > +++ gcc/config/i386/i386.c      (working copy)
> > @@ -33944,7 +33944,7 @@ ix86_hard_regno_mode_ok (int regno, enum
> >          are available.  OImode move is available only when AVX is
> >          enabled.  */
> >        return ((TARGET_AVX && mode == OImode)
> > -             || VALID_AVX256_REG_MODE (mode)
> > +             || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
> 
> Please use VALID_AVX256_REG_OR_IO_MODE define:

We were already testing for OImode, so do you want me to
remove the redundant compare and make the code look like
the following instead?

Peter

Comments

Uros Bizjak Jan. 16, 2014, 12:49 p.m.
On Thu, Jan 16, 2014 at 1:39 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:

>> >         Backport from mainline
>> >         2013-09-06  Jan Hubicka  <jh@suse.cz>
>> >
>> >         * config/i386/i386.c (ix86_hard_regno_mode_ok): AVX modes are valid
>> >         only when AVX is enabled.
>>
>> OK for x86, with slight update, as suggested below.
>>
>> > Index: gcc/config/i386/i386.c
>> > ===================================================================
>> > --- gcc/config/i386/i386.c      (revision 206582)
>> > +++ gcc/config/i386/i386.c      (working copy)
>> > @@ -33944,7 +33944,7 @@ ix86_hard_regno_mode_ok (int regno, enum
>> >          are available.  OImode move is available only when AVX is
>> >          enabled.  */
>> >        return ((TARGET_AVX && mode == OImode)
>> > -             || VALID_AVX256_REG_MODE (mode)
>> > +             || (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
>>
>> Please use VALID_AVX256_REG_OR_IO_MODE define:
>
> We were already testing for OImode, so do you want me to
> remove the redundant compare and make the code look like
> the following instead?

Yes, just use [1] from mainline.

[1] http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00954.html

Thanks,
Uros.

Patch hide | download patch | download mbox

Index: i386.c
===================================================================
--- i386.c	(revision 206582)
+++ i386.c	(working copy)
@@ -33943,8 +33943,7 @@  ix86_hard_regno_mode_ok (int regno, enum
 	 out of SSE registers, even when no operation instructions
 	 are available.  OImode move is available only when AVX is
 	 enabled.  */
-      return ((TARGET_AVX && mode == OImode)
-	      || VALID_AVX256_REG_MODE (mode)
+      return ((TARGET_AVX && VALID_AVX256_REG_OR_OI_MODE (mode))
 	      || VALID_SSE_REG_MODE (mode)
 	      || VALID_SSE2_REG_MODE (mode)
 	      || VALID_MMX_REG_MODE (mode)