1 ; RUN: llc < %s | FileCheck %s
3 ; Test that basic 32-bit integer comparison operations assemble as expected.
5 target datalayout = "E-m:e-p:32:32-i64:64-a:0:32-n32-S64"
6 target triple = "lanai"
9 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
11 define i32 @eq_i32(i32 %x, i32 %y) {
12 %a = icmp eq i32 %x, %y
13 %b = zext i1 %a to i32
17 ; CHECK-LABEL: ne_i32:
18 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
20 define i32 @ne_i32(i32 %x, i32 %y) {
21 %a = icmp ne i32 %x, %y
22 %b = zext i1 %a to i32
26 ; CHECK-LABEL: slt_i32:
27 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
29 define i32 @slt_i32(i32 %x, i32 %y) {
30 %a = icmp slt i32 %x, %y
31 %b = zext i1 %a to i32
35 ; CHECK-LABEL: sle_i32:
36 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
38 define i32 @sle_i32(i32 %x, i32 %y) {
39 %a = icmp sle i32 %x, %y
40 %b = zext i1 %a to i32
44 ; CHECK-LABEL: ult_i32:
45 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
47 define i32 @ult_i32(i32 %x, i32 %y) {
48 %a = icmp ult i32 %x, %y
49 %b = zext i1 %a to i32
53 ; CHECK-LABEL: ule_i32:
54 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
56 define i32 @ule_i32(i32 %x, i32 %y) {
57 %a = icmp ule i32 %x, %y
58 %b = zext i1 %a to i32
62 ; CHECK-LABEL: sgt_i32:
63 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
65 define i32 @sgt_i32(i32 %x, i32 %y) {
66 %a = icmp sgt i32 %x, %y
67 %b = zext i1 %a to i32
71 ; CHECK-LABEL: sge_i32:
72 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
74 define i32 @sge_i32(i32 %x, i32 %y) {
75 %a = icmp sge i32 %x, %y
76 %b = zext i1 %a to i32
80 ; CHECK-LABEL: ugt_i32:
81 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
83 define i32 @ugt_i32(i32 %x, i32 %y) {
84 %a = icmp ugt i32 %x, %y
85 %b = zext i1 %a to i32
89 ; CHECK-LABEL: uge_i32:
90 ; CHECK: sub.f %r{{[0-9]+}}, %r{{[0-9]+}}, %r0
92 define i32 @uge_i32(i32 %x, i32 %y) {
93 %a = icmp uge i32 %x, %y
94 %b = zext i1 %a to i32