summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCSubtarget.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-04-03 04:01:11 +0000
committerHal Finkel <hfinkel@anl.gov>2013-04-03 04:01:11 +0000
commit827307b95fa909e35a3ddef612f9f50ffcf0963a (patch)
tree2b00d0257edd0b6d8e32914117a47ba7f072480c /lib/Target/PowerPC/PPCSubtarget.h
parent04011e8429033ae0623ea629527d2d13de3f8109 (diff)
downloadllvm-827307b95fa909e35a3ddef612f9f50ffcf0963a.tar.gz
llvm-827307b95fa909e35a3ddef612f9f50ffcf0963a.tar.bz2
llvm-827307b95fa909e35a3ddef612f9f50ffcf0963a.tar.xz
Use PPC reciprocal estimates with Newton iteration in fast-math mode
When unsafe FP math operations are enabled, we can use the fre[s] and frsqrte[s] instructions, which generate reciprocal (sqrt) estimates, together with some Newton iteration, in order to quickly generate floating-point division and sqrt results. All of these instructions are separately optional, and so each has its own feature flag (except for the Altivec instructions, which are covered under the existing Altivec flag). Doing this is not only faster than using the IEEE-compliant fdiv/fsqrt instructions, but allows these computations to be pipelined with other computations in order to hide their overall latency. I've also added a couple of missing fnmsub patterns which turned out to be missing (but are necessary for good code generation of the Newton iterations). Altivec needs a similar fix, but that will probably be more complicated because fneg is expanded for Altivec's v4f32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCSubtarget.h')
-rw-r--r--lib/Target/PowerPC/PPCSubtarget.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h
index d5dfa1e8e1..65b4d211fc 100644
--- a/lib/Target/PowerPC/PPCSubtarget.h
+++ b/lib/Target/PowerPC/PPCSubtarget.h
@@ -77,6 +77,8 @@ protected:
bool HasAltivec;
bool HasQPX;
bool HasFSQRT;
+ bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES;
+ bool HasRecipPrec;
bool HasSTFIWX;
bool HasLFIWAX;
bool HasFPRND;
@@ -159,6 +161,11 @@ public:
// Specific obvious features.
bool hasFSQRT() const { return HasFSQRT; }
+ bool hasFRE() const { return HasFRE; }
+ bool hasFRES() const { return HasFRES; }
+ bool hasFRSQRTE() const { return HasFRSQRTE; }
+ bool hasFRSQRTES() const { return HasFRSQRTES; }
+ bool hasRecipPrec() const { return HasRecipPrec; }
bool hasSTFIWX() const { return HasSTFIWX; }
bool hasLFIWAX() const { return HasLFIWAX; }
bool hasFPRND() const { return HasFPRND; }