From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AF2153857408; Thu, 19 Aug 2021 18:36:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF2153857408 From: "simb611alt at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/101985] New: vec_cpsgn parameter order Date: Thu, 19 Aug 2021 18:36:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simb611alt 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2021 18:36:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101985 Bug ID: 101985 Summary: vec_cpsgn parameter order Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: simb611alt at gmail dot com Target Milestone: --- I have found an issue where the parameter order of the vec_cpsgn function on POWER is reversed. Clang has recently fixed the same issue in their code wh= ich leaves only GCC using the reversed order. XLC always used the order clang currently uses. Patch link for clang - https://github.com/llvm/llvm-project/commit/1af037f643fc5499f83d92e5aec1999= 50871d475 Link to POWER documentation - http://cdn.openpowerfoundation.org/wp-content/uploads/resources/Intrinsics-= Reference/content/VIPR.reference.vecfns.html #include #include int main() { vector float a =3D { 1, 2, - 3, - 4}; vector float b =3D {-10, 20, -30, 40}; a =3D vec_cpsgn(a, b); printf("%f %f %f %f\n", a[0], a[1], a[2], a[3]); return 0; } Output for GCC 11.0.1: -1.000000 2.000000 -3.000000 4.000000 Output for clang 12.0.1: 10.000000 20.000000 -30.000000 -40.000000 Output for xlc 16.1.1: 10.000000 20.000000 -30.000000 -40.000000=