]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Remove unspecs from [su]qmovn RTL pattern
authorJonathan Wright <jonathan.wright@arm.com>
Thu, 22 Apr 2021 14:04:19 +0000 (15:04 +0100)
committerJonathan Wright <jonathan.wright@arm.com>
Wed, 28 Apr 2021 20:14:03 +0000 (21:14 +0100)
Saturating truncation can be expressed using the RTL expressions
ss_truncate and us_truncate. This patch changes the implementation
of the vqmovn_* intrinsics to use these RTL expressions rather than
a pair of unspecs. The redundant unspecs are removed along with their
code iterator.

gcc/ChangeLog:

2021-04-12  Jonathan Wright  <jonathan.wright@arm.com>

* config/aarch64/aarch64-simd-builtins.def: Modify comment to
make consistent with updated RTL pattern.
* config/aarch64/aarch64-simd.md (aarch64_<sur>qmovn<mode>):
Implement using ss_truncate and us_truncate rather than
unspecs.
* config/aarch64/iterators.md: Remove redundant unspecs and
iterator: UNSPEC_[SU]QXTN and SUQMOVN respectively.

gcc/config/aarch64/aarch64-simd-builtins.def
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/iterators.md

index f01a1b439e1fb67027932dbca56eca9826a203a0..337ec8d1f108b1a9f8e23ff85fb9a14dea0840c2 100644 (file)
   /* Implemented by aarch64_sqxtun2<mode>.  */
   BUILTIN_VQN (BINOP_UUS, sqxtun2, 0, NONE)
 
-  /* Implemented by aarch64_<sur>qmovn<mode>.  */
+  /* Implemented by aarch64_<su>qmovn<mode>.  */
   BUILTIN_VSQN_HSDI (UNOP, sqmovn, 0, NONE)
   BUILTIN_VSQN_HSDI (UNOP, uqmovn, 0, NONE)
 
index 72f429c75150c4b067ec5e8b9ca6ec514b5d74d8..fbfed334e97db07157878a6fb06b01faa5c03937 100644 (file)
 
 ;; sqmovn and uqmovn
 
-(define_insn "aarch64_<sur>qmovn<mode>"
+(define_insn "aarch64_<su>qmovn<mode>"
   [(set (match_operand:<VNARROWQ> 0 "register_operand" "=w")
-       (unspec:<VNARROWQ> [(match_operand:VSQN_HSDI 1 "register_operand" "w")]
-                            SUQMOVN))]
+       (SAT_TRUNC:<VNARROWQ>
+    (match_operand:VSQN_HSDI 1 "register_operand" "w")))]
   "TARGET_SIMD"
-  "<sur>qxtn\\t%<vn2>0<Vmntype>, %<v>1<Vmtype>"
+  "<su>qxtn\\t%<vn2>0<Vmntype>, %<v>1<Vmtype>"
    [(set_attr "type" "neon_sat_shift_imm_narrow_q")]
 )
 
index 3d66e6384f35c54ecd5255f7f376b54f9ba8dd7c..634c44e225c2f1925ac5c12e9399ec535726bf0c 100644 (file)
     UNSPEC_SUQADD      ; Used in aarch64-simd.md.
     UNSPEC_SQXTUN      ; Used in aarch64-simd.md.
     UNSPEC_SQXTUN2     ; Used in aarch64-simd.md.
-    UNSPEC_SQXTN       ; Used in aarch64-simd.md.
-    UNSPEC_UQXTN       ; Used in aarch64-simd.md.
     UNSPEC_SSRA                ; Used in aarch64-simd.md.
     UNSPEC_USRA                ; Used in aarch64-simd.md.
     UNSPEC_SRSRA       ; Used in aarch64-simd.md.
 
 (define_int_iterator USSUQADD [UNSPEC_SUQADD UNSPEC_USQADD])
 
-(define_int_iterator SUQMOVN [UNSPEC_SQXTN UNSPEC_UQXTN])
-
 (define_int_iterator VSHL [UNSPEC_SSHL UNSPEC_USHL
                           UNSPEC_SRSHL UNSPEC_URSHL])
 
                      (UNSPEC_SUBHN "") (UNSPEC_RSUBHN "r")
                      (UNSPEC_ADDHN2 "") (UNSPEC_RADDHN2 "r")
                      (UNSPEC_SUBHN2 "") (UNSPEC_RSUBHN2 "r")
-                     (UNSPEC_SQXTN "s") (UNSPEC_UQXTN "u")
                      (UNSPEC_USQADD "us") (UNSPEC_SUQADD "su")
                      (UNSPEC_SSLI  "s") (UNSPEC_USLI  "u")
                      (UNSPEC_SSRI  "s") (UNSPEC_USRI  "u")