From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 360673851C3D; Thu, 17 Dec 2020 20:18:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 360673851C3D From: "tschwinge at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/98321] [nvptx] 'atom.add.f32' for atomic add of 32-bit 'float' Date: Thu, 17 Dec 2020 20:18:28 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tschwinge 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: 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 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, 17 Dec 2020 20:18:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98321 --- Comment #2 from Thomas Schwinge --- Thanks for having a look. (In reply to Tom de Vries from comment #1) > Ok, let's first make a runnable test-case: > ... > $ cat src/libgomp/testsuite/libgomp.oacc-c/test.c > [...] > Indeed we see the cas, but that has nothing to do with support in the nvp= tx > port: > ... > atom.cas.b32 %r29, [%r25], %r22, %r28;=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 >=20 > ... >=20 > This appears already at ompexp on the host, where we expand: > [...] > This is part of a generic problem with offloading, where choices are made= in > the host compiler which are suboptimal or even unsupported in the offload > compiler. Yes, I'm aware of that problem -- and we should do something about it. > Ideally this should be addressed in the host compiler. (Strike the "ideally"?) > It may be possible to address this in the nvptx port by trying to detect = the > unoptimal pattern and converting it to the optimal atom.add.f32. But > ultimately that's a workaround, and it's better to fix this at the source. I agree; don't see much point in investing effort in such a workaround (whi= ch doesn't sound easy either). However, my report was specifically for the nvptx target compiler. Just compile with 'nvptx-gcc -fopenacc -S' the code I posed, and compare '-DTYPE=3Dint'/'-DTYPE=3Dlong' vs. '-DTYPE=3Dfloat'.=