From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC39D3858D20; Fri, 8 Sep 2023 02:12:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC39D3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694139139; bh=NfaIkaQs+J0a/5sNpXyKsqMf7aL4cECuZJjxw9t4U90=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lHJLFv0iy2DI9+rhv5FwTVJqChvrcjb1tv/ZSOnh7IbJ1C9M+srKswlOAuz4uepLC dYplZ07VGGS0xUKqOXxRSlkVktIry68AeQqQnjPa4FaZ5V7ni8lztG8KrhQxHjQZGG sidR/oKcFlCPAWU4hP4MpYb+Yj+l8Dp7kLvGnxvo= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111333] Runtime failure for fcmulcph instrinsic Date: Fri, 08 Sep 2023 02:12:19 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D111333 --- Comment #1 from Hongtao.liu --- fmulcph/fmaddcph is commutative for operands[1] and operands[2], but fcmulcph/fcmaddcph is not, since it's Complex conjugate operations. Below change fixes the issue. diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 6d3ae8dea0c..833546c5228 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -6480,6 +6480,14 @@ (define_int_attr complexpairopname [(UNSPEC_COMPLEX_FMA_PAIR "fmaddc") (UNSPEC_COMPLEX_FCMA_PAIR "fcmaddc")]) +(define_int_attr int_comm + [(UNSPEC_COMPLEX_FMA "%") + (UNSPEC_COMPLEX_FMA_PAIR "%") + (UNSPEC_COMPLEX_FCMA "") + (UNSPEC_COMPLEX_FCMA_PAIR "") + (UNSPEC_COMPLEX_FMUL "%") + (UNSPEC_COMPLEX_FCMUL "")]) + (define_int_attr conj_op [(UNSPEC_COMPLEX_FMA "") (UNSPEC_COMPLEX_FCMA "_conj") @@ -6593,7 +6601,7 @@ (define_expand "cmla4" (define_insn "fma__" [(set (match_operand:VHF_AVX512VL 0 "register_operand" "=3D&v") (unspec:VHF_AVX512VL - [(match_operand:VHF_AVX512VL 1 "" "%v") + [(match_operand:VHF_AVX512VL 1 "" "v") (match_operand:VHF_AVX512VL 2 "" "") (match_operand:VHF_AVX512VL 3 "" "0")] UNSPEC_COMPLEX_F_C_MA))] @@ -6658,7 +6666,7 @@ (define_insn_and_split "fma___fma_zero" (define_insn "fma___pair" [(set (match_operand:VF1_AVX512VL 0 "register_operand" "=3D&v") (unspec:VF1_AVX512VL - [(match_operand:VF1_AVX512VL 1 "vector_operand" "%v") + [(match_operand:VF1_AVX512VL 1 "vector_operand" "v") (match_operand:VF1_AVX512VL 2 "bcst_vector_operand" "vmBr") (match_operand:VF1_AVX512VL 3 "vector_operand" "0")] UNSPEC_COMPLEX_F_C_MA_PAIR))] @@ -6727,7 +6735,7 @@ (define_insn "___mask" [(set (match_operand:VHF_AVX512VL 0 "register_operand" "=3D&v") (vec_merge:VHF_AVX512VL (unspec:VHF_AVX512VL - [(match_operand:VHF_AVX512VL 1 "nonimmediate_operand" "%v") + [(match_operand:VHF_AVX512VL 1 "nonimmediate_operand" "v") (match_operand:VHF_AVX512VL 2 "nonimmediate_operand" "") (match_operand:VHF_AVX512VL 3 "register_operand" "0")] UNSPEC_COMPLEX_F_C_MA) @@ -6752,7 +6760,7 @@ (define_expand "cmul3" (define_insn "__" [(set (match_operand:VHF_AVX512VL 0 "register_operand" "=3D&v") (unspec:VHF_AVX512VL - [(match_operand:VHF_AVX512VL 1 "nonimmediate_operand" "%v") + [(match_operand:VHF_AVX512VL 1 "nonimmediate_operand" "v") (match_operand:VHF_AVX512VL 2 "nonimmediate_operand" "")] UNSPEC_COMPLEX_F_C_MUL))] "TARGET_AVX512FP16 && "=