blob: ba833e0b5873c0dc2932adead12f339efefeac47 [file] [log] [blame]
Amaury Sechet94eb6332017-06-01 14:24:31 +00001; RUN: llc < %s | FileCheck %s
Amaury Sechetb7619592017-06-01 14:09:56 +00002target triple = "arm64-apple-ios7.0"
3
4define i64 @foo(i64* nocapture readonly %ptr, i64 %a, i64 %b, i64 %c) local_unnamed_addr #0 {
5; CHECK: ldr w8, [x0, #4]
6; CHECK: lsr x9, x1, #32
7; CHECK: cmn x3, x2
8; CHECK: mul x8, x8, x9
9; CHECK: cinc x0, x8, hs
10; CHECK: ret
11entry:
12 %0 = lshr i64 %a, 32
13 %1 = load i64, i64* %ptr, align 8
14 %2 = lshr i64 %1, 32
15 %3 = mul nuw i64 %2, %0
16 %4 = add i64 %c, %b
17 %5 = icmp ult i64 %4, %c
18 %6 = zext i1 %5 to i64
19 %7 = add i64 %3, %6
20 ret i64 %7
21}
22
23attributes #0 = { norecurse nounwind readonly }