aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-float.cc
diff options
context:
space:
mode:
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>2023-03-29 10:42:59 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-04-02 16:27:32 +0800
commitdb4f7a9b47d148b5074ac15910124c746fb7a96f (patch)
tree50961d3a341d685a95eeb15595d96b14942ea025 /gcc/range-op-float.cc
parent236cde7202aba9c8fee00035f6685fab1eecd808 (diff)
downloadgcc-db4f7a9b47d148b5074ac15910124c746fb7a96f.zip
gcc-db4f7a9b47d148b5074ac15910124c746fb7a96f.tar.gz
gcc-db4f7a9b47d148b5074ac15910124c746fb7a96f.tar.bz2
RISC-V: Fix ICE and codegen error of scalar move in RV32 system.
We need to reset the AVL to 0 or 1 for scalar move for RV32 system, For any non-zero AVL input, we set that to 1, and zero will keep as zero. We are using wrong way (by andi with 1) before to achieve that, and it will cause ICE with const_int, and also wrong behavior, so now we have two code path, one for const_int and one for non-const_int. bug.C:144:2: error: unrecognizable insn: 144 | } | ^ (insn 684 683 685 26 (set (reg:SI 513) (and:SI (const_int 4 [0x4]) (const_int 1 [0x1]))) "bug.C":115:47 -1 (nil)) andi a4,a4,1 ===> sgtu a4,a4,zero vsetlvi tu vsetvli tu vlse vlse gcc/ChangeLog: * config/riscv/riscv-protos.h (gen_avl_for_scalar_move): New function. * config/riscv/riscv-v.cc (gen_avl_for_scalar_move): New function. * config/riscv/vector.md: Fix scalar move bug. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/scalar_move-6.c: Adapt test. * gcc.target/riscv/rvv/base/scalar_move-9.c: New test.
Diffstat (limited to 'gcc/range-op-float.cc')
0 files changed, 0 insertions, 0 deletions