[mlir][StandardToSPIRV] Add support for lowering math.powf to SPIR-V.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D100403
This commit is contained in:
Hanhan Wang 2021-04-13 22:36:41 -07:00
parent 91b6ef64db
commit d9b03ef2e8
2 changed files with 3 additions and 0 deletions

View File

@ -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>,

View File

@ -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
}