1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-unknown-unknown | FileCheck %s
4 define i64 @f0(i64 %val, i64 %amt) minsize optsize {
7 ; CHECK-NEXT: lsl x0, x0, x1
9 %res = shl i64 %val, %amt
13 define i32 @f1(i64 %x, i64 %y) minsize optsize {
16 ; CHECK-NEXT: lsl x0, x0, x1
17 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
20 %b = trunc i64 %a to i32
24 define i32 @f2(i64 %x, i64 %y) minsize optsize {
27 ; CHECK-NEXT: asr x0, x0, x1
28 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
31 %b = trunc i64 %a to i32
35 define i32 @f3(i64 %x, i64 %y) minsize optsize {
38 ; CHECK-NEXT: lsr x0, x0, x1
39 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
42 %b = trunc i64 %a to i32
46 define dso_local { i64, i64 } @shl128(i64 %x.coerce0, i64 %x.coerce1, i8 signext %y) minsize optsize {
47 ; CHECK-LABEL: shl128:
48 ; CHECK: // %bb.0: // %entry
49 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
50 ; CHECK-NEXT: .cfi_def_cfa_offset 16
51 ; CHECK-NEXT: .cfi_offset w30, -16
52 ; CHECK-NEXT: // kill: def $w2 killed $w2 def $x2
53 ; CHECK-NEXT: bl __ashlti3
54 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
57 %x.sroa.2.0.insert.ext = zext i64 %x.coerce1 to i128
58 %x.sroa.2.0.insert.shift = shl nuw i128 %x.sroa.2.0.insert.ext, 64
59 %x.sroa.0.0.insert.ext = zext i64 %x.coerce0 to i128
60 %x.sroa.0.0.insert.insert = or i128 %x.sroa.2.0.insert.shift, %x.sroa.0.0.insert.ext
61 %conv = sext i8 %y to i32
62 %sh_prom = zext i32 %conv to i128
63 %shl = shl i128 %x.sroa.0.0.insert.insert, %sh_prom
64 %retval.sroa.0.0.extract.trunc = trunc i128 %shl to i64
65 %retval.sroa.2.0.extract.shift = lshr i128 %shl, 64
66 %retval.sroa.2.0.extract.trunc = trunc i128 %retval.sroa.2.0.extract.shift to i64
67 %.fca.0.insert = insertvalue { i64, i64 } undef, i64 %retval.sroa.0.0.extract.trunc, 0
68 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.extract.trunc, 1
69 ret { i64, i64 } %.fca.1.insert
72 define dso_local { i64, i64 } @ashr128(i64 %x.coerce0, i64 %x.coerce1, i8 signext %y) minsize optsize {
73 ; CHECK-LABEL: ashr128:
74 ; CHECK: // %bb.0: // %entry
75 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
76 ; CHECK-NEXT: .cfi_def_cfa_offset 16
77 ; CHECK-NEXT: .cfi_offset w30, -16
78 ; CHECK-NEXT: // kill: def $w2 killed $w2 def $x2
79 ; CHECK-NEXT: bl __ashrti3
80 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
83 %x.sroa.2.0.insert.ext = zext i64 %x.coerce1 to i128
84 %x.sroa.2.0.insert.shift = shl nuw i128 %x.sroa.2.0.insert.ext, 64
85 %x.sroa.0.0.insert.ext = zext i64 %x.coerce0 to i128
86 %x.sroa.0.0.insert.insert = or i128 %x.sroa.2.0.insert.shift, %x.sroa.0.0.insert.ext
87 %conv = sext i8 %y to i32
88 %sh_prom = zext i32 %conv to i128
89 %shr = ashr i128 %x.sroa.0.0.insert.insert, %sh_prom
90 %retval.sroa.0.0.extract.trunc = trunc i128 %shr to i64
91 %retval.sroa.2.0.extract.shift = lshr i128 %shr, 64
92 %retval.sroa.2.0.extract.trunc = trunc i128 %retval.sroa.2.0.extract.shift to i64
93 %.fca.0.insert = insertvalue { i64, i64 } undef, i64 %retval.sroa.0.0.extract.trunc, 0
94 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.extract.trunc, 1
95 ret { i64, i64 } %.fca.1.insert
98 define dso_local { i64, i64 } @lshr128(i64 %x.coerce0, i64 %x.coerce1, i8 signext %y) minsize optsize {
99 ; CHECK-LABEL: lshr128:
100 ; CHECK: // %bb.0: // %entry
101 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
102 ; CHECK-NEXT: .cfi_def_cfa_offset 16
103 ; CHECK-NEXT: .cfi_offset w30, -16
104 ; CHECK-NEXT: // kill: def $w2 killed $w2 def $x2
105 ; CHECK-NEXT: bl __lshrti3
106 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
109 %x.sroa.2.0.insert.ext = zext i64 %x.coerce1 to i128
110 %x.sroa.2.0.insert.shift = shl nuw i128 %x.sroa.2.0.insert.ext, 64
111 %x.sroa.0.0.insert.ext = zext i64 %x.coerce0 to i128
112 %x.sroa.0.0.insert.insert = or i128 %x.sroa.2.0.insert.shift, %x.sroa.0.0.insert.ext
113 %conv = sext i8 %y to i32
114 %sh_prom = zext i32 %conv to i128
115 %shr = lshr i128 %x.sroa.0.0.insert.insert, %sh_prom
116 %retval.sroa.0.0.extract.trunc = trunc i128 %shr to i64
117 %retval.sroa.2.0.extract.shift = lshr i128 %shr, 64
118 %retval.sroa.2.0.extract.trunc = trunc i128 %retval.sroa.2.0.extract.shift to i64
119 %.fca.0.insert = insertvalue { i64, i64 } undef, i64 %retval.sroa.0.0.extract.trunc, 0
120 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.extract.trunc, 1
121 ret { i64, i64 } %.fca.1.insert