1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -csky-no-aliases -mattr=+e2 -mattr=+2e3 < %s -mtriple=csky | FileCheck %s
4 define i32 @ctlz_0(i32 %x) {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: ff1.32 a0, a0
10 %nlz = call i32 @llvm.ctlz.i32(i32 %x, i1 0)
14 define i32 @ctlz_1(i32 %x) {
15 ; CHECK-LABEL: ctlz_1:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: ff1.32 a0, a0
20 %nlz = call i32 @llvm.ctlz.i32(i32 %x, i1 1)
24 define i32 @cttz_0(i32 %x) {
25 ; CHECK-LABEL: cttz_0:
26 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: brev32 a0, a0
28 ; CHECK-NEXT: ff1.32 a0, a0
31 %ntz = call i32 @llvm.cttz.i32(i32 %x, i1 0)
35 define i32 @cttz_1(i32 %x) {
36 ; CHECK-LABEL: cttz_1:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: brev32 a0, a0
39 ; CHECK-NEXT: ff1.32 a0, a0
42 %ntz = call i32 @llvm.cttz.i32(i32 %x, i1 1)
46 define i32 @bswap(i32 %x) {
48 ; CHECK: # %bb.0: # %entry
49 ; CHECK-NEXT: revb16 a0, a0
52 %revb32 = call i32 @llvm.bswap.i32(i32 %x)
56 define i16 @bswap16(i16 %x) {
57 ; CHECK-LABEL: bswap16:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: revb16 a0, a0
60 ; CHECK-NEXT: lsri16 a0, a0, 16
63 %revb16 = call i16 @llvm.bswap.i16(i16 %x)
67 define i32 @bitreverse_32(i32 %x) {
68 ; CHECK-LABEL: bitreverse_32:
69 ; CHECK: # %bb.0: # %entry
70 ; CHECK-NEXT: brev32 a0, a0
73 %brev32 = call i32 @llvm.bitreverse.i32(i32 %x)
77 define i16 @bitreverse_16(i16 %x) {
78 ; CHECK-LABEL: bitreverse_16:
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: brev32 a0, a0
81 ; CHECK-NEXT: lsri16 a0, a0, 16
84 %brev = call i16 @llvm.bitreverse.i16(i16 %x)
88 declare i32 @llvm.bswap.i32(i32)
89 declare i16 @llvm.bswap.i16(i16)
90 declare i32 @llvm.ctlz.i32 (i32, i1)
91 declare i32 @llvm.cttz.i32 (i32, i1)
92 declare i32 @llvm.bitreverse.i32(i32)
93 declare i16 @llvm.bitreverse.i16(i16)