John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86-64 > %t |
| 2 | ; RUN: not grep leaq %t |
| 3 | ; RUN: not grep incq %t |
| 4 | ; RUN: not grep decq %t |
| 5 | ; RUN: not grep negq %t |
| 6 | ; RUN: not grep addq %t |
| 7 | ; RUN: not grep subq %t |
| 8 | ; RUN: not grep {movl %} %t |
| 9 | |
| 10 | ; Utilize implicit zero-extension on x86-64 to eliminate explicit |
| 11 | ; zero-extensions. Shrink 64-bit adds to 32-bit when the high |
| 12 | ; 32-bits will be zeroed. |
| 13 | |
| 14 | define void @bar(i64 %x, i64 %y, i64* %z) nounwind readnone { |
| 15 | entry: |
| 16 | %t0 = add i64 %x, %y |
| 17 | %t1 = and i64 %t0, 4294967295 |
| 18 | store i64 %t1, i64* %z |
| 19 | ret void |
| 20 | } |
| 21 | define void @easy(i32 %x, i32 %y, i64* %z) nounwind readnone { |
| 22 | entry: |
| 23 | %t0 = add i32 %x, %y |
| 24 | %tn = zext i32 %t0 to i64 |
| 25 | %t1 = and i64 %tn, 4294967295 |
| 26 | store i64 %t1, i64* %z |
| 27 | ret void |
| 28 | } |
| 29 | define void @cola(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone { |
| 30 | entry: |
| 31 | %p = load i64* %x |
| 32 | %t0 = add i64 %p, %y |
| 33 | %t1 = and i64 %t0, 4294967295 |
| 34 | %t2 = xor i64 %t1, %u |
| 35 | store i64 %t2, i64* %z |
| 36 | ret void |
| 37 | } |
| 38 | define void @yaks(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone { |
| 39 | entry: |
| 40 | %p = load i64* %x |
| 41 | %t0 = add i64 %p, %y |
| 42 | %t1 = xor i64 %t0, %u |
| 43 | %t2 = and i64 %t1, 4294967295 |
| 44 | store i64 %t2, i64* %z |
| 45 | ret void |
| 46 | } |
| 47 | define void @foo(i64 *%x, i64 *%y, i64* %z) nounwind readnone { |
| 48 | entry: |
| 49 | %a = load i64* %x |
| 50 | %b = load i64* %y |
| 51 | %t0 = add i64 %a, %b |
| 52 | %t1 = and i64 %t0, 4294967295 |
| 53 | store i64 %t1, i64* %z |
| 54 | ret void |
| 55 | } |
| 56 | define void @avo(i64 %x, i64* %z, i64 %u) nounwind readnone { |
| 57 | entry: |
| 58 | %t0 = add i64 %x, 734847 |
| 59 | %t1 = and i64 %t0, 4294967295 |
| 60 | %t2 = xor i64 %t1, %u |
| 61 | store i64 %t2, i64* %z |
| 62 | ret void |
| 63 | } |
| 64 | define void @phe(i64 %x, i64* %z, i64 %u) nounwind readnone { |
| 65 | entry: |
| 66 | %t0 = add i64 %x, 734847 |
| 67 | %t1 = xor i64 %t0, %u |
| 68 | %t2 = and i64 %t1, 4294967295 |
| 69 | store i64 %t2, i64* %z |
| 70 | ret void |
| 71 | } |
| 72 | define void @oze(i64 %y, i64* %z) nounwind readnone { |
| 73 | entry: |
| 74 | %t0 = add i64 %y, 1 |
| 75 | %t1 = and i64 %t0, 4294967295 |
| 76 | store i64 %t1, i64* %z |
| 77 | ret void |
| 78 | } |
| 79 | |
| 80 | define void @sbar(i64 %x, i64 %y, i64* %z) nounwind readnone { |
| 81 | entry: |
| 82 | %t0 = sub i64 %x, %y |
| 83 | %t1 = and i64 %t0, 4294967295 |
| 84 | store i64 %t1, i64* %z |
| 85 | ret void |
| 86 | } |
| 87 | define void @seasy(i32 %x, i32 %y, i64* %z) nounwind readnone { |
| 88 | entry: |
| 89 | %t0 = sub i32 %x, %y |
| 90 | %tn = zext i32 %t0 to i64 |
| 91 | %t1 = and i64 %tn, 4294967295 |
| 92 | store i64 %t1, i64* %z |
| 93 | ret void |
| 94 | } |
| 95 | define void @scola(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone { |
| 96 | entry: |
| 97 | %p = load i64* %x |
| 98 | %t0 = sub i64 %p, %y |
| 99 | %t1 = and i64 %t0, 4294967295 |
| 100 | %t2 = xor i64 %t1, %u |
| 101 | store i64 %t2, i64* %z |
| 102 | ret void |
| 103 | } |
| 104 | define void @syaks(i64 *%x, i64 %y, i64* %z, i64 %u) nounwind readnone { |
| 105 | entry: |
| 106 | %p = load i64* %x |
| 107 | %t0 = sub i64 %p, %y |
| 108 | %t1 = xor i64 %t0, %u |
| 109 | %t2 = and i64 %t1, 4294967295 |
| 110 | store i64 %t2, i64* %z |
| 111 | ret void |
| 112 | } |
| 113 | define void @sfoo(i64 *%x, i64 *%y, i64* %z) nounwind readnone { |
| 114 | entry: |
| 115 | %a = load i64* %x |
| 116 | %b = load i64* %y |
| 117 | %t0 = sub i64 %a, %b |
| 118 | %t1 = and i64 %t0, 4294967295 |
| 119 | store i64 %t1, i64* %z |
| 120 | ret void |
| 121 | } |
| 122 | define void @swya(i64 %y, i64* %z) nounwind readnone { |
| 123 | entry: |
| 124 | %t0 = sub i64 0, %y |
| 125 | %t1 = and i64 %t0, 4294967295 |
| 126 | store i64 %t1, i64* %z |
| 127 | ret void |
| 128 | } |
| 129 | define void @soze(i64 %y, i64* %z) nounwind readnone { |
| 130 | entry: |
| 131 | %t0 = sub i64 %y, 1 |
| 132 | %t1 = and i64 %t0, 4294967295 |
| 133 | store i64 %t1, i64* %z |
| 134 | ret void |
| 135 | } |