forked from OSchip/llvm-project
35 lines
880 B
MLIR
35 lines
880 B
MLIR
// RUN: mlir-opt -split-input-file -verify %s | FileCheck %s
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// spv.FMul
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
func @fmul_scalar(%arg: f32) -> f32 {
|
|
// CHECK: spv.FMul
|
|
%0 = spv.FMul %arg, %arg : f32
|
|
return %0 : f32
|
|
}
|
|
|
|
func @fmul_vector(%arg: vector<4xf32>) -> vector<4xf32> {
|
|
// CHECK: spv.FMul
|
|
%0 = spv.FMul %arg, %arg : vector<4xf32>
|
|
return %0 : vector<4xf32>
|
|
}
|
|
|
|
// -----
|
|
|
|
func @fmul_i32(%arg: i32) -> i32 {
|
|
// expected-error @+1 {{must be scalar/vector of floating-point}}
|
|
%0 = spv.FMul %arg, %arg : i32
|
|
return %0 : i32
|
|
}
|
|
|
|
// -----
|
|
|
|
func @fmul_tensor(%arg: tensor<4xf32>) -> tensor<4xf32> {
|
|
// expected-error @+1 {{must be scalar/vector of floating-point}}
|
|
%0 = spv.FMul %arg, %arg : tensor<4xf32>
|
|
return %0 : tensor<4xf32>
|
|
}
|
|
|