1// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s 2 3//===----------------------------------------------------------------------===// 4// spv.IEqual 5//===----------------------------------------------------------------------===// 6 7func @iequal_scalar(%arg0: i32, %arg1: i32) -> i1 { 8 // CHECK: spv.IEqual {{.*}}, {{.*}} : i32 9 %0 = spv.IEqual %arg0, %arg1 : i32 10 return %0 : i1 11} 12 13// ----- 14 15func @iequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 16 // CHECK: spv.IEqual {{.*}}, {{.*}} : vector<4xi32> 17 %0 = spv.IEqual %arg0, %arg1 : vector<4xi32> 18 return %0 : vector<4xi1> 19} 20 21// ----- 22 23//===----------------------------------------------------------------------===// 24// spv.INotEqual 25//===----------------------------------------------------------------------===// 26 27func @inotequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 28 // CHECK: spv.INotEqual {{.*}}, {{.*}} : vector<4xi32> 29 %0 = spv.INotEqual %arg0, %arg1 : vector<4xi32> 30 return %0 : vector<4xi1> 31} 32 33// ----- 34 35//===----------------------------------------------------------------------===// 36// spv.SGreaterThan 37//===----------------------------------------------------------------------===// 38 39func @sgt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 40 // CHECK: spv.SGreaterThan {{.*}}, {{.*}} : vector<4xi32> 41 %0 = spv.SGreaterThan %arg0, %arg1 : vector<4xi32> 42 return %0 : vector<4xi1> 43} 44 45// ----- 46 47//===----------------------------------------------------------------------===// 48// spv.SGreaterThanEqual 49//===----------------------------------------------------------------------===// 50 51func @sge_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 52 // CHECK: spv.SGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32> 53 %0 = spv.SGreaterThanEqual %arg0, %arg1 : vector<4xi32> 54 return %0 : vector<4xi1> 55} 56 57// ----- 58 59//===----------------------------------------------------------------------===// 60// spv.SLessThan 61//===----------------------------------------------------------------------===// 62 63func @slt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 64 // CHECK: spv.SLessThan {{.*}}, {{.*}} : vector<4xi32> 65 %0 = spv.SLessThan %arg0, %arg1 : vector<4xi32> 66 return %0 : vector<4xi1> 67} 68 69// ----- 70 71//===----------------------------------------------------------------------===// 72// spv.SLessThanEqual 73//===----------------------------------------------------------------------===// 74 75func @slte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 76 // CHECK: spv.SLessThanEqual {{.*}}, {{.*}} : vector<4xi32> 77 %0 = spv.SLessThanEqual %arg0, %arg1 : vector<4xi32> 78 return %0 : vector<4xi1> 79} 80 81// ----- 82 83//===----------------------------------------------------------------------===// 84// spv.UGreaterThan 85//===----------------------------------------------------------------------===// 86 87func @ugt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 88 // CHECK: spv.UGreaterThan {{.*}}, {{.*}} : vector<4xi32> 89 %0 = spv.UGreaterThan %arg0, %arg1 : vector<4xi32> 90 return %0 : vector<4xi1> 91} 92 93// ----- 94 95//===----------------------------------------------------------------------===// 96// spv.UGreaterThanEqual 97//===----------------------------------------------------------------------===// 98 99func @ugte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 100 // CHECK: spv.UGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32> 101 %0 = spv.UGreaterThanEqual %arg0, %arg1 : vector<4xi32> 102 return %0 : vector<4xi1> 103} 104 105// ----- 106 107//===----------------------------------------------------------------------===// 108// spv.ULessThan 109//===----------------------------------------------------------------------===// 110 111func @ult_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 112 // CHECK: spv.ULessThan {{.*}}, {{.*}} : vector<4xi32> 113 %0 = spv.ULessThan %arg0, %arg1 : vector<4xi32> 114 return %0 : vector<4xi1> 115} 116 117// ----- 118 119//===----------------------------------------------------------------------===// 120// spv.ULessThanEqual 121//===----------------------------------------------------------------------===// 122 123func @ulte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> { 124 // CHECK: spv.ULessThanEqual {{.*}}, {{.*}} : vector<4xi32> 125 %0 = spv.ULessThanEqual %arg0, %arg1 : vector<4xi32> 126 return %0 : vector<4xi1> 127} 128