Patchwork [i386] : Fix handling of TARGET_SSE_TYPELESS_STORES in unaligned move RTXes

login
register
mail settings
Submitter Uros Bizjak
Date Nov. 25, 2012, 8:40 p.m.
Message ID <CAFULd4aj0SMNa2u4aYxfnfB0eAPdqs6XuvL8wKNXeqULSg0Yzw@mail.gmail.com>
Download mbox | patch
Permalink /patch/201568/
State New
Headers show

Comments

Uros Bizjak - Nov. 25, 2012, 8:40 p.m.
Hello!

When unaligned moves were split to unaligned store/loads, mode
calculation didn't get updated. Attached patch fixes this oversight.

2012-11-25  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/sse.md (<sse>_loadu<ssemodesuffix><avxsizesuffix>):
	Do not depend on TARGET_SSE_TYPELESS_STORES.
	(<sse2>_loaddqu<avxsizesuffix>): Ditto.
	(<sse>_storeu<ssemodesuffix><avxsizesuffix>): Fix handling of
	TARGET_SSE_TYPELESS_STORES.
	(<sse2>_storedqu<avxsizesuffix>): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Uros.

Patch

Index: config/i386/sse.md
===================================================================
--- config/i386/sse.md	(revision 193792)
+++ config/i386/sse.md	(working copy)
@@ -610,9 +610,6 @@ 
    (set (attr "mode")
 	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
 		 (const_string "<ssePSmode>")
-	       (and (eq_attr "alternative" "1")
-		    (match_test "TARGET_SSE_TYPELESS_STORES"))
-		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<MODE>")
 	       (match_test "optimize_function_for_size_p (cfun)")
@@ -640,9 +637,7 @@ 
    (set_attr "movu" "1")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
-		 (const_string "<ssePSmode>")
-	       (and (eq_attr "alternative" "1")
+	(cond [(ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
 		    (match_test "TARGET_SSE_TYPELESS_STORES"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
@@ -678,9 +673,6 @@ 
    (set (attr "mode")
 	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
 		 (const_string "<ssePSmode>")
-	       (and (eq_attr "alternative" "1")
-		    (match_test "TARGET_SSE_TYPELESS_STORES"))
-		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<sseinsnmode>")
 	       (match_test "optimize_function_for_size_p (cfun)")
@@ -712,9 +704,7 @@ 
      (const_string "1")))
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
-		 (const_string "<ssePSmode>")
-	       (and (eq_attr "alternative" "1")
+	(cond [(ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
 		    (match_test "TARGET_SSE_TYPELESS_STORES"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")