aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorVictor Do Nascimento <victor.donascimento@arm.com>2024-06-05 11:11:06 +0100
committerVictor Do Nascimento <victor.donascimento@arm.com>2024-09-30 15:59:43 +0100
commitbfa44e604d63ebb90dd2ef645820c4db44cdfd7c (patch)
tree5a40adf9eb01528d8cca0ca646819db8c255149a /gcc
parent0d0be1d10db2a1877804feb3b9f58f8461835815 (diff)
downloadgcc-bfa44e604d63ebb90dd2ef645820c4db44cdfd7c.zip
gcc-bfa44e604d63ebb90dd2ef645820c4db44cdfd7c.tar.gz
gcc-bfa44e604d63ebb90dd2ef645820c4db44cdfd7c.tar.bz2
arm: Fix arm backend-use of (u|s|us)dot_prod patterns
Given recent changes to the dot_prod standard pattern name, this patch fixes the arm back-end by implementing the following changes: 1. Add 2nd mode to all patterns relating to the dot-product in .md files. 2. redirect the single-mode CODE_FOR_neon_(u|s|us)dot<mode> values generated from `arm_neon_builtins.def' to their new 2-mode equivalents via means of simple aliases, as per the following example: constexpr insn_code CODE_FOR_neon_sdotv8qi = CODE_FOR_neon_sdotv2siv8qi; gcc/ChangeLog: * config/arm/neon.md (<sup>dot_prod<vsi2qi>): Renamed to... (<sup>dot_prod<mode><vsi2qi>): ...this. (neon_<sup>dot<vsi2qi>): Renamed to... (neon_<sup>dot<mode><vsi2qi>): ...this. (neon_usdot<vsi2qi>): Renamed to... (neon_usdot<mode><vsi2qi>): ...this. (usdot_prod<vsi2qi>): Renamed to... (usdot_prod<mode><vsi2qi>): ...this. * config/arm/arm-builtins.cc (CODE_FOR_neon_sdotv8qi): Definie as alias to new CODE_FOR_neon_sdotv2siv8qi. (CODE_FOR_neon_udotv8qi): Definie as alias to new CODE_FOR_neon_udotv2siv8qi. (CODE_FOR_neon_usdotv8qi): Definie as alias to new CODE_FOR_neon_usdotv2siv8qi. (CODE_FOR_neon_sdotv16qi): Definie as alias to new CODE_FOR_neon_sdotv4siv16qi. (CODE_FOR_neon_udotv16qi): Definie as alias to new CODE_FOR_neon_udotv4siv16qi. (CODE_FOR_neon_usdotv16qi): Definie as alias to new CODE_FOR_neon_usdotv4siv16qi.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm-builtins.cc7
-rw-r--r--gcc/config/arm/neon.md8
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/config/arm/arm-builtins.cc b/gcc/config/arm/arm-builtins.cc
index c9d50bf..74cea89 100644
--- a/gcc/config/arm/arm-builtins.cc
+++ b/gcc/config/arm/arm-builtins.cc
@@ -908,6 +908,13 @@ typedef struct {
enum arm_type_qualifiers *qualifiers;
} arm_builtin_datum;
+constexpr insn_code CODE_FOR_neon_sdotv8qi = CODE_FOR_neon_sdotv2siv8qi;
+constexpr insn_code CODE_FOR_neon_udotv8qi = CODE_FOR_neon_udotv2siv8qi;
+constexpr insn_code CODE_FOR_neon_usdotv8qi = CODE_FOR_neon_usdotv2siv8qi;
+constexpr insn_code CODE_FOR_neon_sdotv16qi = CODE_FOR_neon_sdotv4siv16qi;
+constexpr insn_code CODE_FOR_neon_udotv16qi = CODE_FOR_neon_udotv4siv16qi;
+constexpr insn_code CODE_FOR_neon_usdotv16qi = CODE_FOR_neon_usdotv4siv16qi;
+
#define CF(N,X) CODE_FOR_neon_##N##X
#define VAR1(T, N, A) \
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md
index fa4a7ae..6892b7b 100644
--- a/gcc/config/arm/neon.md
+++ b/gcc/config/arm/neon.md
@@ -2989,7 +2989,7 @@
;; ...
;;
;; and so the vectorizer provides r, in which the result has to be accumulated.
-(define_insn "<sup>dot_prod<vsi2qi>"
+(define_insn "<sup>dot_prod<mode><vsi2qi>"
[(set (match_operand:VCVTI 0 "register_operand" "=w")
(plus:VCVTI
(unspec:VCVTI [(match_operand:<VSI2QI> 1 "register_operand" "w")
@@ -3002,7 +3002,7 @@
)
;; These instructions map to the __builtins for the Dot Product operations
-(define_expand "neon_<sup>dot<vsi2qi>"
+(define_expand "neon_<sup>dot<mode><vsi2qi>"
[(set (match_operand:VCVTI 0 "register_operand" "=w")
(plus:VCVTI
(unspec:VCVTI [(match_operand:<VSI2QI> 2 "register_operand")
@@ -3013,7 +3013,7 @@
)
;; These instructions map to the __builtins for the Dot Product operations.
-(define_insn "neon_usdot<vsi2qi>"
+(define_insn "neon_usdot<mode><vsi2qi>"
[(set (match_operand:VCVTI 0 "register_operand" "=w")
(plus:VCVTI
(unspec:VCVTI
@@ -3112,7 +3112,7 @@
)
;; Auto-vectorizer pattern for usdot
-(define_expand "usdot_prod<vsi2qi>"
+(define_expand "usdot_prod<mode><vsi2qi>"
[(set (match_operand:VCVTI 0 "register_operand")
(plus:VCVTI (unspec:VCVTI [(match_operand:<VSI2QI> 1
"register_operand")