x86: vpermil2p{s,d} have no commutative operands
diff mbox

Message ID 5903730602000078001552F0@prv-mh.provo.novell.com
State New
Headers show

Commit Message

Jan Beulich April 28, 2017, 2:51 p.m. UTC
While either of the last two operands can be in memory, they can't be
swapped.

gcc/
2017-04-28  Jan Beulich  <jbeulich@suse.com>

	* config/i386/sse.md (xop_vpermil2<mode>3): Use alternatives.
x86: vpermil2p{s,d} have no commutative operands

While either of the last two operands can be in memory, they can't be
swapped.

gcc/
2017-04-28  Jan Beulich  <jbeulich@suse.com>

	* config/i386/sse.md (xop_vpermil2<mode>3): Use alternatives.

--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -17092,12 +17092,12 @@
    (set_attr "mode" "TI")])
 
 (define_insn "xop_vpermil2<mode>3"
-  [(set (match_operand:VF_128_256 0 "register_operand" "=x")
+  [(set (match_operand:VF_128_256 0 "register_operand" "=x,x")
 	(unspec:VF_128_256
-	  [(match_operand:VF_128_256 1 "register_operand" "x")
-	   (match_operand:VF_128_256 2 "nonimmediate_operand" "%x")
-	   (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm")
-	   (match_operand:SI 4 "const_0_to_3_operand" "n")]
+	  [(match_operand:VF_128_256 1 "register_operand" "x,x")
+	   (match_operand:VF_128_256 2 "nonimmediate_operand" "x,m")
+	   (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm,x")
+	   (match_operand:SI 4 "const_0_to_3_operand" "n,n")]
 	  UNSPEC_VPERMIL2))]
   "TARGET_XOP"
   "vpermil2<ssemodesuffix>\t{%4, %3, %2, %1, %0|%0, %1, %2, %3, %4}"

Comments

Uros Bizjak May 1, 2017, 9:09 a.m. UTC | #1
On Fri, Apr 28, 2017 at 4:51 PM, Jan Beulich <JBeulich@suse.com> wrote:
> While either of the last two operands can be in memory, they can't be
> swapped.
>
> gcc/
> 2017-04-28  Jan Beulich  <jbeulich@suse.com>
>
>         * config/i386/sse.md (xop_vpermil2<mode>3): Use alternatives.

Please write a more descriptive ChangeLog entry, e.g. "Do not allow
operand swapping, add (x,x,m,x,n) alternative.

OK with above change for mainline and release branches.

Thanks,
Uros.

> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -17092,12 +17092,12 @@
>     (set_attr "mode" "TI")])
>
>  (define_insn "xop_vpermil2<mode>3"
> -  [(set (match_operand:VF_128_256 0 "register_operand" "=x")
> +  [(set (match_operand:VF_128_256 0 "register_operand" "=x,x")
>         (unspec:VF_128_256
> -         [(match_operand:VF_128_256 1 "register_operand" "x")
> -          (match_operand:VF_128_256 2 "nonimmediate_operand" "%x")
> -          (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm")
> -          (match_operand:SI 4 "const_0_to_3_operand" "n")]
> +         [(match_operand:VF_128_256 1 "register_operand" "x,x")
> +          (match_operand:VF_128_256 2 "nonimmediate_operand" "x,m")
> +          (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm,x")
> +          (match_operand:SI 4 "const_0_to_3_operand" "n,n")]
>           UNSPEC_VPERMIL2))]
>    "TARGET_XOP"
>    "vpermil2<ssemodesuffix>\t{%4, %3, %2, %1, %0|%0, %1, %2, %3, %4}"
>
>
>
Jan Beulich May 2, 2017, 8:26 a.m. UTC | #2
>>> On 01.05.17 at 11:09, <ubizjak@gmail.com> wrote:
> On Fri, Apr 28, 2017 at 4:51 PM, Jan Beulich <JBeulich@suse.com> wrote:
>> While either of the last two operands can be in memory, they can't be
>> swapped.
>>
>> gcc/
>> 2017-04-28  Jan Beulich  <jbeulich@suse.com>
>>
>>         * config/i386/sse.md (xop_vpermil2<mode>3): Use alternatives.
> 
> Please write a more descriptive ChangeLog entry, e.g. "Do not allow
> operand swapping, add (x,x,m,x,n) alternative.
> 
> OK with above change for mainline and release branches.

Considering the most recent status announcement I understand
that I should not apply this to branches/gcc-7-branch until after
7.1 went out. Please correct me if that's wrong.

I'm also not sure whether with your reply you also meant to
cover branches/gcc-6-branch (and possibly even older, albeit
personally I don't care about 5.x anymore).

Jan
Uros Bizjak May 2, 2017, 8:54 a.m. UTC | #3
On Tue, May 2, 2017 at 10:26 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 01.05.17 at 11:09, <ubizjak@gmail.com> wrote:
>> On Fri, Apr 28, 2017 at 4:51 PM, Jan Beulich <JBeulich@suse.com> wrote:
>>> While either of the last two operands can be in memory, they can't be
>>> swapped.
>>>
>>> gcc/
>>> 2017-04-28  Jan Beulich  <jbeulich@suse.com>
>>>
>>>         * config/i386/sse.md (xop_vpermil2<mode>3): Use alternatives.
>>
>> Please write a more descriptive ChangeLog entry, e.g. "Do not allow
>> operand swapping, add (x,x,m,x,n) alternative.
>>
>> OK with above change for mainline and release branches.
>
> Considering the most recent status announcement I understand
> that I should not apply this to branches/gcc-7-branch until after
> 7.1 went out. Please correct me if that's wrong.

Yes, release rules still apply, so please wait until gcc-7 branch is
opened again.

> I'm also not sure whether with your reply you also meant to
> cover branches/gcc-6-branch (and possibly even older, albeit
> personally I don't care about 5.x anymore).

Your call, if you think the patch should be applied to older branches.
Otherwise, branches survived without the patch until now, so I guess
it is not that critical.

Uros.

Patch
diff mbox

--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -17092,12 +17092,12 @@ 
    (set_attr "mode" "TI")])
 
 (define_insn "xop_vpermil2<mode>3"
-  [(set (match_operand:VF_128_256 0 "register_operand" "=x")
+  [(set (match_operand:VF_128_256 0 "register_operand" "=x,x")
 	(unspec:VF_128_256
-	  [(match_operand:VF_128_256 1 "register_operand" "x")
-	   (match_operand:VF_128_256 2 "nonimmediate_operand" "%x")
-	   (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm")
-	   (match_operand:SI 4 "const_0_to_3_operand" "n")]
+	  [(match_operand:VF_128_256 1 "register_operand" "x,x")
+	   (match_operand:VF_128_256 2 "nonimmediate_operand" "x,m")
+	   (match_operand:<sseintvecmode> 3 "nonimmediate_operand" "xm,x")
+	   (match_operand:SI 4 "const_0_to_3_operand" "n,n")]
 	  UNSPEC_VPERMIL2))]
   "TARGET_XOP"
   "vpermil2<ssemodesuffix>\t{%4, %3, %2, %1, %0|%0, %1, %2, %3, %4}"