From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 965183858D28; Thu, 19 Oct 2023 09:36:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965183858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697708177; bh=fZhN1bxgVJtneLDnKWxKppzK0AWnAb1t1Q7k5TbSaHg=; h=From:To:Subject:Date:From; b=hJpapSUc1hXQPfepq3/WLHcO03WCMulRphqpz+LjUwOyHR4EhTI40f0BYCjK9pZC6 HV3TuWcVhbHO6sVnBYFABbwvlAeYOBIqTTOEONIvXG+DCvTzX7h0T6PMtcCv5oQdgi gEZbYMncBABc3SCMBkjAdoaoQ0qzRywWE4ShZ9qc= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111876] New: aarch64: Wrong code for bf16 complex mul/div when the target has +fp16 support. Date: Thu, 19 Oct 2023 09:36:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: iains 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111876 Bug ID: 111876 Summary: aarch64: Wrong code for bf16 complex mul/div when the target has +fp16 support. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: iains at gcc dot gnu.org Target Milestone: --- this is somewhat similar to PR111867, but in this case the issue seems to happen at expand time. ---- reduced from "bfloat16-complex.c" volatile __bf16 a =3D 1.0bf16; typedef _Complex float __cbf16 __attribute__((__mode__(__BC__))); volatile __cbf16 b =3D __builtin_complex (2.0bf16, 3.0bf16); int main (void) { volatile __cbf16 r ; r =3D a + b; r *=3D r; return 0; } ---- For -march=3Darmv8.4-a+fp16 This lowers to calls to (non-existent libgcc) ___mulbc3 (and __divbc3, when division is included). For -march=3Darmv8.4-a This promotes the bf16 -> float and calls __mulsc3 (which exists)=