diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-08-07 22:49:12 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-08-07 22:49:12 +0000 |
commit | 41418d17cced656f91038b2482bc9d173b4974b0 (patch) | |
tree | ad9f68077baafc782e15513f310a8377e55c817a /docs/LangRef.rst | |
parent | 6fa33f5dd945015d79be42c5cff146e4e2b7c4f3 (diff) | |
download | llvm-41418d17cced656f91038b2482bc9d173b4974b0.tar.gz llvm-41418d17cced656f91038b2482bc9d173b4974b0.tar.bz2 llvm-41418d17cced656f91038b2482bc9d173b4974b0.tar.xz |
Add ISD::FROUND for libm round()
All libm floating-point rounding functions, except for round(), had their own
ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm
adding ISD::FROUND so that round() can be custom lowered as well.
For the most part, this is straightforward. I've added an intrinsic
and a matching ISD node just like those for nearbyint() and friends. The
SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed
fround).
This will be used by the PowerPC backend in a follow-up commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.rst')
-rw-r--r-- | docs/LangRef.rst | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index b69e2a35d1..5b8ecd85c6 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -7526,6 +7526,42 @@ Semantics: This function returns the same values as the libm ``nearbyint`` functions would, and handles error conditions in the same way. +'``llvm.round.*``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +This is an overloaded intrinsic. You can use ``llvm.round`` on any +floating point or vector of floating point type. Not all targets support +all types however. + +:: + + declare float @llvm.round.f32(float %Val) + declare double @llvm.round.f64(double %Val) + declare x86_fp80 @llvm.round.f80(x86_fp80 %Val) + declare fp128 @llvm.round.f128(fp128 %Val) + declare ppc_fp128 @llvm.round.ppcf128(ppc_fp128 %Val) + +Overview: +""""""""" + +The '``llvm.round.*``' intrinsics returns the operand rounded to the +nearest integer. + +Arguments: +"""""""""" + +The argument and return value are floating point numbers of the same +type. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``round`` +functions would, and handles error conditions in the same way. + Bit Manipulation Intrinsics --------------------------- |