]>
git.ipfire.org Git - thirdparty/gcc.git/commit
prefer Zicond primitive semantics to SFB
Move Zicond md files ahead of SFB to recognize Zicond first.
Take the following case for example.
CFLAGS: -mtune=sifive-7-series -march=rv64gc_zicond -mabi=lp64d
long primitiveSemantics_00(long a, long b) { return a == 0 ? 0 : b; }
before patch:
primitiveSemantics_00:
bne a0,zero,1f # movcc
mv a1,zero
1:
mv a0,a1
ret
after patch:
primitiveSemantics_00:
czero.eqz a0,a1,a0
ret
Co-authored-by: Xiao Zeng<zengxiao@eswincomputing.com>
gcc/ChangeLog:
* config/riscv/riscv.md (*mov<GPR:mode><X:mode>cc):move to sfb.md
* config/riscv/sfb.md: New file.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/zicond-sfb-primitiveSemantics.c: New test.