AMDGPU/GlobalISel: Legalize G_FPOW
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 20 Feb 2020 23:59:08 +0000 (18:59 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Fri, 21 Feb 2020 15:31:13 +0000 (10:31 -0500)
commit79ff188addeeea127c7a7edd808c5821917d4bb6
treea3623f5e32d7a3eb14b6fe8e7d89e06754b03676
parentfab4cdea3911b19d1b1819102aee0252cbd4eba4
AMDGPU/GlobalISel: Legalize G_FPOW

There are few differences from the DAG handling. First, the DAG
handling uses a primitive selection pattern instead of custom
legalizing it. Because of this, this makes use of source modifiers
while the DAG does not.

Also instead of promoting f16, try to use the f16 log/exp. There's no
f16 fmul_legacy, so widen just for the multiply, although I'm not sure
that's the best solution.
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h
llvm/test/CodeGen/AMDGPU/GlobalISel/fpow.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fpow.mir