Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=arm64 | FileCheck %s |
| 2 | |
| 3 | ; rdar://9296808 |
| 4 | ; rdar://9349137 |
| 5 | |
| 6 | define i128 @t1(i64 %a, i64 %b) nounwind readnone ssp { |
| 7 | entry: |
| 8 | ; CHECK-LABEL: t1: |
| 9 | ; CHECK: mul {{x[0-9]+}}, {{x[0-9]+}}, {{x[0-9]+}} |
| 10 | ; CHECK: umulh {{x[0-9]+}}, {{x[0-9]+}}, {{x[0-9]+}} |
| 11 | %tmp1 = zext i64 %a to i128 |
| 12 | %tmp2 = zext i64 %b to i128 |
| 13 | %tmp3 = mul i128 %tmp1, %tmp2 |
| 14 | ret i128 %tmp3 |
| 15 | } |
| 16 | |
| 17 | define i128 @t2(i64 %a, i64 %b) nounwind readnone ssp { |
| 18 | entry: |
| 19 | ; CHECK-LABEL: t2: |
| 20 | ; CHECK: mul {{x[0-9]+}}, {{x[0-9]+}}, {{x[0-9]+}} |
| 21 | ; CHECK: smulh {{x[0-9]+}}, {{x[0-9]+}}, {{x[0-9]+}} |
| 22 | %tmp1 = sext i64 %a to i128 |
| 23 | %tmp2 = sext i64 %b to i128 |
| 24 | %tmp3 = mul i128 %tmp1, %tmp2 |
| 25 | ret i128 %tmp3 |
| 26 | } |
| 27 | |
| 28 | define i64 @t3(i32 %a, i32 %b) nounwind { |
| 29 | entry: |
| 30 | ; CHECK-LABEL: t3: |
| 31 | ; CHECK: umull {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}} |
| 32 | %tmp1 = zext i32 %a to i64 |
| 33 | %tmp2 = zext i32 %b to i64 |
| 34 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 35 | ret i64 %tmp3 |
| 36 | } |
| 37 | |
| 38 | define i64 @t4(i32 %a, i32 %b) nounwind { |
| 39 | entry: |
| 40 | ; CHECK-LABEL: t4: |
| 41 | ; CHECK: smull {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}} |
| 42 | %tmp1 = sext i32 %a to i64 |
| 43 | %tmp2 = sext i32 %b to i64 |
| 44 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 45 | ret i64 %tmp3 |
| 46 | } |
| 47 | |
| 48 | define i64 @t5(i32 %a, i32 %b, i64 %c) nounwind { |
| 49 | entry: |
| 50 | ; CHECK-LABEL: t5: |
| 51 | ; CHECK: umaddl {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, {{x[0-9]+}} |
| 52 | %tmp1 = zext i32 %a to i64 |
| 53 | %tmp2 = zext i32 %b to i64 |
| 54 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 55 | %tmp4 = add i64 %c, %tmp3 |
| 56 | ret i64 %tmp4 |
| 57 | } |
| 58 | |
| 59 | define i64 @t6(i32 %a, i32 %b, i64 %c) nounwind { |
| 60 | entry: |
| 61 | ; CHECK-LABEL: t6: |
| 62 | ; CHECK: smsubl {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, {{x[0-9]+}} |
| 63 | %tmp1 = sext i32 %a to i64 |
| 64 | %tmp2 = sext i32 %b to i64 |
| 65 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 66 | %tmp4 = sub i64 %c, %tmp3 |
| 67 | ret i64 %tmp4 |
| 68 | } |
| 69 | |
| 70 | define i64 @t7(i32 %a, i32 %b) nounwind { |
| 71 | entry: |
| 72 | ; CHECK-LABEL: t7: |
| 73 | ; CHECK: umnegl {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}} |
| 74 | %tmp1 = zext i32 %a to i64 |
| 75 | %tmp2 = zext i32 %b to i64 |
| 76 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 77 | %tmp4 = sub i64 0, %tmp3 |
| 78 | ret i64 %tmp4 |
| 79 | } |
| 80 | |
| 81 | define i64 @t8(i32 %a, i32 %b) nounwind { |
| 82 | entry: |
| 83 | ; CHECK-LABEL: t8: |
| 84 | ; CHECK: smnegl {{x[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}} |
| 85 | %tmp1 = sext i32 %a to i64 |
| 86 | %tmp2 = sext i32 %b to i64 |
| 87 | %tmp3 = mul i64 %tmp1, %tmp2 |
| 88 | %tmp4 = sub i64 0, %tmp3 |
| 89 | ret i64 %tmp4 |
| 90 | } |