diff options
author | Maciej W. Rozycki <macro@embecosm.com> | 2022-07-28 14:04:33 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@embecosm.com> | 2022-07-28 14:04:33 +0100 |
commit | 94f5a8f0d4910be2d861f7a9699e93efd609d042 (patch) | |
tree | c99f5ddacce04683572fe6689c9891b9a8916158 /libjava/javax | |
parent | ff26f0ba68fe6e870f315d0601b596f889b89680 (diff) | |
download | gcc-94f5a8f0d4910be2d861f7a9699e93efd609d042.zip gcc-94f5a8f0d4910be2d861f7a9699e93efd609d042.tar.gz gcc-94f5a8f0d4910be2d861f7a9699e93efd609d042.tar.bz2 |
RISC-V: Split unordered FP comparisons into individual RTL insns
We have unordered FP comparisons implemented as RTL insns that produce
multiple machine instructions. Such RTL insns are hard to match with a
processor pipeline description and additionally there is a redundant
SNEZ instruction produced on the result of these comparisons even though
the FLT.fmt and FLE.fmt machine instructions already produce either 0 or
1, e.g.:
long
flt (double x, double y)
{
return __builtin_isless (x, y);
}
with `-O2 -fno-finite-math-only -ftrapping-math -fno-signaling-nans'
gets compiled to:
.globl flt
.type flt, @function
flt:
frflags a5
flt.d a0,fa0,fa1
fsflags a5
snez a0,a0
ret
.size flt, .-flt
because the middle end can't see through the UNSPEC operation unordered
FP comparisons have been defined in terms of.
These instructions are only produced via an expander already, so change
the expander to emit individual RTL insns for each machine instruction
in the ultimate ultimate sequence produced rather than deferring to a
single RTL insn producing the whole sequence at once.
gcc/
* config/riscv/riscv.md (UNSPECV_FSNVSNAN): New constant.
(QUIET_PATTERN): New int attribute.
(f<quiet_pattern>_quiet<ANYF:mode><X:mode>4): Emit the intended
RTL insns entirely within the preparation statements.
(*f<quiet_pattern>_quiet<ANYF:mode><X:mode>4_default)
(*f<quiet_pattern>_quiet<ANYF:mode><X:mode>4_snan): Remove
insns.
(*riscv_fsnvsnan<mode>2): New insn.
gcc/testsuite/
* gcc.target/riscv/fle-ieee.c: New test.
* gcc.target/riscv/fle-snan.c: New test.
* gcc.target/riscv/fle.c: New test.
* gcc.target/riscv/flef-ieee.c: New test.
* gcc.target/riscv/flef-snan.c: New test.
* gcc.target/riscv/flef.c: New test.
* gcc.target/riscv/flt-ieee.c: New test.
* gcc.target/riscv/flt-snan.c: New test.
* gcc.target/riscv/flt.c: New test.
* gcc.target/riscv/fltf-ieee.c: New test.
* gcc.target/riscv/fltf-snan.c: New test.
* gcc.target/riscv/fltf.c: New test.
Diffstat (limited to 'libjava/javax')
0 files changed, 0 insertions, 0 deletions