This is an archive of the discontinued LLVM Phabricator instance.

[X86][FP16] Only generate approximate rsqrt when Reciprocal is true for half type
ClosedPublic

Authored by pengfei on Nov 30 2021, 10:03 PM.

Details

Summary

We have reasonable fast sqrt and accurate rsqrt for half type due to the
limited fractions. So neither do we need multi steps refinement for
rsqrt nor replace sqrt by rsqrt.

Diff Detail

Event Timeline

pengfei created this revision.Nov 30 2021, 10:03 PM
pengfei requested review of this revision.Nov 30 2021, 10:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2021, 10:03 PM
RKSimon added inline comments.Dec 1 2021, 2:52 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
23243

Do we have test coverage for this path? A quick grep didn't find anything other than the intrinsics test files.

pengfei added inline comments.Dec 1 2021, 5:08 AM
llvm/lib/Target/X86/X86ISelLowering.cpp
23243

We have many tests in both changed files to cover the path, e.g. test_sqrt_ph_512_fast
You can't find elsewhere simply because this path is for f16 only and we don't have the support prior to FP16 enabling.

RKSimon accepted this revision.Dec 1 2021, 6:07 AM

LGTM

llvm/lib/Target/X86/X86ISelLowering.cpp
23243

Got it - thanks.

This revision is now accepted and ready to land.Dec 1 2021, 6:07 AM