Home | History | Annotate | Download | only in SystemZ
      1 ; Test all condition-code masks that are relevant for signed integer
      2 ; comparisons, in cases where a separate branch is better than COMPARE
      3 ; AND BRANCH.
      4 ;
      5 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
      6 
      7 define void @f1(i32 *%src, i32 %target) {
      8 ; CHECK-LABEL: f1:
      9 ; CHECK: .cfi_startproc
     10 ; CHECK: .L[[LABEL:.*]]:
     11 ; CHECK: c %r3, 0(%r2)
     12 ; CHECK-NEXT: je .L[[LABEL]]
     13   br label %loop
     14 loop:
     15   %val = load volatile i32 *%src
     16   %cond = icmp eq i32 %target, %val
     17   br i1 %cond, label %loop, label %exit
     18 exit:
     19   ret void
     20 }
     21 
     22 define void @f2(i32 *%src, i32 %target) {
     23 ; CHECK-LABEL: f2:
     24 ; CHECK: .cfi_startproc
     25 ; CHECK: .L[[LABEL:.*]]:
     26 ; CHECK: c %r3, 0(%r2)
     27 ; CHECK-NEXT: jlh .L[[LABEL]]
     28   br label %loop
     29 loop:
     30   %val = load volatile i32 *%src
     31   %cond = icmp ne i32 %target, %val
     32   br i1 %cond, label %loop, label %exit
     33 exit:
     34   ret void
     35 }
     36 
     37 define void @f3(i32 *%src, i32 %target) {
     38 ; CHECK-LABEL: f3:
     39 ; CHECK: .cfi_startproc
     40 ; CHECK: .L[[LABEL:.*]]:
     41 ; CHECK: c %r3, 0(%r2)
     42 ; CHECK-NEXT: jle .L[[LABEL]]
     43   br label %loop
     44 loop:
     45   %val = load volatile i32 *%src
     46   %cond = icmp sle i32 %target, %val
     47   br i1 %cond, label %loop, label %exit
     48 exit:
     49   ret void
     50 }
     51 
     52 define void @f4(i32 *%src, i32 %target) {
     53 ; CHECK-LABEL: f4:
     54 ; CHECK: .cfi_startproc
     55 ; CHECK: .L[[LABEL:.*]]:
     56 ; CHECK: c %r3, 0(%r2)
     57 ; CHECK-NEXT: jl .L[[LABEL]]
     58   br label %loop
     59 loop:
     60   %val = load volatile i32 *%src
     61   %cond = icmp slt i32 %target, %val
     62   br i1 %cond, label %loop, label %exit
     63 exit:
     64   ret void
     65 }
     66 
     67 define void @f5(i32 *%src, i32 %target) {
     68 ; CHECK-LABEL: f5:
     69 ; CHECK: .cfi_startproc
     70 ; CHECK: .L[[LABEL:.*]]:
     71 ; CHECK: c %r3, 0(%r2)
     72 ; CHECK-NEXT: jh .L[[LABEL]]
     73   br label %loop
     74 loop:
     75   %val = load volatile i32 *%src
     76   %cond = icmp sgt i32 %target, %val
     77   br i1 %cond, label %loop, label %exit
     78 exit:
     79   ret void
     80 }
     81 
     82 define void @f6(i32 *%src, i32 %target) {
     83 ; CHECK-LABEL: f6:
     84 ; CHECK: .cfi_startproc
     85 ; CHECK: .L[[LABEL:.*]]:
     86 ; CHECK: c %r3, 0(%r2)
     87 ; CHECK-NEXT: jhe .L[[LABEL]]
     88   br label %loop
     89 loop:
     90   %val = load volatile i32 *%src
     91   %cond = icmp sge i32 %target, %val
     92   br i1 %cond, label %loop, label %exit
     93 exit:
     94   ret void
     95 }
     96