nvptx: Add support for vadd.add and vsub.add instructions.
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 6 Jul 2020 06:46:52 +0000 (07:46 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Mon, 6 Jul 2020 06:46:52 +0000 (07:46 +0100)
commite6f323372efa29091cf052a276c15b9e6ebc00ae
tree91c29733a9092d427fcb4bd44c9015f68d3e72c9
parentcf2bfc7c8013b7fc72ec5f104156fce736c2b3e1
nvptx: Add support for vadd.add and vsub.add instructions.

The following patch adds support for three-input addition instructions to
the nvptx backend.  The PTX ISA's "vadd.u32.u32.u32.add d, a, b, c"
instruction effectively implements 32-bit d = a+b+c, and the
"vsub.u32.u32.u32 d,a,b,c" instruction that provides 32-bit d = (a-b)+c.
The hope is that these mnemonics help ptxas generate the low-level
hardware's IADD3 instruction.

2020-07-06  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog:
* config/nvptx/nvptx.md (*vadd_addsi4): New instruction.
(*vsub_addsi4): New instruction.

gcc/testsuite/ChangeLog:
* gcc.target/nvptx/vadd_add.c: New test.
* gcc.target/nvptx/vsub_add.c: New test.
gcc/config/nvptx/nvptx.md
gcc/testsuite/gcc.target/nvptx/vadd_add.c [new file with mode: 0644]
gcc/testsuite/gcc.target/nvptx/vsub_add.c [new file with mode: 0644]