ucb-bar / esp-llvm

UCB-BAR fork of LLVM! NOT UPSTREAM RISCV LLVM
Other
123 stars 55 forks source link

fmadd.s/.d implementation #44

Open rtcw50 opened 7 years ago

rtcw50 commented 7 years ago

I take it from other comments in the issues list that pull requests aren't being reviewed/merged, so I'd like to present some changes that implement fmadd.s/.d code generation to any that are interested.

The code is available at https://github.com/rtcw50/riscv-llvm (branch riscv-trunk on this fork) https://github.com/rtcw50/riscv-clang(branch riscv-trunk on this fork)

The clang code makes -ffp-contract=on the default (it can be disabled either with #pragma FP_CONTRACT OFF or -ffp-contract=off). This allows the fma intrinsic to be generated by default, lowered to ISD:FMA, and subsequently codegen'd to fmadd.

A few tests added to test/CodeGen/RISCV to test the presence or absence of fmadd.