From: Andrew Stubbs Date: Thu, 22 Sep 2022 11:48:30 +0000 (+0100) Subject: amdgcn: Add vector integer negate insn X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a199fcd8bb00be552c49ea2ddc6510f6e383c3b7;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index c388c4833f55..7dcc22020724 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,10 @@ +2022-10-12 Andrew Stubbs + + Backport from mainline: + 2022-10-11 Andrew Stubbs + + * config/gcn/gcn-valu.md (neg2): New define_expand. + 2022-10-12 Andrew Stubbs Backport from mainline: diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index 3e7434a02a82..9691ff480cec 100644 --- a/gcc/config/gcn/gcn-valu.md +++ b/gcc/config/gcn/gcn-valu.md @@ -2393,6 +2393,19 @@ [(set_attr "type" "vop2,ds") (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