diff options
| author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 20:47:44 +0000 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-05-28 20:47:44 +0000 |
| commit | 6d7bf5e8df5455fa32cc437f7043bbb0a0607d49 (patch) | |
| tree | 2003d25498af8a576b461c14b43f1e72cf57c81e /llvm/docs | |
| parent | dfc34f0211b78a288cddfdc59798132c8087592d (diff) | |
| download | bcm5719-llvm-6d7bf5e8df5455fa32cc437f7043bbb0a0607d49.tar.gz bcm5719-llvm-6d7bf5e8df5455fa32cc437f7043bbb0a0607d49.zip | |
[CodeGen] Add lrint/llrint builtins
This patch add the ISD::LRINT and ISD::LLRINT along with new
intrinsics. The changes are straightforward as for other
floating-point rounding functions, with just some adjustments
required to handle the return value being an interger.
The idea is to optimize lrint/llrint generation for AArch64
in a subsequent patch. Current semantic is just route it to libm
symbol.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D62017
llvm-svn: 361875
Diffstat (limited to 'llvm/docs')
| -rw-r--r-- | llvm/docs/LangRef.rst | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 6311f6f6163..43f27da1afc 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -12449,6 +12449,80 @@ Semantics: This function returns the same values as the libm ``llround`` functions would, but without setting errno. +'``llvm.lrint.*``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +This is an overloaded intrinsic. You can use ``llvm.lrint`` on any +floating-point type. Not all targets support all types however. + +:: + + declare i32 @llvm.lrint.i32.f32(float %Val) + declare i32 @llvm.lrint.i32.f64(double %Val) + declare i32 @llvm.lrint.i32.f80(float %Val) + declare i32 @llvm.lrint.i32.f128(double %Val) + declare i32 @llvm.lrint.i32.ppcf128(double %Val) + + declare i64 @llvm.lrint.i64.f32(float %Val) + declare i64 @llvm.lrint.i64.f64(double %Val) + declare i64 @llvm.lrint.i64.f80(float %Val) + declare i64 @llvm.lrint.i64.f128(double %Val) + declare i64 @llvm.lrint.i64.ppcf128(double %Val) + +Overview: +""""""""" + +The '``llvm.lrint.*``' intrinsics returns the operand rounded to the +nearest integer. + +Arguments: +"""""""""" + +The argument is a floating-point number and return is an integer type. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``lrint`` +functions would, but without setting errno. + +'``llvm.llrint.*``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +This is an overloaded intrinsic. You can use ``llvm.llrint`` on any +floating-point type. Not all targets support all types however. + +:: + + declare i64 @llvm.llrint.i64.f32(float %Val) + declare i64 @llvm.llrint.i64.f64(double %Val) + declare i64 @llvm.llrint.i64.f80(float %Val) + declare i64 @llvm.llrint.i64.f128(double %Val) + declare i64 @llvm.llrint.i64.ppcf128(double %Val) + +Overview: +""""""""" + +The '``llvm.llrint.*``' intrinsics returns the operand rounded to the +nearest integer. + +Arguments: +"""""""""" + +The argument is a floating-point number and return is an integer type. + +Semantics: +"""""""""" + +This function returns the same values as the libm ``llrint`` +functions would, but without setting errno. + Bit Manipulation Intrinsics --------------------------- |

