; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s

define i8 @ucmp.8.8(i8 zeroext %x, i8 zeroext %y) nounwind {
; CHECK-LABEL: ucmp.8.8:
; CHECK:       # %bb.0:
; CHECK-NEXT:    cr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i8 @llvm.ucmp(i8 %x, i8 %y)
  ret i8 %1
}

define i8 @ucmp.8.16(i16 zeroext %x, i16 zeroext %y) nounwind {
; CHECK-LABEL: ucmp.8.16:
; CHECK:       # %bb.0:
; CHECK-NEXT:    cr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i8 @llvm.ucmp(i16 %x, i16 %y)
  ret i8 %1
}

define i8 @ucmp.8.32(i32 %x, i32 %y) nounwind {
; CHECK-LABEL: ucmp.8.32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    clr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i8 @llvm.ucmp(i32 %x, i32 %y)
  ret i8 %1
}

define i8 @ucmp.8.64(i64 %x, i64 %y) nounwind {
; CHECK-LABEL: ucmp.8.64:
; CHECK:       # %bb.0:
; CHECK-NEXT:    clgr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i8 @llvm.ucmp(i64 %x, i64 %y)
  ret i8 %1
}

define i8 @ucmp.8.128(i128 %x, i128 %y) nounwind {
; CHECK-LABEL: ucmp.8.128:
; CHECK:       # %bb.0:
; CHECK-NEXT:    vl %v0, 0(%r3), 3
; CHECK-NEXT:    vl %v1, 0(%r2), 3
; CHECK-NEXT:    veclg %v0, %v1
; CHECK-NEXT:    jlh .LBB4_2
; CHECK-NEXT:  # %bb.1:
; CHECK-NEXT:    vchlgs %v2, %v1, %v0
; CHECK-NEXT:  .LBB4_2:
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochil %r2, 1
; CHECK-NEXT:    veclg %v1, %v0
; CHECK-NEXT:    jlh .LBB4_4
; CHECK-NEXT:  # %bb.3:
; CHECK-NEXT:    vchlgs %v0, %v0, %v1
; CHECK-NEXT:  .LBB4_4:
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i8 @llvm.ucmp(i128 %x, i128 %y)
  ret i8 %1
}

define i32 @ucmp.32.32(i32 %x, i32 %y) nounwind {
; CHECK-LABEL: ucmp.32.32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    clr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i32 @llvm.ucmp(i32 %x, i32 %y)
  ret i32 %1
}

define i32 @ucmp.32.64(i64 %x, i64 %y) nounwind {
; CHECK-LABEL: ucmp.32.64:
; CHECK:       # %bb.0:
; CHECK-NEXT:    clgr %r2, %r3
; CHECK-NEXT:    lhi %r2, 0
; CHECK-NEXT:    lochih %r2, 1
; CHECK-NEXT:    lochil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i32 @llvm.ucmp(i64 %x, i64 %y)
  ret i32 %1
}

define i64 @ucmp.64.64(i64 %x, i64 %y) nounwind {
; CHECK-LABEL: ucmp.64.64:
; CHECK:       # %bb.0:
; CHECK-NEXT:    clgr %r2, %r3
; CHECK-NEXT:    lghi %r2, 0
; CHECK-NEXT:    locghih %r2, 1
; CHECK-NEXT:    locghil %r2, -1
; CHECK-NEXT:    br %r14
  %1 = call i64 @llvm.ucmp(i64 %x, i64 %y)
  ret i64 %1
}
