> Isn't this wrong for SImode on rv64?  It seems to me the right test is 
> mode != word_mode?
> Assuming that works, it's OK for the trunk.

Thanks Jeff, Simode version of test file doesn't have this issue. Thus, only HI 
and QI here.
I will add a new test for SImode in v3 to ensure this.

Pan

-----Original Message-----
From: Jeff Law <jeffreya...@gmail.com> 
Sent: Tuesday, August 13, 2024 12:58 AM
To: Li, Pan2 <pan2...@intel.com>; gcc-patches@gcc.gnu.org
Cc: juzhe.zh...@rivai.ai; kito.ch...@gmail.com; rdapp....@gmail.com
Subject: Re: [PATCH v2] RISC-V: Make sure high bits of usadd operands is clean 
for HI/QI [PR116278]



On 8/11/24 4:43 AM, pan2...@intel.com wrote:

> +static rtx
> +riscv_gen_zero_extend_rtx (rtx x, machine_mode mode)
> +{
> +  if (mode != HImode && mode != QImode)
> +    return gen_lowpart (Xmode, x);
Isn't this wrong for SImode on rv64?  It seems to me the right test is 
mode != word_mode?


Assuming that works, it's OK for the trunk.

jeff

Reply via email to