llvm.org GIT mirror llvm / 13a5881
[X86][BMI] Add BEXTR demanded bits test cases (PR34042) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310802 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
1 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
322322 ret i32 %3
323323 }
324324
325 ; PR34042
326 define i32 @bextr32c(i32 %x, i16 zeroext %y) {
327 ; CHECK-LABEL: bextr32c:
328 ; CHECK: # BB#0:
329 ; CHECK-NEXT: movswl %si, %eax
330 ; CHECK-NEXT: bextrl %eax, %edi, %eax
331 ; CHECK-NEXT: retq
332 %tmp0 = sext i16 %y to i32
333 %tmp1 = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %tmp0)
334 ret i32 %tmp1
335 }
336
325337 define i64 @bextr64(i64 %x, i64 %y) {
326338 ; CHECK-LABEL: bextr64:
327339 ; CHECK: # BB#0:
354366 %2 = lshr i64 %1, 4
355367 %3 = and i64 %2, 4095
356368 ret i64 %3
369 }
370
371 ; PR34042
372 define i64 @bextr64c(i64 %x, i32 %y) {
373 ; CHECK-LABEL: bextr64c:
374 ; CHECK: # BB#0:
375 ; CHECK-NEXT: movslq %esi, %rax
376 ; CHECK-NEXT: bextrq %rax, %rdi, %rax
377 ; CHECK-NEXT: retq
378 %tmp0 = sext i32 %y to i64
379 %tmp1 = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %tmp0)
380 ret i64 %tmp1
357381 }
358382
359383 define i32 @non_bextr32(i32 %x) {