Re: [PATCH] nvptx: Use cvt to perform sign-extension of truncation.

2021-12-08 Thread Tom de Vries via Gcc-patches
On 8/27/21 12:07 PM, Roger Sayle wrote: > > This patch introduces some new define_insn rules to the nvptx backend, > to perform sign-extension of a truncation (from and to the same mode), > using a single cvt instruction. As an example, the following function > > int foo(int x) { return (char)x;

[PATCH] nvptx: Use cvt to perform sign-extension of truncation.

2021-08-27 Thread Roger Sayle
This patch introduces some new define_insn rules to the nvptx backend, to perform sign-extension of a truncation (from and to the same mode), using a single cvt instruction. As an example, the following function int foo(int x) { return (char)x; } with -O2 currently generates: mov.u32 %