aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2022-09-22 12:48:30 +0100
committerAndrew Stubbs <ams@codesourcery.com>2022-10-11 11:49:25 +0100
commitbf6b5c74a6f1927174091c73aa51401895ef92f0 (patch)
treeea52878987a52bfeced07cb4ddba279b558c1ff6 /gcc
parent769a10d0fc45e4923d7eb631170a117529ad5e39 (diff)
downloadgcc-bf6b5c74a6f1927174091c73aa51401895ef92f0.zip
gcc-bf6b5c74a6f1927174091c73aa51401895ef92f0.tar.gz
gcc-bf6b5c74a6f1927174091c73aa51401895ef92f0.tar.bz2
amdgcn: Add vector integer negate insn
Another example of the vectorizer needing explicit insns where the scalar expander just works. gcc/ChangeLog: * config/gcn/gcn-valu.md (neg<mode>2): New define_expand.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/gcn/gcn-valu.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md
index f708e58..00c0e3b 100644
--- a/gcc/config/gcn/gcn-valu.md
+++ b/gcc/config/gcn/gcn-valu.md
@@ -2391,6 +2391,19 @@
(set_attr "length" "8,8")])
;; }}}
+;; {{{ Int unops
+
+(define_expand "neg<mode>2"
+ [(match_operand:V_INT 0 "register_operand")
+ (match_operand:V_INT 1 "register_operand")]
+ ""
+ {
+ emit_insn (gen_sub<mode>3 (operands[0], gcn_vec_constant (<MODE>mode, 0),
+ operands[1]));
+ DONE;
+ })
+
+;; }}}
;; {{{ FP binops - special cases
; GCN does not directly provide a DFmode subtract instruction, so we do it by