Fix x86 attrs on *x86_mov<mode>cc_0_m1*

Message ID 20180417165813.GH8577@tucnak
State New
Headers show
Series
  • Fix x86 attrs on *x86_mov<mode>cc_0_m1*
Related show

Commit Message

Jakub Jelinek April 17, 2018, 4:58 p.m.
Hi!

The search for patterns with n_operands 2 and TYPE_ALU revealed also these
3 patterns, which also have just 2 operands, yet use "alu".

I think "alu1" is the right type for these, but given that they had explicit
"memory" and "imm_disp" attributes, it probably isn't that big deal.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for stage1?
Or is this something we want in GCC8 too?

2018-04-17  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386.md (*x86_mov<mode>cc_0_m1): Use type "alu1" rather
	than "alu", remove explicit "memory" and "imm_disp" attributes.
	(*x86_mov<mode>cc_0_m1_se, *x86_mov<mode>cc_0_m1_neg): Likewise.


	Jakub

Comments

Uros Bizjak April 17, 2018, 5:13 p.m. | #1
On Tue, Apr 17, 2018 at 6:58 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!

>

> The search for patterns with n_operands 2 and TYPE_ALU revealed also these

> 3 patterns, which also have just 2 operands, yet use "alu".

>

> I think "alu1" is the right type for these, but given that they had explicit

> "memory" and "imm_disp" attributes, it probably isn't that big deal.

>

> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for stage1?

> Or is this something we want in GCC8 too?

>

> 2018-04-17  Jakub Jelinek  <jakub@redhat.com>

>

>         * config/i386/i386.md (*x86_mov<mode>cc_0_m1): Use type "alu1" rather

>         than "alu", remove explicit "memory" and "imm_disp" attributes.

>         (*x86_mov<mode>cc_0_m1_se, *x86_mov<mode>cc_0_m1_neg): Likewise.


OK for stage1, to avoid stepping on the mine this late in the development.

Thanks,
Uros.

> --- gcc/config/i386/i386.md.jj  2018-04-17 13:22:08.134050850 +0200

> +++ gcc/config/i386/i386.md     2018-04-17 15:03:32.048628607 +0200

> @@ -17898,14 +17898,10 @@ (define_insn "*x86_mov<mode>cc_0_m1"

>     (clobber (reg:CC FLAGS_REG))]

>    ""

>    "sbb{<imodesuffix>}\t%0, %0"

> -  ; Since we don't have the proper number of operands for an alu insn,

> -  ; fill in all the blanks.

> -  [(set_attr "type" "alu")

> +  [(set_attr "type" "alu1")

>     (set_attr "modrm_class" "op0")

>     (set_attr "use_carry" "1")

>     (set_attr "pent_pair" "pu")

> -   (set_attr "memory" "none")

> -   (set_attr "imm_disp" "false")

>     (set_attr "mode" "<MODE>")

>     (set_attr "length_immediate" "0")])

>

> @@ -17918,12 +17914,10 @@ (define_insn "*x86_mov<mode>cc_0_m1_se"

>     (clobber (reg:CC FLAGS_REG))]

>    ""

>    "sbb{<imodesuffix>}\t%0, %0"

> -  [(set_attr "type" "alu")

> +  [(set_attr "type" "alu1")

>     (set_attr "modrm_class" "op0")

>     (set_attr "use_carry" "1")

>     (set_attr "pent_pair" "pu")

> -   (set_attr "memory" "none")

> -   (set_attr "imm_disp" "false")

>     (set_attr "mode" "<MODE>")

>     (set_attr "length_immediate" "0")])

>

> @@ -17934,12 +17928,10 @@ (define_insn "*x86_mov<mode>cc_0_m1_neg"

>     (clobber (reg:CC FLAGS_REG))]

>    ""

>    "sbb{<imodesuffix>}\t%0, %0"

> -  [(set_attr "type" "alu")

> +  [(set_attr "type" "alu1")

>     (set_attr "modrm_class" "op0")

>     (set_attr "use_carry" "1")

>     (set_attr "pent_pair" "pu")

> -   (set_attr "memory" "none")

> -   (set_attr "imm_disp" "false")

>     (set_attr "mode" "<MODE>")

>     (set_attr "length_immediate" "0")])

>

>

>         Jakub

Patch

--- gcc/config/i386/i386.md.jj	2018-04-17 13:22:08.134050850 +0200
+++ gcc/config/i386/i386.md	2018-04-17 15:03:32.048628607 +0200
@@ -17898,14 +17898,10 @@  (define_insn "*x86_mov<mode>cc_0_m1"
    (clobber (reg:CC FLAGS_REG))]
   ""
   "sbb{<imodesuffix>}\t%0, %0"
-  ; Since we don't have the proper number of operands for an alu insn,
-  ; fill in all the blanks.
-  [(set_attr "type" "alu")
+  [(set_attr "type" "alu1")
    (set_attr "modrm_class" "op0")
    (set_attr "use_carry" "1")
    (set_attr "pent_pair" "pu")
-   (set_attr "memory" "none")
-   (set_attr "imm_disp" "false")
    (set_attr "mode" "<MODE>")
    (set_attr "length_immediate" "0")])
 
@@ -17918,12 +17914,10 @@  (define_insn "*x86_mov<mode>cc_0_m1_se"
    (clobber (reg:CC FLAGS_REG))]
   ""
   "sbb{<imodesuffix>}\t%0, %0"
-  [(set_attr "type" "alu")
+  [(set_attr "type" "alu1")
    (set_attr "modrm_class" "op0")
    (set_attr "use_carry" "1")
    (set_attr "pent_pair" "pu")
-   (set_attr "memory" "none")
-   (set_attr "imm_disp" "false")
    (set_attr "mode" "<MODE>")
    (set_attr "length_immediate" "0")])
 
@@ -17934,12 +17928,10 @@  (define_insn "*x86_mov<mode>cc_0_m1_neg"
    (clobber (reg:CC FLAGS_REG))]
   ""
   "sbb{<imodesuffix>}\t%0, %0"
-  [(set_attr "type" "alu")
+  [(set_attr "type" "alu1")
    (set_attr "modrm_class" "op0")
    (set_attr "use_carry" "1")
    (set_attr "pent_pair" "pu")
-   (set_attr "memory" "none")
-   (set_attr "imm_disp" "false")
    (set_attr "mode" "<MODE>")
    (set_attr "length_immediate" "0")])