On 5/1/24 12:44 PM, Patrick O'Neill wrote:

FAIL: gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c execution test

on rv32gcv newlib/linux.
So the issue here is the code tried to handle DFmode inputs for rv32 by converting to a SImode integer. That's not a good idea on multiple levels. But if we focus just on math-nearbyint-run-2.....

The coefficient test was based on the input mode, DF in this case. That test said, yes it was safe to use the conversion instruction. The conversion instruction was generating an SImode output, so the set of values it could correctly handle was limited by the range of an SImode object. The mismatch caused things to go astray.

Pondering this space overnight what's clear to me is that the coefficient test and the output of the conversion must be based on the same sized objects. ie, DF/DI or SF/SI. Doing something like DF/SI isn't right.

This means in the rv32 space, we can't use the conversion instructions for a DFmode object. Pretty simple.

While I was in the code the other issue I saw was HFmode handling. We can handle HFmode when Zfa is enabled, but we should avoid it otherwise as we don't have the relevant patterns we'd need.

I'm testing a fix for both of these issues as well as the whitespace nits caught by the CI system.

jeff

Reply via email to