69 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc < %s -mtriple=arm64-apple-ios7.0.0 | FileCheck %s --check-prefixes=CHECK,CHECK-SD3; RUN: llc < %s -mtriple=arm64-apple-ios7.0.0 -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI4 5target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"6 7declare i32 @llvm.ctlz.i32(i32, i1) #08declare i64 @llvm.ctlz.i64(i64, i1) #19 10define i32 @clrsb32(i32 %x) #2 {11; CHECK-LABEL: clrsb32:12; CHECK: ; %bb.0: ; %entry13; CHECK-NEXT: cls w0, w014; CHECK-NEXT: ret15entry:16 %shr = ashr i32 %x, 3117 %xor = xor i32 %shr, %x18 %mul = shl i32 %xor, 119 %add = or i32 %mul, 120 %0 = tail call i32 @llvm.ctlz.i32(i32 %add, i1 false)21 ret i32 %022}23 24define i64 @clrsb64(i64 %x) #3 {25; CHECK-LABEL: clrsb64:26; CHECK: ; %bb.0: ; %entry27; CHECK-NEXT: cls x0, x028; CHECK-NEXT: ret29entry:30 %shr = ashr i64 %x, 6331 %xor = xor i64 %shr, %x32 %mul = shl nsw i64 %xor, 133 %add = or i64 %mul, 134 %0 = tail call i64 @llvm.ctlz.i64(i64 %add, i1 false)35 ret i64 %036}37 38define i32 @clrsb32_zeroundef(i32 %x) #2 {39; CHECK-LABEL: clrsb32_zeroundef:40; CHECK: ; %bb.0: ; %entry41; CHECK-NEXT: cls w0, w042; CHECK-NEXT: ret43entry:44 %shr = ashr i32 %x, 3145 %xor = xor i32 %shr, %x46 %mul = shl i32 %xor, 147 %add = or i32 %mul, 148 %0 = tail call i32 @llvm.ctlz.i32(i32 %add, i1 true)49 ret i32 %050}51 52define i64 @clrsb64_zeroundef(i64 %x) #3 {53; CHECK-LABEL: clrsb64_zeroundef:54; CHECK: ; %bb.0: ; %entry55; CHECK-NEXT: cls x0, x056; CHECK-NEXT: ret57entry:58 %shr = ashr i64 %x, 6359 %xor = xor i64 %shr, %x60 %mul = shl nsw i64 %xor, 161 %add = or i64 %mul, 162 %0 = tail call i64 @llvm.ctlz.i64(i64 %add, i1 true)63 ret i64 %064}65 66;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:67; CHECK-GI: {{.*}}68; CHECK-SD: {{.*}}69