]> granicus.if.org Git - llvm/commit
AMDGPU: Implement expansion of f16 = FP_TO_FP16 f64
authorTom Stellard <thomas.stellard@amd.com>
Tue, 1 Nov 2016 16:31:48 +0000 (16:31 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 1 Nov 2016 16:31:48 +0000 (16:31 +0000)
commit2b70009a94d900ffc848bddb59ba02a50481a8de
tree998f3662a17cfe19275d11d773111ee56afc5cd7
parentd6c57ac268ef85324ec444d07460700ea1db3384
AMDGPU: Implement expansion of f16 = FP_TO_FP16 f64

I wanted to implement this as a target independent expansion, however when
targets say they want to expand FP_TO_FP16 what they actually want is
the unsafe math expansion when possible and expansion to a libcall in all
other cases.

The only way to make this work as a target independent would be to add logic
to target's TargetLowering construction to mark theses nodes as Expand when
LegalizeDAG can use the unsafe expansion and mark them as LibCall when it
cannot.  I think this would be possible, but I think it would be too fragile
and complex as it would require targets to keep their expansion logic up
to date with the code in LegalizeDAG.

Reviewers: bogner, ab, t.p.northover, arsenm

Subscribers: wdng, llvm-commits, nhaehnle

Differential Revision: https://reviews.llvm.org/D25999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285704 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
test/CodeGen/AMDGPU/fptrunc.ll
test/CodeGen/AMDGPU/trunc-store-f64-to-f16.ll