[Mlir-commits] [mlir] [MLIR][LLVMIR] Extend llrint, lrint, lround for vectors of float (PR #136225)

Tobias Gysi llvmlistbot at llvm.org
Thu Apr 17 23:50:12 PDT 2025


================
@@ -153,16 +153,18 @@ def LLVM_PowOp : LLVM_BinarySameArgsIntrOpF<"pow">;
 def LLVM_PowIOp : LLVM_PowFI<"powi">;
 def LLVM_RintOp : LLVM_UnaryIntrOpF<"rint">;
 def LLVM_NearbyintOp : LLVM_UnaryIntrOpF<"nearbyint">;
-class LLVM_IntRoundIntrOpBase<string func> :
+class LLVM_IntRoundIntrOpBase<string func, Type element = LLVM_AnyFloat> :
         LLVM_OneResultIntrOp<func, [0], [0], [Pure]> {
-  let arguments = (ins LLVM_AnyFloat:$val);
+  let arguments = (ins element:$val);
   let assemblyFormat = "`(` operands `)` attr-dict `:` "
       "functional-type(operands, results)";
 }
-def LLVM_LroundOp : LLVM_IntRoundIntrOpBase<"lround">;
+class LLVM_IntRoundIntrVecOrFloatOpBase<string func> :
----------------
gysit wrote:

```suggestion
class LLVM_ScalarOrVectorIntRoundIntrOpBase<string func> :
```
ultra nit: I would emphasize scalar or vector here.

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


More information about the Mlir-commits mailing list