or1k: Initial support for FPU

Programming / Compilers / GCC - shorne [138bc75d-0d04-0410-961f-82ee72b054a4] - 21 July 2019 21:01 EDT

This adds support for OpenRISC hardware floating point instructions. This is enabled with the -mhard-float option.

Double-prevision floating point operations work using register pairing as specified in: https://openrisc.io/proposals/orfpx64a32. This has just been added in the OpenRISC architecture specification 1.3. This is enabled with the -mdouble-float option.

Not all architectures support unordered comparisons so an option,
-munordered-float is added.

Currently OpenRISC does not support sf/df or df/sf conversions, but this has also just been added in architecture specification 1.3.


- config.gcc (or1k*-*-*): Add mhard-float, mdouble-float, msoft-float and munordered-float validations.
- config/or1k/constraints.md (d): New register constraint.
- config/or1k/predicates.md (fp_comparison_operator): New.
- config/or1k/or1k.c (or1k_print_operand): Add support for printing 'd' operands. (or1k_expand_compare): Normalize unordered comparisons.
- config/or1k/or1k.h (reg_class): Define DOUBLE_REGS. (REG_CLASS_NAMES): Add "DOUBLE_REGS". (REG_CLASS_CONTENTS): Add contents for DOUBLE_REGS.
- config/or1k/or1k.md (type): Add fpu. (fpu): New instruction reservation. (F, f, fr, fi, FI, FOP, fop): New. (3): New ALU instruction definition. (float2): New conversion instruction definition. (fix_trunc2): New conversion instruction definition. (fpcmpcc): New code iterator. (*sf_fp_insn): New instruction definition. (cstore4): New expand definition. (cbranch4): New expand definition.
- config/or1k/or1k.opt (msoft-float, mhard-float, mdouble-float, munordered-float): New options.
- doc/invoke.texi: Document msoft-float, mhard-float, mdouble-float and munordered-float.

34f4be08f5b or1k: Initial support for FPU
gcc/ChangeLog | 27 ++++++++++
gcc/config.gcc | 1 +
gcc/config/or1k/constraints.md | 4 ++
gcc/config/or1k/or1k.c | 38 +++++++++++++-
gcc/config/or1k/or1k.h | 3 ++
gcc/config/or1k/or1k.md | 111 ++++++++++++++++++++++++++++++++++++++++-
gcc/config/or1k/or1k.opt | 22 ++++++++
gcc/config/or1k/predicates.md | 5 ++
gcc/doc/invoke.texi | 21 ++++++++
9 files changed, 228 insertions(+), 4 deletions(-)

Upstream: gcc.gnu.org

  • Share