[nvptx] Use atom.and.b64 instead of atom.b64.and

The ptx manual prescribes the instruction format atom{.space}.op.type but the
compiler currently emits:
...
  atom.b64.and %r31, [%r30], %r32;
...
which uses the instruction format atom{.space}.type.op.

Fix this by emitting instead:
...
  atom.and.b64  %r31, [%r30], %r32;
...

Tested on nvptx.

gcc/ChangeLog:

2022-03-07  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.md (define_insn "atomic_fetch_<logic><mode>"):
	Emit atom.and.b64 instead of atom.b64.and.

gcc/testsuite/ChangeLog:

2022-03-07  Tom de Vries  <tdevries@suse.de>

	* gcc.target/nvptx/atomic_fetch-1.c: Update.
	* gcc.target/nvptx/atomic_fetch-2.c: Update.
This commit is contained in:
Tom de Vries 2022-03-07 14:59:02 +01:00
parent 975e7ade35
commit 248bbcb2c3
3 changed files with 28 additions and 28 deletions

View File

@ -2226,7 +2226,7 @@
return "";
}
const char *t
= "%.\\tatom%A1.b%T0.<logic>\\t%0, %1, %2;";
= "%.\\tatom%A1.<logic>.b%T0\\t%0, %1, %2;";
return nvptx_output_atomic_insn (t, operands, 1, 3);
}

View File

@ -66,35 +66,35 @@ main()
/* Generic. */
/* { dg-final { scan-assembler-times "atom.add.u64" 1 } } */
/* { dg-final { scan-assembler-times "atom.b64.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.b64.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.b64.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.and.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.or.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.xor.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.xor.b32" 1 } } */
/* Global. */
/* { dg-final { scan-assembler-times "atom.global.add.u64" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b64.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b64.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b64.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.and.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.or.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.xor.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.xor.b32" 1 } } */
/* Shared. */
/* { dg-final { scan-assembler-times "atom.shared.add.u64" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b64.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b64.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b64.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.and.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.or.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.xor.b64" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.xor.b32" 1 } } */

View File

@ -69,9 +69,9 @@ main()
/* { dg-final { scan-assembler-times "atom.cas.b64" 3 } } */
/* { dg-final { scan-assembler-times "atom.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.xor.b32" 1 } } */
/* Global. */
@ -79,9 +79,9 @@ main()
/* { dg-final { scan-assembler-times "atom.global.cas.b64" 3 } } */
/* { dg-final { scan-assembler-times "atom.global.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.global.xor.b32" 1 } } */
/* Shared. */
@ -89,6 +89,6 @@ main()
/* { dg-final { scan-assembler-times "atom.shared.cas.b64" 3 } } */
/* { dg-final { scan-assembler-times "atom.shared.add.u32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.and" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.or" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.b32.xor" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.and.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.or.b32" 1 } } */
/* { dg-final { scan-assembler-times "atom.shared.xor.b32" 1 } } */