[09/10] x86: correct "length_immediate" in a few cases

Message ID 8d0663ed-123e-1428-8aef-17d82c1b5f17@suse.com
State Accepted
Headers
Series x86: (mainly) "prefix_extra" adjustments |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Jan Beulich Aug. 3, 2023, 8:13 a.m. UTC
  When first added explicitly in 3ddffba914b2 ("i386.md
(sse4_1_round<mode>2): Add avx512f alternative"), "*" should not have
been used for the pre-existing alternative. The attribute was plain
missing. Subsequent changes adding more alternatives then generously
extended the bogus pattern.

Apparently something similar happened to the two mmx_pblendvb_* insns.

gcc/

	* config/i386/i386.md (sse4_1_round<mode>2): Make
	"length_immediate" uniformly 1.
	* config/i386/mmx.md (mmx_pblendvb_v8qi): Likewise.
	(mmx_pblendvb_<mode>): Likewise.
  

Comments

Hongtao Liu Aug. 4, 2023, 1:57 a.m. UTC | #1
On Thu, Aug 3, 2023 at 4:14 PM Jan Beulich via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> When first added explicitly in 3ddffba914b2 ("i386.md
> (sse4_1_round<mode>2): Add avx512f alternative"), "*" should not have
> been used for the pre-existing alternative. The attribute was plain
> missing. Subsequent changes adding more alternatives then generously
> extended the bogus pattern.
>
> Apparently something similar happened to the two mmx_pblendvb_* insns.
Ok.
>
> gcc/
>
>         * config/i386/i386.md (sse4_1_round<mode>2): Make
>         "length_immediate" uniformly 1.
>         * config/i386/mmx.md (mmx_pblendvb_v8qi): Likewise.
>         (mmx_pblendvb_<mode>): Likewise.
>
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -21594,7 +21594,7 @@
>     vrndscale<ssemodesuffix>\t{%2, %1, %d0|%d0, %1, %2}"
>    [(set_attr "type" "ssecvt")
>     (set_attr "prefix_extra" "1,1,1,*,*")
> -   (set_attr "length_immediate" "*,*,*,1,1")
> +   (set_attr "length_immediate" "1")
>     (set_attr "prefix" "maybe_vex,maybe_vex,maybe_vex,evex,evex")
>     (set_attr "isa" "noavx512f,noavx512f,noavx512f,avx512f,avx512f")
>     (set_attr "avx_partial_xmm_update" "false,false,true,false,true")
> --- a/gcc/config/i386/mmx.md
> +++ b/gcc/config/i386/mmx.md
> @@ -3094,7 +3094,7 @@
>    [(set_attr "isa" "noavx,noavx,avx")
>     (set_attr "type" "ssemov")
>     (set_attr "prefix_extra" "1")
> -   (set_attr "length_immediate" "*,*,1")
> +   (set_attr "length_immediate" "1")
>     (set_attr "prefix" "orig,orig,vex")
>     (set_attr "btver2_decode" "vector")
>     (set_attr "mode" "TI")])
> @@ -3114,7 +3114,7 @@
>    [(set_attr "isa" "noavx,noavx,avx")
>     (set_attr "type" "ssemov")
>     (set_attr "prefix_extra" "1")
> -   (set_attr "length_immediate" "*,*,1")
> +   (set_attr "length_immediate" "1")
>     (set_attr "prefix" "orig,orig,vex")
>     (set_attr "btver2_decode" "vector")
>     (set_attr "mode" "TI")])
>
  

Patch

--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -21594,7 +21594,7 @@ 
    vrndscale<ssemodesuffix>\t{%2, %1, %d0|%d0, %1, %2}"
   [(set_attr "type" "ssecvt")
    (set_attr "prefix_extra" "1,1,1,*,*")
-   (set_attr "length_immediate" "*,*,*,1,1")
+   (set_attr "length_immediate" "1")
    (set_attr "prefix" "maybe_vex,maybe_vex,maybe_vex,evex,evex")
    (set_attr "isa" "noavx512f,noavx512f,noavx512f,avx512f,avx512f")
    (set_attr "avx_partial_xmm_update" "false,false,true,false,true")
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -3094,7 +3094,7 @@ 
   [(set_attr "isa" "noavx,noavx,avx")
    (set_attr "type" "ssemov")
    (set_attr "prefix_extra" "1")
-   (set_attr "length_immediate" "*,*,1")
+   (set_attr "length_immediate" "1")
    (set_attr "prefix" "orig,orig,vex")
    (set_attr "btver2_decode" "vector")
    (set_attr "mode" "TI")])
@@ -3114,7 +3114,7 @@ 
   [(set_attr "isa" "noavx,noavx,avx")
    (set_attr "type" "ssemov")
    (set_attr "prefix_extra" "1")
-   (set_attr "length_immediate" "*,*,1")
+   (set_attr "length_immediate" "1")
    (set_attr "prefix" "orig,orig,vex")
    (set_attr "btver2_decode" "vector")
    (set_attr "mode" "TI")])