From 95fd2ca69f21f715d846d45178b1e57a76ee76ec Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 27 Oct 2011 19:19:51 +0000 Subject: Annotate imprecise FP division with fpaccuracy metadata The OpenCL single precision division operation is only required to be accurate to 2.5ulp. Annotate the fdiv instruction with metadata which signals to the backend that an imprecise divide instruction may be used. llvm-svn: 143136 --- clang/lib/CodeGen/CodeGenFunction.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 858962d337b..4940e21c8be 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2382,6 +2382,11 @@ public: /// a r-value suitable for passing the given parameter. void EmitDelegateCallArg(CallArgList &args, const VarDecl *param); + /// SetFPAccuracy - Set the minimum required accuracy of the given floating + /// point operation, expressed as the maximum relative error in ulp. + void SetFPAccuracy(llvm::Value *Val, unsigned AccuracyN, + unsigned AccuracyD = 1); + private: void EmitReturnOfRValue(RValue RV, QualType Ty); -- cgit v1.2.3