This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Update llvm.amdgcn.frexp.exp intrinsic and lower it to v_frexp_exp_i16_f16 instruction
AbandonedPublic

Authored by kzhuravl on Nov 9 2016, 3:06 PM.

Details

Diff Detail

Event Timeline

kzhuravl updated this revision to Diff 77401.Nov 9 2016, 3:06 PM
kzhuravl retitled this revision from to [AMDGPU] Update llvm.amdgcn.frexp.exp intrinsic and lower it to v_frexp_exp_i16_f16 instruction.
kzhuravl updated this object.
kzhuravl added reviewers: tstellarAMD, arsenm.
kzhuravl added a subscriber: llvm-commits.
arsenm added inline comments.Nov 9 2016, 4:15 PM
include/llvm/IR/IntrinsicsAMDGPU.td
181

Could we add a LLVMMatchType to get an int the same width as the FP type to avoid a second mangled parameter? Also could we just leave it as i32? I think it just zeroes the high 16-bits anyway

kzhuravl added inline comments.Nov 10 2016, 9:47 AM
include/llvm/IR/IntrinsicsAMDGPU.td
181

Hi Matt, I do not think I understand your suggestion entirely (LLVMMatchType part of it), can you explain it a bit more?

We could leave i32 in the return type of the intrinsic and change V_FREXP_EXP_I16_F16 to VOP_I32_F16 and higher 16 bits will be zeroed.

arsenm added inline comments.Nov 11 2016, 10:06 AM
include/llvm/IR/IntrinsicsAMDGPU.td
181

I think we would need to add another one that would be simple to implement in TableGen, something like a LLVMMatchIntFPBitWidth<>. However, we don't actually want that because in the f64 case it's still i32 (which is also part of why I don't understand why this would have been changed to return i16)

kzhuravl abandoned this revision.Nov 11 2016, 12:24 PM

Included in D25975