[PATCH] D53235: [RISCV] Add RV64F codegen support

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 18:27:40 PDT 2018


asb created this revision.
asb added reviewers: apazos, sabuasal, eli.friedman, bogner.
Herald added subscribers: jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, simoncook, johnrusso, rbar.

This requires a little extra work due tothe fact i32 is not a legal type. When call lowering happens post-legalisation (e.g. when an intrinsic was inserted during legalisation). A bitcast from f32
to i32 can't be introduced. This is similar to the challenges with RV32D. To handle this, we introduce target-specific DAG nodes that perform bitcast+sext for f32->i64 and trunc+bitcast for i64->f32. Custom-lower ISD::BITCAST to select these nodes during legalisation. This makes it necessary to introduce a trivial fold for anyext where FromTy and ToTy are identical.


https://reviews.llvm.org/D53235

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  lib/Target/RISCV/RISCVISelLowering.cpp
  lib/Target/RISCV/RISCVISelLowering.h
  lib/Target/RISCV/RISCVInstrInfoF.td
  test/CodeGen/RISCV/float-arith.ll
  test/CodeGen/RISCV/float-br-fcmp.ll
  test/CodeGen/RISCV/float-convert.ll
  test/CodeGen/RISCV/float-fcmp.ll
  test/CodeGen/RISCV/float-imm.ll
  test/CodeGen/RISCV/float-mem.ll
  test/CodeGen/RISCV/float-select-fcmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53235.169532.patch
Type: text/x-patch
Size: 57457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181013/b0d17597/attachment.bin>


More information about the llvm-commits mailing list