[llvm] Add new llvm.cbrt intrinsic (PR #178396)

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 03:22:39 PST 2026


================
@@ -16512,7 +16325,47 @@ Semantics:
 """"""""""
 
 Return the same value as a corresponding libm '``sqrt``' function but without
-trapping or setting ``errno``. For types specified by IEEE 754, the result
+trapping or setting ``errno``. For types specified by IEEE-754, the result
+matches a conforming libm implementation.
+
+When specified with the fast-math-flag 'afn', the result may be approximated
+using a less accurate calculation.
+
+.. _int_cbrt:
+
+'``llvm.cbrt.*``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+This is an overloaded intrinsic. You can use ``llvm.cbrt`` on any
+floating-point or vector of floating-point type. Not all targets support
+all types however.
+
+::
+
+      declare float     @llvm.cbrt.f32(float %Val)
+      declare double    @llvm.cbrt.f64(double %Val)
+      declare x86_fp80  @llvm.cbrt.f80(x86_fp80 %Val)
+      declare fp128     @llvm.cbrt.f128(fp128 %Val)
+      declare ppc_fp128 @llvm.cbrt.ppcf128(ppc_fp128 %Val)
+
+Overview:
+"""""""""
+
+The '``llvm.cbrt``' intrinsics return the square root of the specified value.
----------------
hazzlim wrote:

```suggestion
The '``llvm.cbrt``' intrinsics return the cube root of the specified value.
```

https://github.com/llvm/llvm-project/pull/178396


More information about the llvm-commits mailing list