1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s --mtriple=aarch64 | FileCheck %s
4 declare i8 @llvm.ctlz.i8(i8, i1 immarg)
5 declare <8 x i8> @llvm.ctlz.v8i8(<8 x i8>, i1 immarg)
6 declare i11 @llvm.ctlz.i11(i11, i1 immarg)
8 define i32 @clz_nzu8(i8 %self) {
9 ; CHECK-LABEL: clz_nzu8:
10 ; CHECK: // %bb.0: // %start
11 ; CHECK-NEXT: lsl w8, w0, #24
12 ; CHECK-NEXT: clz w0, w8
15 %ctlz_res = call i8 @llvm.ctlz.i8(i8 %self, i1 true)
16 %ret = zext i8 %ctlz_res to i32
20 ; non standard bit size argument to ctlz
21 define i32 @clz_nzu11(i11 %self) {
22 ; CHECK-LABEL: clz_nzu11:
24 ; CHECK-NEXT: lsl w8, w0, #21
25 ; CHECK-NEXT: clz w0, w8
27 %ctlz_res = call i11 @llvm.ctlz.i11(i11 %self, i1 true)
28 %ret = zext i11 %ctlz_res to i32
32 ; vector type argument to ctlz intrinsic
33 define <8 x i32> @clz_vec_nzu8(<8 x i8> %self) {
34 ; CHECK-LABEL: clz_vec_nzu8:
36 ; CHECK-NEXT: clz v0.8b, v0.8b
37 ; CHECK-NEXT: ushll v0.8h, v0.8b, #0
38 ; CHECK-NEXT: ushll2 v1.4s, v0.8h, #0
39 ; CHECK-NEXT: ushll v0.4s, v0.4h, #0
41 %ctlz_res = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> %self, i1 true)
42 %ret = zext <8 x i8> %ctlz_res to <8 x i32>