[RISCV] Support Bit-Preserving FP in F/D Extensions
authorSam Elliott <selliott@lowrisc.org>
Fri, 7 Jun 2019 12:20:14 +0000 (12:20 +0000)
committerSam Elliott <selliott@lowrisc.org>
Fri, 7 Jun 2019 12:20:14 +0000 (12:20 +0000)
commitf720647ddd718cdd97d86ac3d1ca9e2d3c748020
treec72a58669bf8f3eb49465419e4b5ab81b10db6e6
parentcb8de55f474984be7d21c4c43140e134af09bfa5
[RISCV] Support Bit-Preserving FP in F/D Extensions

Summary:
This allows some integer bitwise operations to instead be performed by
hardware fp instructions. This is correct because the RISC-V spec
requires the F and D extensions to use the IEEE-754 standard
representation, and fp register loads and stores to be bit-preserving.

This is tested against the soft-float ABI, but with hardware float
extensions enabled, so that the tests also ensure the optimisation also
fires in this case.

Reviewers: asb, luismarques

Reviewed By: asb

Subscribers: hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62900

llvm-svn: 362790
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/test/CodeGen/RISCV/float-bit-preserving-dagcombines.ll [new file with mode: 0644]