1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; Test get the address of constant pool without grs instruction
3 ; RUN: llc -verify-machineinstrs -csky-no-aliases < %s -mtriple=csky | FileCheck %s --check-prefix=GENERIC
5 declare i32 @llvm.cttz.i32(i32, i1)
7 define void @cttztest(i32 %C, i32* %CP) {
8 ; GENERIC-LABEL: cttztest:
10 ; GENERIC-NEXT: .cfi_def_cfa_offset 0
11 ; GENERIC-NEXT: subi16 sp, sp, 4
12 ; GENERIC-NEXT: .cfi_def_cfa_offset 4
13 ; GENERIC-NEXT: movi16 a2, 0
14 ; GENERIC-NEXT: subu16 a2, a2, a0
15 ; GENERIC-NEXT: and16 a2, a0
16 ; GENERIC-NEXT: movi16 a0, 7
17 ; GENERIC-NEXT: lsli16 a0, a0, 24
18 ; GENERIC-NEXT: movi16 a3, 124
19 ; GENERIC-NEXT: lsli16 a3, a3, 16
20 ; GENERIC-NEXT: or16 a3, a0
21 ; GENERIC-NEXT: movi16 a0, 181
22 ; GENERIC-NEXT: lsli16 a0, a0, 8
23 ; GENERIC-NEXT: or16 a0, a3
24 ; GENERIC-NEXT: movi16 a3, 49
25 ; GENERIC-NEXT: or16 a3, a0
26 ; GENERIC-NEXT: mult16 a3, a2
27 ; GENERIC-NEXT: lsri16 a0, a3, 27
28 ; GENERIC-NEXT: lrw32 a2, [.LCPI0_1]
29 ; GENERIC-NEXT: addu16 a0, a2, a0
30 ; GENERIC-NEXT: ld16.b a0, (a0, 0)
31 ; GENERIC-NEXT: st16.w a0, (a1, 0)
32 ; GENERIC-NEXT: addi16 sp, sp, 4
34 ; GENERIC-NEXT: .p2align 1
35 ; GENERIC-NEXT: # %bb.1:
36 ; GENERIC-NEXT: .p2align 2, 0x0
37 ; GENERIC-NEXT: .LCPI0_1:
38 ; GENERIC-NEXT: .long .LCPI0_0
39 ; GENERIC-NEXT: .LCPI0_0:
40 ; GENERIC-NEXT: .ascii "\000\001\034\002\035\016\030\003\036\026\024\017\031\021\004\b\037\033\r\027\025\023\020\007\032\f\022\006\013\005\n\t"
41 %c = call i32 @llvm.cttz.i32( i32 %C, i1 true )
42 store i32 %c, i32* %CP