Patchwork [i386] : Fix mode of forced register in vec_dupv4sf

login
register
mail settings
Submitter Uros Bizjak
Date June 11, 2011, 11:16 a.m.
Message ID <BANLkTimsKcQF=TBHOzDSri2E_ojw0-088g@mail.gmail.com>
Download mbox | patch
Permalink /patch/100004/
State New
Headers show

Comments

Uros Bizjak - June 11, 2011, 11:16 a.m.
Hello!

2011-06-11  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/sse.md (vec_dupv4sf): Correct mode of forced register.
	(*vec_dupv2df): Rename from vec_dupv2df.
	(vec_dupv2df): New expander.

Tested on x86_64-pc-linux-gnu {,-m32}. Committed to mainline SVN, will
also be committed to 4.5 and 4.6 branch.

Uros.
H.J. Lu - June 11, 2011, 4:21 p.m.
On Sat, Jun 11, 2011 at 4:16 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> 2011-06-11  Uros Bizjak  <ubizjak@gmail.com>
>
>        * config/i386/sse.md (vec_dupv4sf): Correct mode of forced register.
>        (*vec_dupv2df): Rename from vec_dupv2df.
>        (vec_dupv2df): New expander.
>
> Tested on x86_64-pc-linux-gnu {,-m32}. Committed to mainline SVN, will
> also be committed to 4.5 and 4.6 branch.
>

This may have caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49374

Patch

Index: sse.md
===================================================================
--- sse.md	(revision 174946)
+++ sse.md	(working copy)
@@ -3816,7 +3816,7 @@ 
   "TARGET_SSE"
 {
   if (!TARGET_AVX)
-    operands[1] = force_reg (V4SFmode, operands[1]);
+    operands[1] = force_reg (SFmode, operands[1]);
 })
 
 (define_insn "*vec_dupv4sf_avx"
@@ -5117,6 +5117,16 @@ 
    (set_attr "length_immediate" "*,*,*,1,*,*")
    (set_attr "mode" "DF,V1DF,V1DF,V2DF,V1DF,V1DF")])
 
+(define_expand "vec_dupv4sf"
+  [(set (match_operand:V2DF 0 "register_operand" "")
+	(vec_duplicate:V2DF
+	  (match_operand:DF 1 "nonimmediate_operand" "")))]
+  "TARGET_SSE2"
+{
+  if (!TARGET_SSE3)
+    operands[1] = force_reg (DFmode, operands[1]);
+})
+
 (define_insn "*vec_dupv2df_sse3"
   [(set (match_operand:V2DF 0 "register_operand" "=x")
 	(vec_duplicate:V2DF
@@ -5127,7 +5137,7 @@ 
    (set_attr "prefix" "maybe_vex")
    (set_attr "mode" "DF")])
 
-(define_insn "vec_dupv2df"
+(define_insn "*vec_dupv2df"
   [(set (match_operand:V2DF 0 "register_operand" "=x")
 	(vec_duplicate:V2DF
 	  (match_operand:DF 1 "register_operand" "0")))]