This is an archive of the discontinued LLVM Phabricator instance.

R600: Implement getRsqrtEstimate
ClosedPublic

Authored by arsenm on Oct 6 2014, 6:23 PM.

Details

Reviewers
arsenm
Summary

Only do for f32 since I'm unclear on both what this is expecting
for the refinement steps in terms of accuracy, and what
f64 instruction actually provides.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 14482.Oct 6 2014, 6:23 PM
arsenm retitled this revision from to R600: Implement getRsqrtEstimate .
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a subscriber: Unknown Object (MLST).
hfinkel added a subscriber: hfinkel.Oct 6 2014, 6:33 PM
  • Original Message -----

From: "Matt Arsenault" <Matthew.Arsenault@amd.com>
To: "Matthew Arsenault" <Matthew.Arsenault@amd.com>
Cc: llvm-commits@cs.uiuc.edu
Sent: Monday, October 6, 2014 8:23:18 PM
Subject: [PATCH] R600: Implement getRsqrtEstimate

Only do for f32 since I'm unclear on both what this is expecting
for the refinement steps in terms of accuracy, and what
f64 instruction actually provides.

It seems that the comment describing the convergence rate never moved out of the original PowerPC implementation. Here it is:

// Convergence is quadratic, so we essentially double the number of digits
// correct after every iteration. For both FRE and FRSQRTE, the minimum
// architected relative accuracy is 2^-5. When hasRecipPrec(), this is
// 2^-14. IEEE float has 23 digits and double has 52 digits.
RefinementSteps = Subtarget.hasRecipPrec() ? 1 : 3;
if (VT.getScalarType() == MVT::f64)
  ++RefinementSteps;

I hope this helps ;)

-Hal

http://reviews.llvm.org/D5636

Files:

lib/Target/R600/AMDGPUISelLowering.cpp
lib/Target/R600/AMDGPUISelLowering.h
test/CodeGen/R600/fsqrt.ll
test/CodeGen/R600/rsq.ll

llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

arsenm accepted this revision.Jan 13 2015, 12:55 PM
arsenm added a reviewer: arsenm.

r225827-225828

This revision is now accepted and ready to land.Jan 13 2015, 12:55 PM
arsenm closed this revision.Jan 13 2015, 12:55 PM