================
@@ -8761,6 +8761,42 @@ def CIR_ATan2Op : CIR_BinaryFPToFPBuiltinOp<"atan2", 
"ATan2Op"> {
   let constrainedLLVMIntrinsic = "atan2";
 }
 
+def CIR_LdexpOp : CIR_Op<"ldexp",
+    !listconcat([AllTypesMatch<["src", "result"]>], CIR_FenvOpTraits)> {
+  let summary = "Multiplies a floating-point value by an integral power of 
two";
+  let description = [{
+    `cir.ldexp` computes `src * 2^exp`.
+
+    Lowers to `llvm.ldexp`, or to `llvm.experimental.constrained.ldexp` when
+    the `fenv` attribute is present.
+
+    Example:
+      %r = cir.ldexp %x, %e : !cir.float, !s32i
+  }];
+
+  let arguments = (ins
+    CIR_AnyFloatType:$src,
----------------
andykaylor wrote:

The corresponding LLVM operation allows a vector of floats, though it doesn't 
appear to handle a vector of integers for the power, which is what we'd expect 
with something like this:

`  vf2 = __builtin_elementwise_ldexp(vf1, vi1);`

>From (clang/test/CodeGen/builtins-elementwise-math.c)

https://github.com/llvm/llvm-project/pull/236997
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to