From bf6b5c74a6f1927174091c73aa51401895ef92f0 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Thu, 22 Sep 2022 12:48:30 +0100 Subject: 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 (neg2): New define_expand. --- gcc/config/gcn/gcn-valu.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc') 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 "neg2" + [(match_operand:V_INT 0 "register_operand") + (match_operand:V_INT 1 "register_operand")] + "" + { + emit_insn (gen_sub3 (operands[0], gcn_vec_constant (mode, 0), + operands[1])); + DONE; + }) + +;; }}} ;; {{{ FP binops - special cases ; GCN does not directly provide a DFmode subtract instruction, so we do it by -- cgit v1.1