| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86-64 -mattr=+bmi,+bmi2 | FileCheck %s |
| Craig Topper | 909652f | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 2 | |
| Chandler Carruth | 131f7d3 | 2011-12-24 11:11:36 +0000 | [diff] [blame] | 3 | declare i8 @llvm.cttz.i8(i8, i1) nounwind readnone |
| 4 | declare i16 @llvm.cttz.i16(i16, i1) nounwind readnone |
| 5 | declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone |
| 6 | declare i64 @llvm.cttz.i64(i64, i1) nounwind readnone |
| 7 | |
| 8 | define i8 @t1(i8 %x) nounwind { |
| 9 | %tmp = tail call i8 @llvm.cttz.i8( i8 %x, i1 false ) |
| 10 | ret i8 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 11 | ; CHECK-LABEL: t1: |
| Chandler Carruth | 7782102 | 2011-12-24 12:12:34 +0000 | [diff] [blame] | 12 | ; CHECK: tzcntl |
| Craig Topper | 909652f | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 13 | } |
| 14 | |
| Craig Topper | 909652f | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 15 | define i16 @t2(i16 %x) nounwind { |
| Chandler Carruth | 131f7d3 | 2011-12-24 11:11:36 +0000 | [diff] [blame] | 16 | %tmp = tail call i16 @llvm.cttz.i16( i16 %x, i1 false ) |
| 17 | ret i16 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 18 | ; CHECK-LABEL: t2: |
| Craig Topper | 909652f | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 19 | ; CHECK: tzcntw |
| 20 | } |
| 21 | |
| Chandler Carruth | 131f7d3 | 2011-12-24 11:11:36 +0000 | [diff] [blame] | 22 | define i32 @t3(i32 %x) nounwind { |
| 23 | %tmp = tail call i32 @llvm.cttz.i32( i32 %x, i1 false ) |
| 24 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 25 | ; CHECK-LABEL: t3: |
| Chandler Carruth | 131f7d3 | 2011-12-24 11:11:36 +0000 | [diff] [blame] | 26 | ; CHECK: tzcntl |
| 27 | } |
| 28 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 29 | define i32 @tzcnt32_load(i32* %x) nounwind { |
| 30 | %x1 = load i32* %x |
| 31 | %tmp = tail call i32 @llvm.cttz.i32(i32 %x1, i1 false ) |
| 32 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 33 | ; CHECK-LABEL: tzcnt32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 34 | ; CHECK: tzcntl ({{.*}}) |
| 35 | } |
| 36 | |
| Chandler Carruth | 131f7d3 | 2011-12-24 11:11:36 +0000 | [diff] [blame] | 37 | define i64 @t4(i64 %x) nounwind { |
| 38 | %tmp = tail call i64 @llvm.cttz.i64( i64 %x, i1 false ) |
| 39 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 40 | ; CHECK-LABEL: t4: |
| Craig Topper | 909652f | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 41 | ; CHECK: tzcntq |
| 42 | } |
| 43 | |
| Chandler Carruth | d873a4b | 2011-12-24 11:11:38 +0000 | [diff] [blame] | 44 | define i8 @t5(i8 %x) nounwind { |
| 45 | %tmp = tail call i8 @llvm.cttz.i8( i8 %x, i1 true ) |
| 46 | ret i8 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 47 | ; CHECK-LABEL: t5: |
| Chandler Carruth | 7782102 | 2011-12-24 12:12:34 +0000 | [diff] [blame] | 48 | ; CHECK: tzcntl |
| Chandler Carruth | d873a4b | 2011-12-24 11:11:38 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | define i16 @t6(i16 %x) nounwind { |
| 52 | %tmp = tail call i16 @llvm.cttz.i16( i16 %x, i1 true ) |
| 53 | ret i16 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 54 | ; CHECK-LABEL: t6: |
| Chandler Carruth | d873a4b | 2011-12-24 11:11:38 +0000 | [diff] [blame] | 55 | ; CHECK: tzcntw |
| 56 | } |
| 57 | |
| 58 | define i32 @t7(i32 %x) nounwind { |
| 59 | %tmp = tail call i32 @llvm.cttz.i32( i32 %x, i1 true ) |
| 60 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 61 | ; CHECK-LABEL: t7: |
| Chandler Carruth | d873a4b | 2011-12-24 11:11:38 +0000 | [diff] [blame] | 62 | ; CHECK: tzcntl |
| 63 | } |
| 64 | |
| 65 | define i64 @t8(i64 %x) nounwind { |
| 66 | %tmp = tail call i64 @llvm.cttz.i64( i64 %x, i1 true ) |
| 67 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 68 | ; CHECK-LABEL: t8: |
| Chandler Carruth | d873a4b | 2011-12-24 11:11:38 +0000 | [diff] [blame] | 69 | ; CHECK: tzcntq |
| 70 | } |
| 71 | |
| Craig Topper | 54a1117 | 2011-10-14 07:06:56 +0000 | [diff] [blame] | 72 | define i32 @andn32(i32 %x, i32 %y) nounwind readnone { |
| 73 | %tmp1 = xor i32 %x, -1 |
| 74 | %tmp2 = and i32 %y, %tmp1 |
| 75 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 76 | ; CHECK-LABEL: andn32: |
| Craig Topper | 54a1117 | 2011-10-14 07:06:56 +0000 | [diff] [blame] | 77 | ; CHECK: andnl |
| 78 | } |
| 79 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 80 | define i32 @andn32_load(i32 %x, i32* %y) nounwind readnone { |
| 81 | %y1 = load i32* %y |
| 82 | %tmp1 = xor i32 %x, -1 |
| 83 | %tmp2 = and i32 %y1, %tmp1 |
| 84 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 85 | ; CHECK-LABEL: andn32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 86 | ; CHECK: andnl ({{.*}}) |
| 87 | } |
| 88 | |
| Craig Topper | 54a1117 | 2011-10-14 07:06:56 +0000 | [diff] [blame] | 89 | define i64 @andn64(i64 %x, i64 %y) nounwind readnone { |
| 90 | %tmp1 = xor i64 %x, -1 |
| 91 | %tmp2 = and i64 %tmp1, %y |
| 92 | ret i64 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 93 | ; CHECK-LABEL: andn64: |
| Craig Topper | 54a1117 | 2011-10-14 07:06:56 +0000 | [diff] [blame] | 94 | ; CHECK: andnq |
| 95 | } |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 96 | |
| 97 | define i32 @bextr32(i32 %x, i32 %y) nounwind readnone { |
| 98 | %tmp = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %y) |
| 99 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 100 | ; CHECK-LABEL: bextr32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 101 | ; CHECK: bextrl |
| 102 | } |
| 103 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 104 | define i32 @bextr32_load(i32* %x, i32 %y) nounwind readnone { |
| 105 | %x1 = load i32* %x |
| 106 | %tmp = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x1, i32 %y) |
| 107 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 108 | ; CHECK-LABEL: bextr32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 109 | ; CHECK: bextrl {{.*}}, ({{.*}}), {{.*}} |
| 110 | } |
| 111 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 112 | declare i32 @llvm.x86.bmi.bextr.32(i32, i32) nounwind readnone |
| 113 | |
| 114 | define i64 @bextr64(i64 %x, i64 %y) nounwind readnone { |
| 115 | %tmp = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %y) |
| 116 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 117 | ; CHECK-LABEL: bextr64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 118 | ; CHECK: bextrq |
| 119 | } |
| 120 | |
| 121 | declare i64 @llvm.x86.bmi.bextr.64(i64, i64) nounwind readnone |
| 122 | |
| 123 | define i32 @bzhi32(i32 %x, i32 %y) nounwind readnone { |
| 124 | %tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x, i32 %y) |
| 125 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 126 | ; CHECK-LABEL: bzhi32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 127 | ; CHECK: bzhil |
| 128 | } |
| 129 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 130 | define i32 @bzhi32_load(i32* %x, i32 %y) nounwind readnone { |
| 131 | %x1 = load i32* %x |
| 132 | %tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x1, i32 %y) |
| 133 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 134 | ; CHECK-LABEL: bzhi32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 135 | ; CHECK: bzhil {{.*}}, ({{.*}}), {{.*}} |
| 136 | } |
| 137 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 138 | declare i32 @llvm.x86.bmi.bzhi.32(i32, i32) nounwind readnone |
| 139 | |
| 140 | define i64 @bzhi64(i64 %x, i64 %y) nounwind readnone { |
| 141 | %tmp = tail call i64 @llvm.x86.bmi.bzhi.64(i64 %x, i64 %y) |
| 142 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 143 | ; CHECK-LABEL: bzhi64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 144 | ; CHECK: bzhiq |
| 145 | } |
| 146 | |
| 147 | declare i64 @llvm.x86.bmi.bzhi.64(i64, i64) nounwind readnone |
| 148 | |
| Craig Topper | b6ac30a | 2013-08-30 06:52:21 +0000 | [diff] [blame] | 149 | define i32 @bzhi32b(i32 %x, i8 zeroext %index) #0 { |
| 150 | entry: |
| 151 | %conv = zext i8 %index to i32 |
| 152 | %shl = shl i32 1, %conv |
| 153 | %sub = add nsw i32 %shl, -1 |
| 154 | %and = and i32 %sub, %x |
| 155 | ret i32 %and |
| 156 | ; CHECK-LABEL: bzhi32b: |
| 157 | ; CHECK: bzhil |
| 158 | } |
| 159 | |
| 160 | define i32 @bzhi32b_load(i32* %w, i8 zeroext %index) #0 { |
| 161 | entry: |
| 162 | %x = load i32* %w |
| 163 | %conv = zext i8 %index to i32 |
| 164 | %shl = shl i32 1, %conv |
| 165 | %sub = add nsw i32 %shl, -1 |
| 166 | %and = and i32 %sub, %x |
| 167 | ret i32 %and |
| 168 | ; CHECK-LABEL: bzhi32b_load: |
| 169 | ; CHECK: bzhil {{.*}}, ({{.*}}), {{.*}} |
| 170 | } |
| 171 | |
| 172 | define i32 @bzhi32c(i32 %x, i8 zeroext %index) #0 { |
| 173 | entry: |
| 174 | %conv = zext i8 %index to i32 |
| 175 | %shl = shl i32 1, %conv |
| 176 | %sub = add nsw i32 %shl, -1 |
| 177 | %and = and i32 %x, %sub |
| 178 | ret i32 %and |
| 179 | ; CHECK-LABEL: bzhi32c: |
| 180 | ; CHECK: bzhil |
| 181 | } |
| 182 | |
| 183 | define i64 @bzhi64b(i64 %x, i8 zeroext %index) #0 { |
| 184 | entry: |
| 185 | %conv = zext i8 %index to i64 |
| 186 | %shl = shl i64 1, %conv |
| 187 | %sub = add nsw i64 %shl, -1 |
| 188 | %and = and i64 %x, %sub |
| 189 | ret i64 %and |
| 190 | ; CHECK-LABEL: bzhi64b: |
| 191 | ; CHECK: bzhiq |
| 192 | } |
| 193 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 194 | define i32 @blsi32(i32 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 195 | %tmp = sub i32 0, %x |
| 196 | %tmp2 = and i32 %x, %tmp |
| 197 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 198 | ; CHECK-LABEL: blsi32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 199 | ; CHECK: blsil |
| 200 | } |
| 201 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 202 | define i32 @blsi32_load(i32* %x) nounwind readnone { |
| 203 | %x1 = load i32* %x |
| 204 | %tmp = sub i32 0, %x1 |
| 205 | %tmp2 = and i32 %x1, %tmp |
| 206 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 207 | ; CHECK-LABEL: blsi32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 208 | ; CHECK: blsil ({{.*}}) |
| 209 | } |
| 210 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 211 | define i64 @blsi64(i64 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 212 | %tmp = sub i64 0, %x |
| 213 | %tmp2 = and i64 %tmp, %x |
| 214 | ret i64 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 215 | ; CHECK-LABEL: blsi64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 216 | ; CHECK: blsiq |
| 217 | } |
| 218 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 219 | define i32 @blsmsk32(i32 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 220 | %tmp = sub i32 %x, 1 |
| 221 | %tmp2 = xor i32 %x, %tmp |
| 222 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 223 | ; CHECK-LABEL: blsmsk32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 224 | ; CHECK: blsmskl |
| 225 | } |
| 226 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 227 | define i32 @blsmsk32_load(i32* %x) nounwind readnone { |
| 228 | %x1 = load i32* %x |
| 229 | %tmp = sub i32 %x1, 1 |
| 230 | %tmp2 = xor i32 %x1, %tmp |
| 231 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 232 | ; CHECK-LABEL: blsmsk32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 233 | ; CHECK: blsmskl ({{.*}}) |
| 234 | } |
| 235 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 236 | define i64 @blsmsk64(i64 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 237 | %tmp = sub i64 %x, 1 |
| 238 | %tmp2 = xor i64 %tmp, %x |
| 239 | ret i64 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 240 | ; CHECK-LABEL: blsmsk64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 241 | ; CHECK: blsmskq |
| 242 | } |
| 243 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 244 | define i32 @blsr32(i32 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 245 | %tmp = sub i32 %x, 1 |
| 246 | %tmp2 = and i32 %x, %tmp |
| 247 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 248 | ; CHECK-LABEL: blsr32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 249 | ; CHECK: blsrl |
| 250 | } |
| 251 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 252 | define i32 @blsr32_load(i32* %x) nounwind readnone { |
| 253 | %x1 = load i32* %x |
| 254 | %tmp = sub i32 %x1, 1 |
| 255 | %tmp2 = and i32 %x1, %tmp |
| 256 | ret i32 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 257 | ; CHECK-LABEL: blsr32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 258 | ; CHECK: blsrl ({{.*}}) |
| 259 | } |
| 260 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 261 | define i64 @blsr64(i64 %x) nounwind readnone { |
| Craig Topper | b4c9457 | 2011-10-21 06:55:01 +0000 | [diff] [blame] | 262 | %tmp = sub i64 %x, 1 |
| 263 | %tmp2 = and i64 %tmp, %x |
| 264 | ret i64 %tmp2 |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 265 | ; CHECK-LABEL: blsr64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 266 | ; CHECK: blsrq |
| 267 | } |
| 268 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 269 | define i32 @pdep32(i32 %x, i32 %y) nounwind readnone { |
| 270 | %tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y) |
| 271 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 272 | ; CHECK-LABEL: pdep32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 273 | ; CHECK: pdepl |
| 274 | } |
| 275 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 276 | define i32 @pdep32_load(i32 %x, i32* %y) nounwind readnone { |
| 277 | %y1 = load i32* %y |
| 278 | %tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y1) |
| 279 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 280 | ; CHECK-LABEL: pdep32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 281 | ; CHECK: pdepl ({{.*}}) |
| 282 | } |
| 283 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 284 | declare i32 @llvm.x86.bmi.pdep.32(i32, i32) nounwind readnone |
| 285 | |
| 286 | define i64 @pdep64(i64 %x, i64 %y) nounwind readnone { |
| 287 | %tmp = tail call i64 @llvm.x86.bmi.pdep.64(i64 %x, i64 %y) |
| 288 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 289 | ; CHECK-LABEL: pdep64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 290 | ; CHECK: pdepq |
| 291 | } |
| 292 | |
| 293 | declare i64 @llvm.x86.bmi.pdep.64(i64, i64) nounwind readnone |
| 294 | |
| 295 | define i32 @pext32(i32 %x, i32 %y) nounwind readnone { |
| 296 | %tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y) |
| 297 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 298 | ; CHECK-LABEL: pext32: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 299 | ; CHECK: pextl |
| 300 | } |
| 301 | |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 302 | define i32 @pext32_load(i32 %x, i32* %y) nounwind readnone { |
| 303 | %y1 = load i32* %y |
| 304 | %tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y1) |
| 305 | ret i32 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 306 | ; CHECK-LABEL: pext32_load: |
| Craig Topper | b72ae70 | 2012-12-17 05:02:29 +0000 | [diff] [blame] | 307 | ; CHECK: pextl ({{.*}}) |
| 308 | } |
| 309 | |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 310 | declare i32 @llvm.x86.bmi.pext.32(i32, i32) nounwind readnone |
| 311 | |
| 312 | define i64 @pext64(i64 %x, i64 %y) nounwind readnone { |
| 313 | %tmp = tail call i64 @llvm.x86.bmi.pext.64(i64 %x, i64 %y) |
| 314 | ret i64 %tmp |
| Stephen Lin | 8b2b8a1 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 315 | ; CHECK-LABEL: pext64: |
| Craig Topper | 717cdb0 | 2011-10-19 07:48:35 +0000 | [diff] [blame] | 316 | ; CHECK: pextq |
| 317 | } |
| 318 | |
| 319 | declare i64 @llvm.x86.bmi.pext.64(i64, i64) nounwind readnone |
| 320 | |