aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@ventanamicro.com>2023-08-15 17:15:58 +0200
committerRobin Dapp <rdapp@ventanamicro.com>2023-08-24 13:12:49 +0200
commit8c3146ce0ee14bc6747fb92947879d82d43f3bb2 (patch)
tree8acf866f6339b9e390804e27daf336d25e4132c4
parent43da77a4f1636280c4259402c9c2c543e6ec6c0b (diff)
downloadgcc-8c3146ce0ee14bc6747fb92947879d82d43f3bb2.zip
gcc-8c3146ce0ee14bc6747fb92947879d82d43f3bb2.tar.gz
gcc-8c3146ce0ee14bc6747fb92947879d82d43f3bb2.tar.bz2
RISC-V: Fix reduc_strict_run-1 test case.
This patch fixes the reduc_strict_run-1 testcase by introducing a variable that holds the reference result. This is necessary because in presence of _Float16 emulation an intermediate result used in a comparison is computed in higher precision. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c: Add variable to hold reference result.
-rw-r--r--gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c
index 516be97..39c36ef 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict_run-1.c
@@ -17,7 +17,8 @@
asm volatile ("" ::: "memory"); \
} \
TYPE res = reduc_plus_##TYPE (a, b); \
- if (res != r * q) \
+ TYPE ref = r * q; \
+ if (res != ref) \
__builtin_abort (); \
}