aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/options.cc
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@embecosm.com>2023-11-22 01:18:30 +0000
committerMaciej W. Rozycki <macro@embecosm.com>2023-11-22 01:18:30 +0000
commit2f825475b2a64fce716a2628bdc631491dd3a1e1 (patch)
treef468d9ce4bf4e1b690662c4ca76489708b169156 /gcc/fortran/options.cc
parent37ff43c27344784caed28778fb847244a49644bd (diff)
downloadgcc-2f825475b2a64fce716a2628bdc631491dd3a1e1.zip
gcc-2f825475b2a64fce716a2628bdc631491dd3a1e1.tar.gz
gcc-2f825475b2a64fce716a2628bdc631491dd3a1e1.tar.bz2
RISC-V: Provide FP conditional-branch instructions for if-conversion
Do not expand floating-point conditional-branch RTL instructions right away that use a comparison operation that is either directly available as a machine conditional-set instruction or is NE, which can be emulated by EQ. This is so that if-conversion sees them in their original form and can produce fewer operations tried in a branchless code sequence compared to when such an instruction has been already converted to a sequence of a floating-point conditional-set RTL instruction followed by an integer conditional-branch RTL instruction. Split any floating-point conditional-branch RTL instructions still remaining after reload then. Adjust the testsuite accordingly: since the middle end uses the inverse condition internally, an inverse conditional-set instruction may make it to assembly output and also `cond_move_process_if_block' will be used by if-conversion rather than `noce_process_if_block', because the latter function not yet been updated to handle inverted conditions. gcc/ * config/riscv/predicates.md (ne_operator): New predicate. * config/riscv/riscv.cc (riscv_insn_cost): Handle branches on a floating-point condition. * config/riscv/riscv.md (@cbranch<mode>4): Rename expander to... (@cbranch<ANYF:mode>4): ... this. Only expand the RTX via `riscv_expand_conditional_branch' for `!signed_order_operator' operators, otherwise let it through. (*cbranch<ANYF:mode>4, *cbranch<ANYF:mode>4): New insns and splitters. gcc/testsuite/ * gcc.target/riscv/movdifge-sfb.c: Reject "if-conversion succeeded through" rather than accepting it. * gcc.target/riscv/movdifge-thead.c: Likewise. * gcc.target/riscv/movdifge-ventana.c: Likewise. * gcc.target/riscv/movdifge-zicond.c: Likewise. * gcc.target/riscv/movdifgt-sfb.c: Likewise. * gcc.target/riscv/movdifgt-thead.c: Likewise. * gcc.target/riscv/movdifgt-ventana.c: Likewise. * gcc.target/riscv/movdifgt-zicond.c: Likewise. * gcc.target/riscv/movdifle-sfb.c: Likewise. * gcc.target/riscv/movdifle-thead.c: Likewise. * gcc.target/riscv/movdifle-ventana.c: Likewise. * gcc.target/riscv/movdifle-zicond.c: Likewise. * gcc.target/riscv/movdiflt-sfb.c: Likewise. * gcc.target/riscv/movdiflt-thead.c: Likewise. * gcc.target/riscv/movdiflt-ventana.c: Likewise. * gcc.target/riscv/movdiflt-zicond.c: Likewise. * gcc.target/riscv/movsifge-sfb.c: Likewise. * gcc.target/riscv/movsifge-thead.c: Likewise. * gcc.target/riscv/movsifge-ventana.c: Likewise. * gcc.target/riscv/movsifge-zicond.c: Likewise. * gcc.target/riscv/movsifgt-sfb.c: Likewise. * gcc.target/riscv/movsifgt-thead.c: Likewise. * gcc.target/riscv/movsifgt-ventana.c: Likewise. * gcc.target/riscv/movsifgt-zicond.c: Likewise. * gcc.target/riscv/movsifle-sfb.c: Likewise. * gcc.target/riscv/movsifle-thead.c: Likewise. * gcc.target/riscv/movsifle-ventana.c: Likewise. * gcc.target/riscv/movsifle-zicond.c: Likewise. * gcc.target/riscv/movsiflt-sfb.c: Likewise. * gcc.target/riscv/movsiflt-thead.c: Likewise. * gcc.target/riscv/movsiflt-ventana.c: Likewise. * gcc.target/riscv/movsiflt-zicond.c: Likewise. * gcc.target/riscv/smax-ieee.c: Also accept FLT.D. * gcc.target/riscv/smaxf-ieee.c: Also accept FLT.S. * gcc.target/riscv/smin-ieee.c: Also accept FGT.D. * gcc.target/riscv/sminf-ieee.c: Also accept FGT.S.
Diffstat (limited to 'gcc/fortran/options.cc')
0 files changed, 0 insertions, 0 deletions