diff options
author | Tom de Vries <tdevries@suse.de> | 2020-09-22 13:16:39 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-09-23 09:21:20 +0200 |
commit | ca52f937fff52c494ef2951490c1654750ef8157 (patch) | |
tree | 69c5b36647f5ab44c798abd81e27fc6568959803 | |
parent | 28d3b78dff512e18fc45c45e10c705e2a5ae3b48 (diff) | |
download | gcc-ca52f937fff52c494ef2951490c1654750ef8157.zip gcc-ca52f937fff52c494ef2951490c1654750ef8157.tar.gz gcc-ca52f937fff52c494ef2951490c1654750ef8157.tar.bz2 |
[nvptx] Handle move from DF subreg to DF reg in nvptx_output_mov_insn
When compiling test-case gcc.dg/atomic/c11-atomic-exec-1.c, we run into
these ptxas errors:
...
line 100; error: Rounding modifier required for instruction 'cvt'
line 105; error: Rounding modifier required for instruction 'cvt'
...
The problem is that this move:
...
//(insn 13 11 14 2
// (set (reg:DF 28 [ _9 ])
// (subreg:DF (reg:TI 22 [ _1 ]) 0)) 9 {*movdf_insn}
// (nil))
cvt.f64.u64 %r28, %r22$0;
...
is emitted as cvt.f64.u64, while it should be a mov.b64 instead.
Fix this by handling this case in nvptx_output_mov_insn.
Tested on nvptx.
gcc/ChangeLog:
PR target/97158
* config/nvptx/nvptx.c (nvptx_output_mov_insn): Handle move from
DF subreg to DF reg.
-rw-r--r-- | gcc/config/nvptx/nvptx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 0c590d8..54b1fdf 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -2349,6 +2349,7 @@ const char * nvptx_output_mov_insn (rtx dst, rtx src) { machine_mode dst_mode = GET_MODE (dst); + machine_mode src_mode = GET_MODE (src); machine_mode dst_inner = (GET_CODE (dst) == SUBREG ? GET_MODE (XEXP (dst, 0)) : dst_mode); machine_mode src_inner = (GET_CODE (src) == SUBREG @@ -2375,7 +2376,7 @@ nvptx_output_mov_insn (rtx dst, rtx src) if (GET_MODE_SIZE (dst_inner) == GET_MODE_SIZE (src_inner)) { if (GET_MODE_BITSIZE (dst_mode) == 128 - && GET_MODE_BITSIZE (GET_MODE (src)) == 128) + && GET_MODE_BITSIZE (src_mode) == 128) { /* mov.b128 is not supported. */ if (dst_inner == V2DImode && src_inner == TImode) @@ -2388,6 +2389,10 @@ nvptx_output_mov_insn (rtx dst, rtx src) return "%.\tmov.b%T0\t%0, %1;"; } + if (GET_MODE_BITSIZE (src_inner) == 128 + && GET_MODE_BITSIZE (src_mode) == 64) + return "%.\tmov.b%T0\t%0, %1;"; + return "%.\tcvt%t0%t1\t%0, %1;"; } |