[PATCH] D104793: [ARM] Transform a floating-point to fixed-point conversion to a VCVT_fix

Sam Tebbs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 10:00:24 PDT 2021


samtebbs created this revision.
samtebbs added reviewers: dmgreen, SjoerdMeijer, NickGuy.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
samtebbs requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Much like fixed-point to floating-point conversion, the converse can also be transformed into a fixed-point VCVT. This patch transforms multiplications of floating point numbers by 2^n into a VCVT_fix. The exception is that a conversion with 1 fractional bit ends up being an FADD (FADD(x, x) emulates FMUL(x, 2)) rather than an FMUL so there is a special case for that. This patch also moves the code from https://reviews.llvm.org/D103903 into a separate function as fixed to float and float to fixed are very similar.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104793

Files:
  llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
  llvm/test/CodeGen/Thumb2/mve-vcvt-fixed-to-float.ll
  llvm/test/CodeGen/Thumb2/mve-vcvt-fixed.ll
  llvm/test/CodeGen/Thumb2/mve-vcvt-float-to-fixed.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104793.354006.patch
Type: text/x-patch
Size: 48024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210623/0d86ab07/attachment-0001.bin>


More information about the llvm-commits mailing list