[ARM] Transform a fixed-point to floating-point conversion into a VCVT_fix
authorSam Tebbs <samuel.tebbs@arm.com>
Mon, 7 Jun 2021 12:29:38 +0000 (13:29 +0100)
committerSam Tebbs <samuel.tebbs@arm.com>
Mon, 21 Jun 2021 13:14:09 +0000 (14:14 +0100)
commitbbe16b7af2d66d2abcf75ad72af6155d4da964cb
treea3d4d91bc04f1cccecb760cc9f48948ac561ebf1
parent4684cd543cfa5df04c9242df17a50e74b22b08bc
[ARM] Transform a fixed-point to floating-point conversion into a VCVT_fix

Conversion from a fixed-point number to a floating-point number is done by
multiplying the fixed-point number by 2^(-n) where n is the number of
fractional bits. Currently this is lowered to a vcvt
(integer to floating-point) then a vmul, but it can instead be lowered
directly to a vcvt (fixed-point to floating-point). This patch enables
such transformations as long as the multiplication factor is a power of 2.

Differential Revision: https://reviews.llvm.org/D103903
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/test/CodeGen/Thumb2/mve-vcvt-fixed.ll [new file with mode: 0644]