diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -1942,10 +1942,39 @@ let summary = "base-e logarithm of the specified value"; } +//===----------------------------------------------------------------------===// +// Log10Op +//===----------------------------------------------------------------------===// + def Log10Op : FloatUnaryOp<"log10"> { let summary = "base-10 logarithm of the specified value"; } +//===----------------------------------------------------------------------===// +// Log1pOp +//===----------------------------------------------------------------------===// + +def Log1pOp : FloatUnaryOp<"log1p"> { + let summary = "Computes the natural logarithm of one plus the given value"; + + let description = [{ + Computes the base-e logarithm of one plus the given value. It takes one + operand and returns one result of the same type. + + log1p(x) := log(1 + x) + + Example: + + ```mlir + %y = log1p %x : f64 + ``` + }]; +} + +//===----------------------------------------------------------------------===// +// Log2Op +//===----------------------------------------------------------------------===// + def Log2Op : FloatUnaryOp<"log2"> { let summary = "base-2 logarithm of the specified value"; } diff --git a/mlir/test/IR/core-ops.mlir b/mlir/test/IR/core-ops.mlir --- a/mlir/test/IR/core-ops.mlir +++ b/mlir/test/IR/core-ops.mlir @@ -596,6 +596,9 @@ // CHECK: %{{[0-9]+}} = ceildivi_signed %cst_4, %cst_4 : tensor<42xi32> %174 = ceildivi_signed %tci32, %tci32 : tensor<42 x i32> + // CHECK: %{{[0-9]+}} = log1p %arg1 : f32 + %175 = log1p %f : f32 + return }