nvptx: Support floating point reciprocal instructions
authorRoger Sayle <roger@nextmovesoftware.com>
Tue, 28 Jul 2020 13:55:47 +0000 (15:55 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 29 Jul 2020 21:05:46 +0000 (23:05 +0200)
commita0d007d67c85ecf4030bad8a6cf95f31bc6cb656
treee2a8c72bf3c48befec45895c1a5dd57763c71cc8
parent0f4a54ccb89c2fbd939f5385e359083e75e4d56f
nvptx: Support floating point reciprocal instructions

The following patch addds support for PTX's rcp.rn.f32 and rcp.rn.f64
instructions.  Note that the "rcp.rn" forms of this instruction
calculate the fully IEEE compliant result for the reciprocal, unlike
the rcp.approx variants that just provide fast approximations.

This patch has been tested on nvptx-none hosted on x86_64-pc-linux-gnu
with "make" and "make check" with no new regressions.

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

gcc/ChangeLog:

* config/nvptx/nvptx.md (recip<mode>2): New instruction.

gcc/testsuite/ChangeLog:

* gcc.target/nvptx/recip-1.c: New test.
gcc/config/nvptx/nvptx.md
gcc/testsuite/gcc.target/nvptx/recip-1.c [new file with mode: 0644]