From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 200353858C35; Fri, 24 Nov 2023 17:59:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 200353858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700848782; bh=4H5A2aab0cn6OHMa84ecPwJTzQ1QgXOxk+zAsxpKzXY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FRc5naZAUJUEAhK+LwUXwCOYD+FLHqZSmt3FXy+qrPJtxALLFrpYuocdSMCoQTc5r iqzbCZJghDKUgpNSLdffUVCyT0qhG77uaGoqwOilH6ufe/v5FxXrrcOJ2Fm5wkzJK4 t1YRMtBwXSMXGLb89fT76RltTAhjY8jxYn/QrWTc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112606] [14 Regression] powerpc64le-linux-gnu: 'FAIL: gcc.target/powerpc/p8vector-fp.c scan-assembler xsnabsdp' Date: Fri, 24 Nov 2023 17:59:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112606 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- So 2023-11-24 Jakub Jelinek PR target/112606 * config/rs6000/rs6000.md (copysign3): Change predicate of the last argument from gpc_reg_operand to any_operand. If operands[2] is CONST_DOUBLE, emit abs or neg abs depending on its sign, otherwise if it doesn't satisfy gpc_reg_operand, force it to REG using copy_to_mode_reg. --- gcc/config/rs6000/rs6000.md.jj 2023-10-13 19:34:43.927834877 +0200 +++ gcc/config/rs6000/rs6000.md 2023-11-24 18:54:13.587876170 +0100 @@ -5358,7 +5358,7 @@ (define_expand "copysign3" (set (match_dup 4) (neg:SFDF (abs:SFDF (match_dup 1)))) (set (match_operand:SFDF 0 "gpc_reg_operand") - (if_then_else:SFDF (ge (match_operand:SFDF 2 "gpc_reg_operand") + (if_then_else:SFDF (ge (match_operand:SFDF 2 "any_operand") (match_dup 5)) (match_dup 3) (match_dup 4)))] @@ -5369,6 +5369,24 @@ (define_expand "copysign3" || TARGET_CMPB || VECTOR_UNIT_VSX_P (mode))" { + /* Middle-end canonicalizes -fabs (x) to copysign (x, -1), + but PowerPC prefers -fabs (x). */ + if (CONST_DOUBLE_AS_FLOAT_P (operands[2])) + { + if (real_isneg (CONST_DOUBLE_REAL_VALUE (operands[2]))) + { + operands[3] =3D gen_reg_rtx (mode); + emit_insn (gen_abs2 (operands[3], operands[1])); + emit_insn (gen_neg2 (operands[0], operands[3])); + } + else + emit_insn (gen_abs2 (operands[0], operands[1])); + DONE; + } + + if (!gpc_reg_operand (operands[2], mode)) + operands[2] =3D copy_to_mode_reg (mode, operands[2]); + if (TARGET_CMPB || VECTOR_UNIT_VSX_P (mode)) { emit_insn (gen_copysign3_fcpsgn (operands[0], operands[1], then?=