For float/double, the in-order fold-left reduction produced the same result as scalar codes.
But for _Float16 is not, I think the issue is not the reduction issue, is float 16 precision issue. Thanks. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-08-16 09:13 To: Robin Dapp; gcc-patches; palmer; Kito Cheng; juzhe.zh...@rivai.ai Subject: Re: [PATCH] RISC-V: Fix reduc_strict_run-1 test case. On 8/15/23 09:49, Robin Dapp wrote: > Hi, > > this patch changes the equality check for the reduc_strict_run-1 > testcase from == to fabs () < EPS. The FAIL only occurs with > _Float16 but I'd argue approximate equality is preferable for all > float modes. > > Regards > Robin > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c: > Check float equality with fabs < EPS. Generally agree with using an EPS test. The question is shouldn't a fold-left reduction be done in-order and produce the same result as a scalar equivalent? Jeff