Add LE/BE SHA1H patterns with a V2SI input.
authorWilco Dijkstra <wdijkstr@arm.com>
Wed, 2 Nov 2016 14:00:22 +0000 (14:00 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Wed, 2 Nov 2016 14:00:22 +0000 (14:00 +0000)
Add LE/BE SHA1H patterns with a V2SI input.  This avoids unnecessary
DUPs when using intrinsics like vsha1h_u32 (vgetq_lane_u32 (x, 0)).

    gcc/
        * config/aarch64/aarch64-simd.md (aarch64_crypto_sha1hv4si):
        New pattern.
        (aarch64_be_crypto_sha1hv4si): New pattern.

From-SVN: r241791

gcc/ChangeLog
gcc/config/aarch64/aarch64-simd.md

index 6221150228d5cb53abe36c7e4007fcf655b3064b..76b90a889a50300f1ea15a418d9bd54507a9d0eb 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-26  Wilco Dijkstra  <wdijkstr@arm.com>
+
+       * config/aarch64/aarch64-simd.md (aarch64_crypto_sha1hv4si):
+       New pattern.
+       (aarch64_be_crypto_sha1hv4si): New pattern.
+
 2016-11-02  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.md (add<mode>3): Remove
index 9ce7f00050913aebd9f83ae9c4ce4ad469dd0d98..89bdcb3f7ed53d092dd95c81fe4a15fb15dc907c 100644 (file)
   [(set_attr "type" "crypto_sha1_fast")]
 )
 
+(define_insn "aarch64_crypto_sha1hv4si"
+  [(set (match_operand:SI 0 "register_operand" "=w")
+       (unspec:SI [(vec_select:SI (match_operand:V4SI 1 "register_operand" "w")
+                    (parallel [(const_int 0)]))]
+        UNSPEC_SHA1H))]
+  "TARGET_SIMD && TARGET_CRYPTO && !BYTES_BIG_ENDIAN"
+  "sha1h\\t%s0, %s1"
+  [(set_attr "type" "crypto_sha1_fast")]
+)
+
+(define_insn "aarch64_be_crypto_sha1hv4si"
+  [(set (match_operand:SI 0 "register_operand" "=w")
+       (unspec:SI [(vec_select:SI (match_operand:V4SI 1 "register_operand" "w")
+                    (parallel [(const_int 3)]))]
+        UNSPEC_SHA1H))]
+  "TARGET_SIMD && TARGET_CRYPTO && BYTES_BIG_ENDIAN"
+  "sha1h\\t%s0, %s1"
+  [(set_attr "type" "crypto_sha1_fast")]
+)
+
 (define_insn "aarch64_crypto_sha1su1v4si"
   [(set (match_operand:V4SI 0 "register_operand" "=w")
         (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "0")