aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.cc
diff options
context:
space:
mode:
authorJin Ma <jinma@linux.alibaba.com>2023-08-25 15:34:40 -0600
committerJeff Law <jlaw@ventanamicro.com>2023-08-25 15:41:05 -0600
commit30699b999e94b66ff8706d3b07a35b2a9554d10c (patch)
tree36ad0cf04c3e54beafe842c97964f11517d75de8 /gcc/tree-ssa-phiopt.cc
parent87f9b6c2cfd7b8299b2ab50bf587e864ced43185 (diff)
downloadgcc-30699b999e94b66ff8706d3b07a35b2a9554d10c.zip
gcc-30699b999e94b66ff8706d3b07a35b2a9554d10c.tar.gz
gcc-30699b999e94b66ff8706d3b07a35b2a9554d10c.tar.bz2
[PATCH v10] RISC-V: Add support for the Zfa extension
This patch adds the 'Zfa' extension for riscv, which is based on: https://github.com/riscv/riscv-isa-manual/commits/zfb The binutils-gdb for 'Zfa' extension: https://sourceware.org/pipermail/binutils/2023-April/127060.html What needs special explanation is: 1, According to riscv-spec, "The FCVTMO D.W.D instruction was added principally to accelerate the processing of JavaScript Numbers.", so it seems that no implementation is required. 2, The instructions FMINM and FMAXM correspond to C23 library function fminimum and fmaximum. Therefore, this patch has simply implemented the pattern of fminm<hf\sf\df>3 and fmaxm<hf\sf\df>3 to prepare for later. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add zfa extension version, which depends on the F extension. * config/riscv/constraints.md (zfli): Constrain the floating point number that the instructions FLI.H/S/D can load. * config/riscv/iterators.md (ceil): New. * config/riscv/riscv-opts.h (MASK_ZFA): New. (TARGET_ZFA): New. * config/riscv/riscv-protos.h (riscv_float_const_rtx_index_for_fli): New. * config/riscv/riscv.cc (riscv_float_const_rtx_index_for_fli): New. (riscv_cannot_force_const_mem): If instruction FLI.H/S/D can be used, memory is not applicable. (riscv_const_insns): Likewise. (riscv_legitimize_const_move): Likewise. (riscv_split_64bit_move_p): If instruction FLI.H/S/D can be used, no split is required. (riscv_split_doubleword_move): Likewise. (riscv_output_move): Output the mov instructions in zfa extension. (riscv_print_operand): Output the floating-point value of the FLI.H/S/D immediate in assembly. (riscv_secondary_memory_needed): Likewise. * config/riscv/riscv.md (fminm<mode>3): New. (fmaxm<mode>3): New. (movsidf2_low_rv32): New. (movsidf2_high_rv32): New. (movdfsisi3_rv32): New. (f<quiet_pattern>_quiet<ANYF:mode><X:mode>4_zfa): New. * config/riscv/riscv.opt: New. gcc/testsuite/ChangeLog: * gcc.target/riscv/zfa-fleq-fltq.c: New test. * gcc.target/riscv/zfa-fli-zfh.c: New test. * gcc.target/riscv/zfa-fli.c: New test. * gcc.target/riscv/zfa-fmovh-fmovp.c: New test. * gcc.target/riscv/zfa-fli-1.c: New test. * gcc.target/riscv/zfa-fli-2.c: New test. * gcc.target/riscv/zfa-fli-3.c: New test. * gcc.target/riscv/zfa-fli-4.c: New test. * gcc.target/riscv/zfa-fli-6.c: New test. * gcc.target/riscv/zfa-fli-7.c: New test. * gcc.target/riscv/zfa-fli-8.c: New test. Co-authored-by: Tsukasa OI <research_trasio@irq.a4lg.com>
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
0 files changed, 0 insertions, 0 deletions