Skip to content

Commit

Permalink
[mlir][StandardToSPIRV] Add support for lowering math.powf to SPIR-V.
Browse files Browse the repository at this point in the history
Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D100403
  • Loading branch information
hanhanW committed Apr 14, 2021
1 parent 91b6ef6 commit d9b03ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ void populateStandardToSPIRVPatterns(SPIRVTypeConverter &typeConverter,
UnaryAndBinaryOpPattern<math::ExpOp, spirv::GLSLExpOp>,
UnaryAndBinaryOpPattern<math::LogOp, spirv::GLSLLogOp>,
UnaryAndBinaryOpPattern<math::RsqrtOp, spirv::GLSLInverseSqrtOp>,
UnaryAndBinaryOpPattern<math::PowFOp, spirv::GLSLPowOp>,
UnaryAndBinaryOpPattern<math::SinOp, spirv::GLSLSinOp>,
UnaryAndBinaryOpPattern<math::SqrtOp, spirv::GLSLSqrtOp>,
UnaryAndBinaryOpPattern<math::TanhOp, spirv::GLSLTanhOp>,
Expand Down
2 changes: 2 additions & 0 deletions mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func @float32_binary_scalar(%lhs: f32, %rhs: f32) {
%3 = divf %lhs, %rhs: f32
// CHECK: spv.FRem %{{.*}}, %{{.*}}: f32
%4 = remf %lhs, %rhs: f32
// CHECK: spv.GLSL.Pow %{{.*}}: f32
%5 = math.powf %lhs, %rhs : f32
return
}

Expand Down

0 comments on commit d9b03ef

Please sign in to comment.