================ @@ -309,6 +309,60 @@ space casted to this space), 1 is returned, otherwise 0 is returned. Arithmetic Intrinsics --------------------- +'``llvm.nvvm.fabs.*``' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Syntax: +""""""" + +.. code-block:: llvm + + declare float @llvm.nvvm.fabs.f32(float %a) + declare double @llvm.nvvm.fabs.f64(double %a) + declare half @llvm.nvvm.fabs.f16(half %a) + declare <2 x half> @llvm.nvvm.fabs.v2f16(<2 x half> %a) + declare bfloat @llvm.nvvm.fabs.bf16(bfloat %a) + declare <2 x bfloat> @llvm.nvvm.fabs.v2bf16(<2 x bfloat> %a) + +Overview: +""""""""" + +The '``llvm.nvvm.fabs.*``' intrinsics return the absolute value of the operand. + +Semantics: +"""""""""" + +Unlike, '``llvm.fabs.*``', these intrinsics do not perfectly preserve NaN +values. Instead, a NaN input yeilds an unspecified NaN output. The exception to +this rule is the double precision variant, for which NaN is preserved. ---------------- efriedma-quic wrote:
The "exception" here seems like it's letting too much of the implementation leak through... it's hard to understand the semantics, and it'll make it very hard to transition if we decide to turn this into a target-independent intrinsic. Maybe just say it's always unspecified, and juts use the regular llvm.fabs.f64 where the nan handling matters? https://github.com/llvm/llvm-project/pull/135644 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits