Skip to content

Commit b86bc0d

Browse files
[fixup] Add tests to Dialect/ArmNeon/invalid.mlir
1 parent 154b104 commit b86bc0d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

mlir/test/Dialect/ArmNeon/invalid.mlir

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,43 @@ func.func @usmmla_invalid_dimensions(%a: vector<8xi32>,
9191
%0 = arm_neon.intr.usmmla %a, %b, %c : vector<32xi8> to vector<8xi32>
9292
return %0 : vector<8xi32>
9393
}
94+
95+
// -----
96+
97+
func.func @bfmmla_invalid_element_type_lhs_rhs(%acc: vector<4xf32>,
98+
%lhs: vector<8xf16>,
99+
%rhs: vector<8xf16>) -> vector<4xf32> {
100+
// expected-error@+1 {{operand #1 must be a vector with length 8 of bfloat16 type values, but got 'vector<8xf16>'}}
101+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xf16> to vector<4xf32>
102+
return %0 : vector<4xf32>
103+
}
104+
105+
// -----
106+
107+
func.func @bfmmla_invalid_dimension_lhs_rhs(%acc: vector<4xf32>,
108+
%lhs: vector<4xbf16>,
109+
%rhs: vector<4xbf16>) -> vector<4xf32> {
110+
// expected-error@+1 {{operand #1 must be a vector with length 8 of bfloat16 type values, but got 'vector<4xbf16>'}}
111+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<4xbf16> to vector<4xf32>
112+
return %0 : vector<4xf32>
113+
}
114+
115+
// -----
116+
117+
func.func @bfmmla_invalid_element_type_acc(%acc: vector<4xi32>,
118+
%lhs: vector<8xbf16>,
119+
%rhs: vector<8xbf16>) -> vector<4xi32> {
120+
// expected-error@+1 {{op operand #0 must be a vector with length 4 of 32-bit float values, but got 'vector<4xi32>'}}
121+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<4xi32>
122+
return %0 : vector<4xi32>
123+
}
124+
125+
// -----
126+
127+
func.func @bfmmla_invalid_dimension_acc(%acc: vector<8xf32>,
128+
%lhs: vector<8xbf16>,
129+
%rhs: vector<8xbf16>) -> vector<8xf32> {
130+
// expected-error@+1 {{op operand #0 must be a vector with length 4 of 32-bit float values, but got 'vector<8xf32>'}}
131+
%0 = arm_neon.intr.bfmmla %acc, %lhs, %rhs : vector<8xbf16> to vector<8xf32>
132+
return %0 : vector<8xf32>
133+
}

0 commit comments

Comments
 (0)