4
4
// RUN: --shared-libs=%mlir_c_runner_utils | \
5
5
// RUN: FileCheck %s --match-full-lines
6
6
7
+ func.func @cmpi_eq_i1 (%v1 : i1 , %v2 : i1 ) {
8
+ vector.print str " @cmpi_eq_i1\n "
9
+ %res = arith.cmpi eq , %v1 , %v2 : i1
10
+ vector.print %res : i1
11
+ return
12
+ }
13
+
7
14
func.func @cmpi_slt_i1 (%v1 : i1 , %v2 : i1 ) {
8
15
vector.print str " @cmpi_slt_i1\n "
9
16
%res = arith.cmpi slt , %v1 , %v2 : i1
@@ -40,9 +47,12 @@ func.func @cmpi_signed() {
40
47
%true_i1 = arith.constant 1 : i1
41
48
%true_i1_n1 = arith.constant -1 : i1
42
49
43
- // sge 0 -1, sge 0 1, should be true
44
- // since the bitvector `1` is interpreted as the int value -1 in signed comparisons
45
- // sge 0 -1 == sge 0 1 == true (1)
50
+ // int values 1 and -1 represent the same bitvector
51
+ // CHECK-LABEL: @cmpi_eq_i1
52
+ // CHECK-NEXT: 1
53
+ func.call @cmpi_eq_i1 (%true_i1 , %true_i1_n1 ) : (i1 , i1 ) -> ()
54
+
55
+ // But, bitvector `1` is interpreted as int value -1 in signed comparison
46
56
47
57
// CHECK-LABEL: @cmpi_sge_i1
48
58
// CHECK-NEXT: 1
@@ -55,8 +65,6 @@ func.func @cmpi_signed() {
55
65
%false = arith.constant false
56
66
%true = arith.constant true
57
67
58
- // slt 0 1 = false, sle 0 1 = false, sgt 0 1 = true, sge 0 1 = true, sge 1 0 = false
59
-
60
68
// CHECK-LABEL: @cmpi_slt_i1
61
69
// CHECK-NEXT: 0
62
70
func.call @cmpi_slt_i1 (%false , %true ) : (i1 , i1 ) -> ()
0 commit comments