From 5304d04437ac683b9a4c8207728db70774560222 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Wed, 2 Nov 2016 14:00:22 +0000 Subject: [PATCH] Add LE/BE SHA1H patterns with a V2SI input. 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 | 6 ++++++ gcc/config/aarch64/aarch64-simd.md | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6221150228d..76b90a889a5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-26 Wilco Dijkstra + + * config/aarch64/aarch64-simd.md (aarch64_crypto_sha1hv4si): + New pattern. + (aarch64_be_crypto_sha1hv4si): New pattern. + 2016-11-02 Wilco Dijkstra * config/aarch64/aarch64.md (add3): Remove diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 9ce7f000509..89bdcb3f7ed 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -5705,6 +5705,26 @@ [(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") -- 2.30.2