Amaury Sechet | 94eb633 | 2017-06-01 14:24:31 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
Amaury Sechet | b761959 | 2017-06-01 14:09:56 +0000 | [diff] [blame] | 2 | target triple = "arm64-apple-ios7.0" |
| 3 | |
| 4 | define 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 |
| 11 | entry: |
| 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 | |
| 23 | attributes #0 = { norecurse nounwind readonly } |