Patchwork [PATCH.,i386] : movd in zero_extend RTX is SSE2 instruction.

login
register
mail settings
Submitter Uros Bizjak
Date June 14, 2012, 6:47 p.m.
Message ID <CAFULd4bpuY7oYziK2fwodr8WzRwOoD8o2if4JmPw3TO5mdH2ZQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/165000/
State New
Headers show

Comments

Uros Bizjak - June 14, 2012, 6:47 p.m.
Hello!

movd to/from MMX or SSE registers is SSE2 instruction. Also, remove
wrong x,x alternative.

2012-06-14  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.md (*zero_extendsidi2): Mark movd alternatives
	SSE2 only.  Remove x,x alternative.
	(*zero_extendsidi2_rex64): Ditto.

Bootstrapped and regression tested on x86_64-pc-linux-gnu, committed
to mainline SVN. Patch will be backported to other release branches.

Uros.
Uros Bizjak - June 14, 2012, 7:29 p.m.
On Thu, Jun 14, 2012 at 8:47 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

> movd to/from MMX or SSE registers is SSE2 instruction. Also, remove
> wrong x,x alternative.
>
> 2012-06-14  Uros Bizjak  <ubizjak@gmail.com>
>
>        * config/i386/i386.md (*zero_extendsidi2): Mark movd alternatives
>        SSE2 only.  Remove x,x alternative.
>        (*zero_extendsidi2_rex64): Ditto.
>
> Bootstrapped and regression tested on x86_64-pc-linux-gnu, committed
> to mainline SVN. Patch will be backported to other release branches.

Actually, the SDM is wrong here! movd is perfectly valid MMX
instruction. This part of the patch is reverted.

Uros.

Patch

Index: i386.md
===================================================================
--- i386.md	(revision 188622)
+++ i386.md	(working copy)
@@ -3467,10 +3467,10 @@ 
 
 (define_insn "*zero_extendsidi2_rex64"
   [(set (match_operand:DI 0 "nonimmediate_operand"
-			"=r  ,o,?*Ym,?*y,?*Yi,!*x")
+			"=r  ,o,?*Ym,?*y,?*Yi,?*x")
 	(zero_extend:DI
 	 (match_operand:SI 1 "x86_64_zext_general_operand"
-	        	"rmWz,0,r   ,m  ,r   ,m*x")))]
+	        	"rmWz,0,r   ,m  ,r   ,m")))]
   "TARGET_64BIT"
   "@
    mov{l}\t{%1, %k0|%k0, %1}
@@ -3479,7 +3479,7 @@ 
    movd\t{%1, %0|%0, %1}
    %vmovd\t{%1, %0|%0, %1}
    %vmovd\t{%1, %0|%0, %1}"
-  [(set_attr "isa" "*,*,*,*,*,sse2")
+  [(set_attr "isa" "*,*,sse2,sse2,sse2,sse2")
    (set_attr "type" "imovx,multi,mmxmov,mmxmov,ssemov,ssemov")
    (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex")
    (set_attr "prefix_0f" "0,*,*,*,*,*")
@@ -3487,9 +3487,9 @@ 
 
 (define_insn "*zero_extendsidi2"
   [(set (match_operand:DI 0 "nonimmediate_operand"
-			"=ro,?r,?o,?*Ym,?*y,?*Yi,!*x")
+			"=ro,?r,?o,?*Ym,?*y,?*Yi,?*x")
 	(zero_extend:DI (match_operand:SI 1 "nonimmediate_operand"
-			"0  ,rm,r ,r   ,m  ,r   ,m*x")))]
+			"0  ,rm,r ,r   ,m  ,r   ,m")))]
   "!TARGET_64BIT"
   "@
    #
@@ -3499,7 +3499,7 @@ 
    movd\t{%1, %0|%0, %1}
    %vmovd\t{%1, %0|%0, %1}
    %vmovd\t{%1, %0|%0, %1}"
-  [(set_attr "isa" "*,*,*,*,*,*,sse2")
+  [(set_attr "isa" "*,*,*,sse2,sse2,sse2,sse2")
    (set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov")
    (set_attr "prefix" "*,*,*,orig,orig,maybe_vex,maybe_vex")
    (set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")])