[25/40] i386: Emulate MMX movntq with SSE2 movntidi

Message ID 20190214123031.13301-26-hjl.tools@gmail.com
State Superseded
Headers show
Series
  • V5: Emulate MMX intrinsics with SSE
Related show

Commit Message

H.J. Lu Feb. 14, 2019, 12:30 p.m.
Emulate MMX movntq with SSE2 movntidi.  Only SSE register source operand
is allowed.

	PR target/89021
	* config/i386/mmx.md (sse_movntq): Add SSE2 emulation.
---
 gcc/config/i386/mmx.md | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
2.20.1

Comments

Uros Bizjak Feb. 14, 2019, 2:17 p.m. | #1
On Thu, Feb 14, 2019 at 1:30 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> Emulate MMX movntq with SSE2 movntidi.  Only SSE register source operand

> is allowed.


There is no SSE register source operand. Probably "Only register
source operand is allowed."

Uros.

>

>         PR target/89021

>         * config/i386/mmx.md (sse_movntq): Add SSE2 emulation.

> ---

>  gcc/config/i386/mmx.md | 14 +++++++++-----

>  1 file changed, 9 insertions(+), 5 deletions(-)

>

> diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md

> index 0c08aebb071..274e895f51e 100644

> --- a/gcc/config/i386/mmx.md

> +++ b/gcc/config/i386/mmx.md

> @@ -214,12 +214,16 @@

>  })

>

>  (define_insn "sse_movntq"

> -  [(set (match_operand:DI 0 "memory_operand" "=m")

> -       (unspec:DI [(match_operand:DI 1 "register_operand" "y")]

> +  [(set (match_operand:DI 0 "memory_operand" "=m,m")

> +       (unspec:DI [(match_operand:DI 1 "register_operand" "y,r")]

>                    UNSPEC_MOVNTQ))]

> -  "TARGET_SSE || TARGET_3DNOW_A"

> -  "movntq\t{%1, %0|%0, %1}"

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

> +  "(TARGET_MMX || TARGET_MMX_WITH_SSE)

> +   && (TARGET_SSE || TARGET_3DNOW_A)"

> +  "@

> +   movntq\t{%1, %0|%0, %1}

> +   movnti\t{%1, %0|%0, %1}"

> +  [(set_attr "mmx_isa" "native,x64")

> +   (set_attr "type" "mmxmov,ssemov")

>     (set_attr "mode" "DI")])

>

>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> --

> 2.20.1

>

Patch

diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 0c08aebb071..274e895f51e 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -214,12 +214,16 @@ 
 })
 
 (define_insn "sse_movntq"
-  [(set (match_operand:DI 0 "memory_operand" "=m")
-	(unspec:DI [(match_operand:DI 1 "register_operand" "y")]
+  [(set (match_operand:DI 0 "memory_operand" "=m,m")
+	(unspec:DI [(match_operand:DI 1 "register_operand" "y,r")]
 		   UNSPEC_MOVNTQ))]
-  "TARGET_SSE || TARGET_3DNOW_A"
-  "movntq\t{%1, %0|%0, %1}"
-  [(set_attr "type" "mmxmov")
+  "(TARGET_MMX || TARGET_MMX_WITH_SSE)
+   && (TARGET_SSE || TARGET_3DNOW_A)"
+  "@
+   movntq\t{%1, %0|%0, %1}
+   movnti\t{%1, %0|%0, %1}"
+  [(set_attr "mmx_isa" "native,x64")
+   (set_attr "type" "mmxmov,ssemov")
    (set_attr "mode" "DI")])
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;