1 // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
3 //===----------------------------------------------------------------------===//
5 //===----------------------------------------------------------------------===//
7 func @bitwise_or_scalar(%arg: i32) -> i32 {
8 // CHECK: spv.BitwiseOr
9 %0 = spv.BitwiseOr %arg, %arg : i32
13 func @bitwise_or_vector(%arg: vector<4xi32>) -> vector<4xi32> {
14 // CHECK: spv.BitwiseOr
15 %0 = spv.BitwiseOr %arg, %arg : vector<4xi32>
16 return %0 : vector<4xi32>
21 func @bitwise_or_float(%arg0: f16, %arg1: f16) -> f16 {
22 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4}}
23 %0 = spv.BitwiseOr %arg0, %arg1 : f16
29 //===----------------------------------------------------------------------===//
31 //===----------------------------------------------------------------------===//
33 func @bitwise_xor_scalar(%arg: i32) -> i32 {
34 // CHECK: spv.BitwiseXor
35 %0 = spv.BitwiseXor %arg, %arg : i32
39 func @bitwise_xor_vector(%arg: vector<4xi32>) -> vector<4xi32> {
40 // CHECK: spv.BitwiseXor
41 %0 = spv.BitwiseXor %arg, %arg : vector<4xi32>
42 return %0 : vector<4xi32>
47 func @bitwise_xor_float(%arg0: f16, %arg1: f16) -> f16 {
48 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4}}
49 %0 = spv.BitwiseXor %arg0, %arg1 : f16
55 //===----------------------------------------------------------------------===//
57 //===----------------------------------------------------------------------===//
59 func @bitwise_and_scalar(%arg: i32) -> i32 {
60 // CHECK: spv.BitwiseAnd
61 %0 = spv.BitwiseAnd %arg, %arg : i32
65 func @bitwise_and_vector(%arg: vector<4xi32>) -> vector<4xi32> {
66 // CHECK: spv.BitwiseAnd
67 %0 = spv.BitwiseAnd %arg, %arg : vector<4xi32>
68 return %0 : vector<4xi32>
73 func @bitwise_and_float(%arg0: f16, %arg1: f16) -> f16 {
74 // expected-error @+1 {{operand #0 must be 8/16/32/64-bit integer or vector of 8/16/32/64-bit integer values of length 2/3/4}}
75 %0 = spv.BitwiseAnd %arg0, %arg1 : f16