aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated/spread_r10.c
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2025-02-22 19:34:52 +0800
committerPan Li <pan2.li@intel.com>2025-02-28 07:33:17 +0800
commite7287cbbb208b676991096dd9081ff8a61c49781 (patch)
tree7446fba0fb1307616134f945c4d23e4868c99a81 /libgfortran/generated/spread_r10.c
parent955de3733a9ef301e2d95009cd59a1eb4ee5273c (diff)
downloadgcc-e7287cbbb208b676991096dd9081ff8a61c49781.zip
gcc-e7287cbbb208b676991096dd9081ff8a61c49781.tar.gz
gcc-e7287cbbb208b676991096dd9081ff8a61c49781.tar.bz2
RISC-V: Fix bug for expand_const_vector interleave [PR118931]
This patch would like to fix one bug when expanding const vector for the interleave case. For example, we have: base1 = 151 step = 121 For vec_series, we will generate vector in format of v[i] = base + i * step. Then the vec_series will have below result for HImode, and we can find that the result overflow to the highest 8 bits of HImode. v1.b = {151, 255, 7, 0, 119, 0, 231, 0, 87, 1, 199, 1, 55, 2, 167, 2} Aka we expect v1.b should be: v1.b = {151, 0, 7, 0, 119, 0, 231, 0, 87, 0, 199, 0, 55, 0, 167, 0} After that it will perform the IOR with v2 for the base2(aka another series). v2.b = {0, 17, 0, 33, 0, 49, 0, 65, 0, 81, 0, 97, 0, 113, 0, 129} Unfortunately, the base1 + i * step1 in HImode may overflow to the high 8 bits, and the high 8 bits will pollute the v2 and result in incorrect value in const_vector. This patch would like to perform the overflow to smode check before the optimized interleave code generation. If overflow or VLA, it will fall back to the default merge approach. The below test suites are passed for this patch. * The rv64gcv fully regression test. PR target/118931 gcc/ChangeLog: * config/riscv/riscv-v.cc (expand_const_vector): Add overflow to smode check and clean up highest bits if overflow. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr118931-run-1.c: New test. Signed-off-by: Pan Li <pan2.li@intel.com>
Diffstat (limited to 'libgfortran/generated/spread_r10.c')
0 files changed, 0 insertions, 0 deletions