mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[NFC][X86] Add BEXTR test with load and 33-bit mask (PR43381 / D67875)
llvm-svn: 372524
This commit is contained in:
parent
44e3baa609
commit
a8217101c5
@ -102,6 +102,35 @@ entry:
|
||||
ret i64 %and
|
||||
}
|
||||
|
||||
define i64 @bextr64d_load(i64* %aptr) {
|
||||
; BMI1-SLOW-LABEL: bextr64d_load:
|
||||
; BMI1-SLOW: # %bb.0: # %entry
|
||||
; BMI1-SLOW-NEXT: movq (%rdi), %rax
|
||||
; BMI1-SLOW-NEXT: shrq $2, %rax
|
||||
; BMI1-SLOW-NEXT: movl $8448, %ecx # imm = 0x2100
|
||||
; BMI1-SLOW-NEXT: bextrq %rcx, %rax, %rax
|
||||
; BMI1-SLOW-NEXT: retq
|
||||
;
|
||||
; BMI2-SLOW-LABEL: bextr64d_load:
|
||||
; BMI2-SLOW: # %bb.0: # %entry
|
||||
; BMI2-SLOW-NEXT: movq (%rdi), %rax
|
||||
; BMI2-SLOW-NEXT: shrq $2, %rax
|
||||
; BMI2-SLOW-NEXT: movb $33, %cl
|
||||
; BMI2-SLOW-NEXT: bzhiq %rcx, %rax, %rax
|
||||
; BMI2-SLOW-NEXT: retq
|
||||
;
|
||||
; BEXTR-FAST-LABEL: bextr64d_load:
|
||||
; BEXTR-FAST: # %bb.0: # %entry
|
||||
; BEXTR-FAST-NEXT: movl $8450, %eax # imm = 0x2102
|
||||
; BEXTR-FAST-NEXT: bextrq %rax, (%rdi), %rax
|
||||
; BEXTR-FAST-NEXT: retq
|
||||
entry:
|
||||
%a = load i64, i64* %aptr, align 8
|
||||
%shr = lshr i64 %a, 2
|
||||
%and = and i64 %shr, 8589934591
|
||||
ret i64 %and
|
||||
}
|
||||
|
||||
define i64 @non_bextr64(i64 %x) {
|
||||
; CHECK-LABEL: non_bextr64:
|
||||
; CHECK: # %bb.0: # %entry
|
||||
|
Loading…
Reference in New Issue
Block a user