From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1816) id 047273858C83; Mon, 24 Apr 2023 08:48:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 047273858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682326103; bh=0BgDFdTKPi3oxsRUlUkanxeG7tiQDjuawZAdEX08zhs=; h=From:To:Subject:Date:From; b=h8FoqGOABauolLGSml/TuaNSkCAJy3EMEasX1A/ZdZzvH76bur4VSQxMoSiR7dqRo a0WjW3kLO0nr2qpPA7MebUcl+8YCM3pyZzK0BPx4dGgfkV5KvMwPT9p2D8p9aCA/Lz kofR29wROp8oklTBcOVGVmhyuAhTIWDQoYS8olxI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kyrylo Tkachov To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-191] [3/4] aarch64: Convert UABAL and SABAL patterns to standard RTL codes X-Act-Checkin: gcc X-Git-Author: Kyrylo Tkachov X-Git-Refname: refs/heads/master X-Git-Oldrev: 6c82641d73283185990848051d8ffbdb51f2d208 X-Git-Newrev: e0472ed5aeeb908cb34be57a74c520c90bcb79d8 Message-Id: <20230424084823.047273858C83@sourceware.org> Date: Mon, 24 Apr 2023 08:48:22 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e0472ed5aeeb908cb34be57a74c520c90bcb79d8 commit r14-191-ge0472ed5aeeb908cb34be57a74c520c90bcb79d8 Author: Kyrylo Tkachov Date: Mon Apr 24 09:43:55 2023 +0100 [3/4] aarch64: Convert UABAL and SABAL patterns to standard RTL codes With the SABDL and UABDL patterns converted, the accumulating forms of them UABAL and SABAL are not much more complicated. There's an accumulator argument that we, err, accumulate into with a PLUS once all the widening is done. Some necessary renaming of patterns relating to the removal of UNSPEC_SABAL and UNSPEC_UABAL is included. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ChangeLog: * config/aarch64/aarch64-simd.md (aarch64_abal): Rename to... (aarch64_abal): ... This. Use RTL codes instead of unspec. (sadv16qi): Rename to... (sadv16qi): ... This. Adjust for the above. * config/aarch64/aarch64-sve.md (sad): Rename to... (sad): ... This. Adjust for the above. * config/aarch64/aarch64.md (UNSPEC_SABAL, UNSPEC_UABAL): Delete. * config/aarch64/iterators.md (ABAL): Delete. (sur): Remove handling of UNSPEC_SABAL and UNSPEC_UABAL. Diff: --- gcc/config/aarch64/aarch64-simd.md | 38 ++++++++++++++++++++++---------------- gcc/config/aarch64/aarch64-sve.md | 8 ++++---- gcc/config/aarch64/aarch64.md | 2 -- gcc/config/aarch64/iterators.md | 4 ---- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 6c628681a6d..51bb6cf357c 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -952,14 +952,20 @@ } ) -(define_insn "aarch64_abal" +(define_insn "aarch64_abal" [(set (match_operand: 0 "register_operand" "=w") - (unspec: [(match_operand:VD_BHSI 2 "register_operand" "w") - (match_operand:VD_BHSI 3 "register_operand" "w") - (match_operand: 1 "register_operand" "0")] - ABAL))] + (plus: + (zero_extend: + (minus:VD_BHSI + (USMAX:VD_BHSI + (match_operand:VD_BHSI 2 "register_operand" "w") + (match_operand:VD_BHSI 3 "register_operand" "w")) + (:VD_BHSI + (match_dup 2) + (match_dup 3)))) + (match_operand: 1 "register_operand" "0")))] "TARGET_SIMD" - "abal\t%0., %2., %3." + "abal\t%0., %2., %3." [(set_attr "type" "neon_arith_acc")] ) @@ -1004,10 +1010,10 @@ ;; but for TARGET_DOTPROD still emits a UDOT as the absolute difference is ;; unsigned. -(define_expand "sadv16qi" +(define_expand "sadv16qi" [(use (match_operand:V4SI 0 "register_operand")) - (unspec:V16QI [(use (match_operand:V16QI 1 "register_operand")) - (use (match_operand:V16QI 2 "register_operand"))] ABAL) + (USMAX:V16QI (match_operand:V16QI 1 "register_operand") + (match_operand:V16QI 2 "register_operand")) (use (match_operand:V4SI 3 "register_operand"))] "TARGET_SIMD" { @@ -1015,18 +1021,18 @@ { rtx ones = force_reg (V16QImode, CONST1_RTX (V16QImode)); rtx abd = gen_reg_rtx (V16QImode); - emit_insn (gen_aarch64_abdv16qi (abd, operands[1], operands[2])); + emit_insn (gen_aarch64_abdv16qi (abd, operands[1], operands[2])); emit_insn (gen_udot_prodv16qi (operands[0], abd, ones, operands[3])); DONE; } rtx reduc = gen_reg_rtx (V8HImode); - emit_insn (gen_aarch64_abdl2v16qi (reduc, operands[1], + emit_insn (gen_aarch64_abdl2v16qi (reduc, operands[1], operands[2])); - emit_insn (gen_aarch64_abalv8qi (reduc, reduc, - gen_lowpart (V8QImode, operands[1]), - gen_lowpart (V8QImode, - operands[2]))); - emit_insn (gen_aarch64_adalpv8hi (operands[3], operands[3], reduc)); + emit_insn (gen_aarch64_abalv8qi (reduc, reduc, + gen_lowpart (V8QImode, operands[1]), + gen_lowpart (V8QImode, + operands[2]))); + emit_insn (gen_aarch64_adalpv8hi (operands[3], operands[3], reduc)); emit_move_insn (operands[0], operands[3]); DONE; } diff --git a/gcc/config/aarch64/aarch64-sve.md b/gcc/config/aarch64/aarch64-sve.md index 7533b956686..b11b55f7ac7 100644 --- a/gcc/config/aarch64/aarch64-sve.md +++ b/gcc/config/aarch64/aarch64-sve.md @@ -6955,16 +6955,16 @@ ;; [SU]ABD diff.b, p0/m, op1.b, op2.b ;; MOVPRFX op0, op3 // If necessary ;; UDOT op0.s, diff.b, ones.b -(define_expand "sad" +(define_expand "sad" [(use (match_operand:SVE_FULL_SDI 0 "register_operand")) - (unspec: [(use (match_operand: 1 "register_operand")) - (use (match_operand: 2 "register_operand"))] ABAL) + (USMAX: (match_operand: 1 "register_operand") + (match_operand: 2 "register_operand")) (use (match_operand:SVE_FULL_SDI 3 "register_operand"))] "TARGET_SVE" { rtx ones = force_reg (mode, CONST1_RTX (mode)); rtx diff = gen_reg_rtx (mode); - emit_insn (gen_abd_3 (diff, operands[1], operands[2])); + emit_insn (gen_abd_3 (diff, operands[1], operands[2])); emit_insn (gen_udot_prod (operands[0], diff, ones, operands[3])); DONE; } diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 1b2bdf5c550..426eb85d2db 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -204,7 +204,6 @@ UNSPEC_PRLG_STK UNSPEC_REV UNSPEC_RBIT - UNSPEC_SABAL UNSPEC_SABAL2 UNSPEC_SADALP UNSPEC_SCVTF @@ -226,7 +225,6 @@ UNSPEC_TLSLE24 UNSPEC_TLSLE32 UNSPEC_TLSLE48 - UNSPEC_UABAL UNSPEC_UABAL2 UNSPEC_UADALP UNSPEC_UCVTF diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index bd4415d6008..0195cdc545e 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -2567,9 +2567,6 @@ ;; Int Iterators. ;; ------------------------------------------------------------------- -;; The unspec codes for the SABAL, UABAL AdvancedSIMD instructions. -(define_int_iterator ABAL [UNSPEC_SABAL UNSPEC_UABAL]) - ;; The unspec codes for the SABAL2, UABAL2 AdvancedSIMD instructions. (define_int_iterator ABAL2 [UNSPEC_SABAL2 UNSPEC_UABAL2]) @@ -3354,7 +3351,6 @@ (UNSPEC_SRHADD "sr") (UNSPEC_URHADD "ur") (UNSPEC_SHSUB "s") (UNSPEC_UHSUB "u") (UNSPEC_ADDHN "") (UNSPEC_RADDHN "r") - (UNSPEC_SABAL "s") (UNSPEC_UABAL "u") (UNSPEC_SABAL2 "s") (UNSPEC_UABAL2 "u") (UNSPEC_SADALP "s") (UNSPEC_UADALP "u") (UNSPEC_SUBHN "") (UNSPEC_RSUBHN "r")