blob: a44f4ea839680e13711651fcc8c0630f04fea650 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc < %s -mtriple=x86_64-- -mattr=+bmi2 | FileCheck %s --check-prefix=BMI2
; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=NOBMI2
define i8 @pext_i8(i8 %val, i8 %mask) nounwind {
; BMI2-LABEL: pext_i8:
; BMI2: # %bb.0:
; BMI2-NEXT: movzbl %sil, %eax
; BMI2-NEXT: pextl %eax, %edi, %eax
; BMI2-NEXT: # kill: def $al killed $al killed $eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_i8:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: movl %esi, %eax
; NOBMI2-NEXT: notb %al
; NOBMI2-NEXT: leal (,%rax,4), %ecx
; NOBMI2-NEXT: addb %al, %al
; NOBMI2-NEXT: xorb %al, %cl
; NOBMI2-NEXT: leal (,%rcx,4), %edx
; NOBMI2-NEXT: xorb %cl, %dl
; NOBMI2-NEXT: movl %edx, %ecx
; NOBMI2-NEXT: shlb $4, %cl
; NOBMI2-NEXT: xorb %dl, %cl
; NOBMI2-NEXT: movl %ecx, %r8d
; NOBMI2-NEXT: notb %r8b
; NOBMI2-NEXT: andb %al, %r8b
; NOBMI2-NEXT: leal (%r8,%r8), %eax
; NOBMI2-NEXT: xorb %r8b, %al
; NOBMI2-NEXT: leal (,%rax,4), %r9d
; NOBMI2-NEXT: xorb %al, %r9b
; NOBMI2-NEXT: movl %r9d, %edx
; NOBMI2-NEXT: shlb $4, %dl
; NOBMI2-NEXT: xorb %r9b, %dl
; NOBMI2-NEXT: movl %edx, %eax
; NOBMI2-NEXT: notb %al
; NOBMI2-NEXT: andb %r8b, %al
; NOBMI2-NEXT: leal (%rax,%rax), %r8d
; NOBMI2-NEXT: xorb %al, %r8b
; NOBMI2-NEXT: leal (,%r8,4), %eax
; NOBMI2-NEXT: xorb %r8b, %al
; NOBMI2-NEXT: movl %eax, %r8d
; NOBMI2-NEXT: shlb $4, %r8b
; NOBMI2-NEXT: xorb %al, %r8b
; NOBMI2-NEXT: andb %sil, %cl
; NOBMI2-NEXT: andl %esi, %edi
; NOBMI2-NEXT: movl %esi, %eax
; NOBMI2-NEXT: xorb %cl, %al
; NOBMI2-NEXT: movl %ecx, %esi
; NOBMI2-NEXT: shrb %sil
; NOBMI2-NEXT: orb %al, %sil
; NOBMI2-NEXT: andb %sil, %dl
; NOBMI2-NEXT: xorb %dl, %sil
; NOBMI2-NEXT: movl %edx, %eax
; NOBMI2-NEXT: shrb $2, %al
; NOBMI2-NEXT: orb %sil, %al
; NOBMI2-NEXT: andb %dil, %cl
; NOBMI2-NEXT: xorb %cl, %dil
; NOBMI2-NEXT: shrb %cl
; NOBMI2-NEXT: orb %dil, %cl
; NOBMI2-NEXT: andb %cl, %dl
; NOBMI2-NEXT: xorb %dl, %cl
; NOBMI2-NEXT: shrb $2, %dl
; NOBMI2-NEXT: orb %cl, %dl
; NOBMI2-NEXT: andb %dl, %al
; NOBMI2-NEXT: andb %r8b, %al
; NOBMI2-NEXT: xorb %al, %dl
; NOBMI2-NEXT: shrb $4, %al
; NOBMI2-NEXT: orb %dl, %al
; NOBMI2-NEXT: retq
%res = call i8 @llvm.pext.i8(i8 %val, i8 %mask)
ret i8 %res
}
define i16 @pext_i16(i16 %val, i16 %mask) nounwind {
; BMI2-LABEL: pext_i16:
; BMI2: # %bb.0:
; BMI2-NEXT: movzwl %si, %eax
; BMI2-NEXT: pextl %eax, %edi, %eax
; BMI2-NEXT: # kill: def $ax killed $ax killed $eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_i16:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: pushq %rbx
; NOBMI2-NEXT: movl %esi, %ecx
; NOBMI2-NEXT: notl %ecx
; NOBMI2-NEXT: leal (,%rcx,4), %eax
; NOBMI2-NEXT: addl %ecx, %ecx
; NOBMI2-NEXT: xorl %ecx, %eax
; NOBMI2-NEXT: leal (,%rax,4), %edx
; NOBMI2-NEXT: xorl %eax, %edx
; NOBMI2-NEXT: movl %edx, %r8d
; NOBMI2-NEXT: shll $4, %r8d
; NOBMI2-NEXT: xorl %edx, %r8d
; NOBMI2-NEXT: movl %r8d, %eax
; NOBMI2-NEXT: shll $8, %eax
; NOBMI2-NEXT: xorl %r8d, %eax
; NOBMI2-NEXT: movl %eax, %edx
; NOBMI2-NEXT: notl %edx
; NOBMI2-NEXT: andl %ecx, %edx
; NOBMI2-NEXT: leal (%rdx,%rdx), %ecx
; NOBMI2-NEXT: xorl %edx, %ecx
; NOBMI2-NEXT: leal (,%rcx,4), %r8d
; NOBMI2-NEXT: xorl %ecx, %r8d
; NOBMI2-NEXT: movl %r8d, %r9d
; NOBMI2-NEXT: shll $4, %r9d
; NOBMI2-NEXT: xorl %r8d, %r9d
; NOBMI2-NEXT: movl %r9d, %ecx
; NOBMI2-NEXT: shll $8, %ecx
; NOBMI2-NEXT: xorl %r9d, %ecx
; NOBMI2-NEXT: movl %ecx, %r8d
; NOBMI2-NEXT: notl %r8d
; NOBMI2-NEXT: andl %edx, %r8d
; NOBMI2-NEXT: leal (%r8,%r8), %edx
; NOBMI2-NEXT: xorl %r8d, %edx
; NOBMI2-NEXT: leal (,%rdx,4), %r9d
; NOBMI2-NEXT: xorl %edx, %r9d
; NOBMI2-NEXT: movl %r9d, %r10d
; NOBMI2-NEXT: shll $4, %r10d
; NOBMI2-NEXT: xorl %r9d, %r10d
; NOBMI2-NEXT: movl %r10d, %edx
; NOBMI2-NEXT: shll $8, %edx
; NOBMI2-NEXT: xorl %r10d, %edx
; NOBMI2-NEXT: movl %edx, %r9d
; NOBMI2-NEXT: notl %r9d
; NOBMI2-NEXT: andl %r8d, %r9d
; NOBMI2-NEXT: leal (%r9,%r9), %r8d
; NOBMI2-NEXT: xorl %r9d, %r8d
; NOBMI2-NEXT: leal (,%r8,4), %r9d
; NOBMI2-NEXT: xorl %r8d, %r9d
; NOBMI2-NEXT: movl %r9d, %r10d
; NOBMI2-NEXT: shll $4, %r10d
; NOBMI2-NEXT: xorl %r9d, %r10d
; NOBMI2-NEXT: movl %r10d, %r8d
; NOBMI2-NEXT: shll $8, %r8d
; NOBMI2-NEXT: xorl %r10d, %r8d
; NOBMI2-NEXT: andl %esi, %eax
; NOBMI2-NEXT: andl %esi, %edi
; NOBMI2-NEXT: xorl %eax, %esi
; NOBMI2-NEXT: movzwl %ax, %r9d
; NOBMI2-NEXT: shrl %r9d
; NOBMI2-NEXT: orl %esi, %r9d
; NOBMI2-NEXT: andl %r9d, %ecx
; NOBMI2-NEXT: xorl %ecx, %r9d
; NOBMI2-NEXT: movzwl %cx, %esi
; NOBMI2-NEXT: shrl $2, %esi
; NOBMI2-NEXT: orl %r9d, %esi
; NOBMI2-NEXT: andl %esi, %edx
; NOBMI2-NEXT: xorl %edx, %esi
; NOBMI2-NEXT: movzwl %dx, %ebx
; NOBMI2-NEXT: shrl $4, %ebx
; NOBMI2-NEXT: orl %esi, %ebx
; NOBMI2-NEXT: andl %edi, %eax
; NOBMI2-NEXT: xorl %eax, %edi
; NOBMI2-NEXT: movzwl %ax, %eax
; NOBMI2-NEXT: shrl %eax
; NOBMI2-NEXT: orl %edi, %eax
; NOBMI2-NEXT: andl %eax, %ecx
; NOBMI2-NEXT: xorl %ecx, %eax
; NOBMI2-NEXT: movzwl %cx, %ecx
; NOBMI2-NEXT: shrl $2, %ecx
; NOBMI2-NEXT: orl %eax, %ecx
; NOBMI2-NEXT: andl %ecx, %edx
; NOBMI2-NEXT: xorl %edx, %ecx
; NOBMI2-NEXT: movzwl %dx, %edx
; NOBMI2-NEXT: shrl $4, %edx
; NOBMI2-NEXT: orl %ecx, %edx
; NOBMI2-NEXT: andl %edx, %ebx
; NOBMI2-NEXT: andl %r8d, %ebx
; NOBMI2-NEXT: xorl %ebx, %edx
; NOBMI2-NEXT: movzbl %bh, %eax
; NOBMI2-NEXT: orl %edx, %eax
; NOBMI2-NEXT: # kill: def $ax killed $ax killed $eax
; NOBMI2-NEXT: popq %rbx
; NOBMI2-NEXT: retq
%res = call i16 @llvm.pext.i16(i16 %val, i16 %mask)
ret i16 %res
}
define i32 @pext_i32(i32 %val, i32 %mask) nounwind {
; BMI2-LABEL: pext_i32:
; BMI2: # %bb.0:
; BMI2-NEXT: pextl %esi, %edi, %eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_i32:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: movl %esi, %eax
; NOBMI2-NEXT: notl %eax
; NOBMI2-NEXT: leal (,%rax,4), %ecx
; NOBMI2-NEXT: addl %eax, %eax
; NOBMI2-NEXT: xorl %eax, %ecx
; NOBMI2-NEXT: leal (,%rcx,4), %edx
; NOBMI2-NEXT: xorl %ecx, %edx
; NOBMI2-NEXT: movl %edx, %ecx
; NOBMI2-NEXT: shll $4, %ecx
; NOBMI2-NEXT: xorl %edx, %ecx
; NOBMI2-NEXT: movl %ecx, %edx
; NOBMI2-NEXT: shll $8, %edx
; NOBMI2-NEXT: xorl %ecx, %edx
; NOBMI2-NEXT: movl %edx, %ecx
; NOBMI2-NEXT: shll $16, %ecx
; NOBMI2-NEXT: xorl %edx, %ecx
; NOBMI2-NEXT: movl %ecx, %r8d
; NOBMI2-NEXT: notl %r8d
; NOBMI2-NEXT: andl %eax, %r8d
; NOBMI2-NEXT: leal (%r8,%r8), %eax
; NOBMI2-NEXT: xorl %r8d, %eax
; NOBMI2-NEXT: leal (,%rax,4), %edx
; NOBMI2-NEXT: xorl %eax, %edx
; NOBMI2-NEXT: movl %edx, %eax
; NOBMI2-NEXT: shll $4, %eax
; NOBMI2-NEXT: xorl %edx, %eax
; NOBMI2-NEXT: movl %eax, %r9d
; NOBMI2-NEXT: shll $8, %r9d
; NOBMI2-NEXT: xorl %eax, %r9d
; NOBMI2-NEXT: movl %r9d, %edx
; NOBMI2-NEXT: shll $16, %edx
; NOBMI2-NEXT: xorl %r9d, %edx
; NOBMI2-NEXT: movl %edx, %eax
; NOBMI2-NEXT: notl %eax
; NOBMI2-NEXT: andl %r8d, %eax
; NOBMI2-NEXT: leal (%rax,%rax), %r8d
; NOBMI2-NEXT: xorl %eax, %r8d
; NOBMI2-NEXT: leal (,%r8,4), %r9d
; NOBMI2-NEXT: xorl %r8d, %r9d
; NOBMI2-NEXT: movl %r9d, %r8d
; NOBMI2-NEXT: shll $4, %r8d
; NOBMI2-NEXT: xorl %r9d, %r8d
; NOBMI2-NEXT: movl %r8d, %r9d
; NOBMI2-NEXT: shll $8, %r9d
; NOBMI2-NEXT: xorl %r8d, %r9d
; NOBMI2-NEXT: movl %r9d, %r8d
; NOBMI2-NEXT: shll $16, %r8d
; NOBMI2-NEXT: xorl %r9d, %r8d
; NOBMI2-NEXT: movl %r8d, %r10d
; NOBMI2-NEXT: notl %r10d
; NOBMI2-NEXT: andl %eax, %r10d
; NOBMI2-NEXT: leal (%r10,%r10), %eax
; NOBMI2-NEXT: xorl %r10d, %eax
; NOBMI2-NEXT: leal (,%rax,4), %r9d
; NOBMI2-NEXT: xorl %eax, %r9d
; NOBMI2-NEXT: movl %r9d, %eax
; NOBMI2-NEXT: shll $4, %eax
; NOBMI2-NEXT: xorl %r9d, %eax
; NOBMI2-NEXT: movl %eax, %r11d
; NOBMI2-NEXT: shll $8, %r11d
; NOBMI2-NEXT: xorl %eax, %r11d
; NOBMI2-NEXT: movl %r11d, %r9d
; NOBMI2-NEXT: shll $16, %r9d
; NOBMI2-NEXT: xorl %r11d, %r9d
; NOBMI2-NEXT: movl %r9d, %eax
; NOBMI2-NEXT: notl %eax
; NOBMI2-NEXT: andl %r10d, %eax
; NOBMI2-NEXT: leal (%rax,%rax), %r10d
; NOBMI2-NEXT: xorl %eax, %r10d
; NOBMI2-NEXT: leal (,%r10,4), %eax
; NOBMI2-NEXT: xorl %r10d, %eax
; NOBMI2-NEXT: movl %eax, %r10d
; NOBMI2-NEXT: shll $4, %r10d
; NOBMI2-NEXT: xorl %eax, %r10d
; NOBMI2-NEXT: movl %r10d, %eax
; NOBMI2-NEXT: shll $8, %eax
; NOBMI2-NEXT: xorl %r10d, %eax
; NOBMI2-NEXT: movl %eax, %r10d
; NOBMI2-NEXT: shll $16, %r10d
; NOBMI2-NEXT: xorl %eax, %r10d
; NOBMI2-NEXT: andl %esi, %ecx
; NOBMI2-NEXT: andl %esi, %edi
; NOBMI2-NEXT: xorl %ecx, %esi
; NOBMI2-NEXT: movl %ecx, %eax
; NOBMI2-NEXT: shrl %eax
; NOBMI2-NEXT: orl %esi, %eax
; NOBMI2-NEXT: andl %eax, %edx
; NOBMI2-NEXT: xorl %edx, %eax
; NOBMI2-NEXT: movl %edx, %esi
; NOBMI2-NEXT: shrl $2, %esi
; NOBMI2-NEXT: orl %eax, %esi
; NOBMI2-NEXT: andl %esi, %r8d
; NOBMI2-NEXT: xorl %r8d, %esi
; NOBMI2-NEXT: movl %r8d, %r11d
; NOBMI2-NEXT: shrl $4, %r11d
; NOBMI2-NEXT: orl %esi, %r11d
; NOBMI2-NEXT: andl %r11d, %r9d
; NOBMI2-NEXT: xorl %r9d, %r11d
; NOBMI2-NEXT: movl %r9d, %eax
; NOBMI2-NEXT: shrl $8, %eax
; NOBMI2-NEXT: orl %r11d, %eax
; NOBMI2-NEXT: andl %edi, %ecx
; NOBMI2-NEXT: xorl %ecx, %edi
; NOBMI2-NEXT: shrl %ecx
; NOBMI2-NEXT: orl %edi, %ecx
; NOBMI2-NEXT: andl %ecx, %edx
; NOBMI2-NEXT: xorl %edx, %ecx
; NOBMI2-NEXT: shrl $2, %edx
; NOBMI2-NEXT: orl %ecx, %edx
; NOBMI2-NEXT: andl %edx, %r8d
; NOBMI2-NEXT: xorl %r8d, %edx
; NOBMI2-NEXT: shrl $4, %r8d
; NOBMI2-NEXT: orl %edx, %r8d
; NOBMI2-NEXT: andl %r8d, %r9d
; NOBMI2-NEXT: xorl %r9d, %r8d
; NOBMI2-NEXT: shrl $8, %r9d
; NOBMI2-NEXT: orl %r8d, %r9d
; NOBMI2-NEXT: andl %r9d, %eax
; NOBMI2-NEXT: andl %r10d, %eax
; NOBMI2-NEXT: xorl %eax, %r9d
; NOBMI2-NEXT: shrl $16, %eax
; NOBMI2-NEXT: orl %r9d, %eax
; NOBMI2-NEXT: retq
%res = call i32 @llvm.pext.i32(i32 %val, i32 %mask)
ret i32 %res
}
define i64 @pext_i64(i64 %val, i64 %mask) nounwind {
; BMI2-LABEL: pext_i64:
; BMI2: # %bb.0:
; BMI2-NEXT: pextq %rsi, %rdi, %rax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_i64:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: pushq %rbx
; NOBMI2-NEXT: movq %rsi, %rax
; NOBMI2-NEXT: notq %rax
; NOBMI2-NEXT: leaq (,%rax,4), %rcx
; NOBMI2-NEXT: addq %rax, %rax
; NOBMI2-NEXT: xorq %rax, %rcx
; NOBMI2-NEXT: leaq (,%rcx,4), %rdx
; NOBMI2-NEXT: xorq %rcx, %rdx
; NOBMI2-NEXT: movq %rdx, %rcx
; NOBMI2-NEXT: shlq $4, %rcx
; NOBMI2-NEXT: xorq %rdx, %rcx
; NOBMI2-NEXT: movq %rcx, %rdx
; NOBMI2-NEXT: shlq $8, %rdx
; NOBMI2-NEXT: xorq %rcx, %rdx
; NOBMI2-NEXT: movq %rdx, %r8
; NOBMI2-NEXT: shlq $16, %r8
; NOBMI2-NEXT: xorq %rdx, %r8
; NOBMI2-NEXT: movq %r8, %rcx
; NOBMI2-NEXT: shlq $32, %rcx
; NOBMI2-NEXT: xorq %r8, %rcx
; NOBMI2-NEXT: movq %rcx, %r8
; NOBMI2-NEXT: notq %r8
; NOBMI2-NEXT: andq %rax, %r8
; NOBMI2-NEXT: leaq (%r8,%r8), %rax
; NOBMI2-NEXT: xorq %r8, %rax
; NOBMI2-NEXT: leaq (,%rax,4), %rdx
; NOBMI2-NEXT: xorq %rax, %rdx
; NOBMI2-NEXT: movq %rdx, %rax
; NOBMI2-NEXT: shlq $4, %rax
; NOBMI2-NEXT: xorq %rdx, %rax
; NOBMI2-NEXT: movq %rax, %rdx
; NOBMI2-NEXT: shlq $8, %rdx
; NOBMI2-NEXT: xorq %rax, %rdx
; NOBMI2-NEXT: movq %rdx, %rax
; NOBMI2-NEXT: shlq $16, %rax
; NOBMI2-NEXT: xorq %rdx, %rax
; NOBMI2-NEXT: movq %rax, %rdx
; NOBMI2-NEXT: shlq $32, %rdx
; NOBMI2-NEXT: xorq %rax, %rdx
; NOBMI2-NEXT: movq %rdx, %rax
; NOBMI2-NEXT: notq %rax
; NOBMI2-NEXT: andq %r8, %rax
; NOBMI2-NEXT: leaq (%rax,%rax), %r8
; NOBMI2-NEXT: xorq %rax, %r8
; NOBMI2-NEXT: leaq (,%r8,4), %r9
; NOBMI2-NEXT: xorq %r8, %r9
; NOBMI2-NEXT: movq %r9, %r8
; NOBMI2-NEXT: shlq $4, %r8
; NOBMI2-NEXT: xorq %r9, %r8
; NOBMI2-NEXT: movq %r8, %r9
; NOBMI2-NEXT: shlq $8, %r9
; NOBMI2-NEXT: xorq %r8, %r9
; NOBMI2-NEXT: movq %r9, %r10
; NOBMI2-NEXT: shlq $16, %r10
; NOBMI2-NEXT: xorq %r9, %r10
; NOBMI2-NEXT: movq %r10, %r8
; NOBMI2-NEXT: shlq $32, %r8
; NOBMI2-NEXT: xorq %r10, %r8
; NOBMI2-NEXT: movq %r8, %r10
; NOBMI2-NEXT: notq %r10
; NOBMI2-NEXT: andq %rax, %r10
; NOBMI2-NEXT: leaq (%r10,%r10), %rax
; NOBMI2-NEXT: xorq %r10, %rax
; NOBMI2-NEXT: leaq (,%rax,4), %r9
; NOBMI2-NEXT: xorq %rax, %r9
; NOBMI2-NEXT: movq %r9, %rax
; NOBMI2-NEXT: shlq $4, %rax
; NOBMI2-NEXT: xorq %r9, %rax
; NOBMI2-NEXT: movq %rax, %r9
; NOBMI2-NEXT: shlq $8, %r9
; NOBMI2-NEXT: xorq %rax, %r9
; NOBMI2-NEXT: movq %r9, %rax
; NOBMI2-NEXT: shlq $16, %rax
; NOBMI2-NEXT: xorq %r9, %rax
; NOBMI2-NEXT: movq %rax, %r9
; NOBMI2-NEXT: shlq $32, %r9
; NOBMI2-NEXT: xorq %rax, %r9
; NOBMI2-NEXT: movq %r9, %rax
; NOBMI2-NEXT: notq %rax
; NOBMI2-NEXT: andq %r10, %rax
; NOBMI2-NEXT: leaq (%rax,%rax), %r10
; NOBMI2-NEXT: xorq %rax, %r10
; NOBMI2-NEXT: leaq (,%r10,4), %r11
; NOBMI2-NEXT: xorq %r10, %r11
; NOBMI2-NEXT: movq %r11, %r10
; NOBMI2-NEXT: shlq $4, %r10
; NOBMI2-NEXT: xorq %r11, %r10
; NOBMI2-NEXT: movq %r10, %r11
; NOBMI2-NEXT: shlq $8, %r11
; NOBMI2-NEXT: xorq %r10, %r11
; NOBMI2-NEXT: movq %r11, %rbx
; NOBMI2-NEXT: shlq $16, %rbx
; NOBMI2-NEXT: xorq %r11, %rbx
; NOBMI2-NEXT: movq %rbx, %r10
; NOBMI2-NEXT: shlq $32, %r10
; NOBMI2-NEXT: xorq %rbx, %r10
; NOBMI2-NEXT: movq %r10, %r11
; NOBMI2-NEXT: notq %r11
; NOBMI2-NEXT: andq %rax, %r11
; NOBMI2-NEXT: leaq (%r11,%r11), %rax
; NOBMI2-NEXT: xorq %r11, %rax
; NOBMI2-NEXT: leaq (,%rax,4), %r11
; NOBMI2-NEXT: xorq %rax, %r11
; NOBMI2-NEXT: movq %r11, %rax
; NOBMI2-NEXT: shlq $4, %rax
; NOBMI2-NEXT: xorq %r11, %rax
; NOBMI2-NEXT: movq %rax, %r11
; NOBMI2-NEXT: shlq $8, %r11
; NOBMI2-NEXT: xorq %rax, %r11
; NOBMI2-NEXT: movq %r11, %rax
; NOBMI2-NEXT: shlq $16, %rax
; NOBMI2-NEXT: xorq %r11, %rax
; NOBMI2-NEXT: movq %rax, %r11
; NOBMI2-NEXT: shlq $32, %r11
; NOBMI2-NEXT: xorq %rax, %r11
; NOBMI2-NEXT: andq %rsi, %rcx
; NOBMI2-NEXT: andq %rsi, %rdi
; NOBMI2-NEXT: xorq %rcx, %rsi
; NOBMI2-NEXT: movq %rcx, %rax
; NOBMI2-NEXT: shrq %rax
; NOBMI2-NEXT: orq %rsi, %rax
; NOBMI2-NEXT: andq %rax, %rdx
; NOBMI2-NEXT: xorq %rdx, %rax
; NOBMI2-NEXT: movq %rdx, %rsi
; NOBMI2-NEXT: shrq $2, %rsi
; NOBMI2-NEXT: orq %rax, %rsi
; NOBMI2-NEXT: andq %rsi, %r8
; NOBMI2-NEXT: xorq %r8, %rsi
; NOBMI2-NEXT: movq %r8, %rax
; NOBMI2-NEXT: shrq $4, %rax
; NOBMI2-NEXT: orq %rsi, %rax
; NOBMI2-NEXT: andq %rax, %r9
; NOBMI2-NEXT: xorq %r9, %rax
; NOBMI2-NEXT: movq %r9, %rsi
; NOBMI2-NEXT: shrq $8, %rsi
; NOBMI2-NEXT: orq %rax, %rsi
; NOBMI2-NEXT: andq %rsi, %r10
; NOBMI2-NEXT: xorq %r10, %rsi
; NOBMI2-NEXT: movq %r10, %rax
; NOBMI2-NEXT: shrq $16, %rax
; NOBMI2-NEXT: orq %rsi, %rax
; NOBMI2-NEXT: andq %rdi, %rcx
; NOBMI2-NEXT: xorq %rcx, %rdi
; NOBMI2-NEXT: shrq %rcx
; NOBMI2-NEXT: orq %rdi, %rcx
; NOBMI2-NEXT: andq %rcx, %rdx
; NOBMI2-NEXT: xorq %rdx, %rcx
; NOBMI2-NEXT: shrq $2, %rdx
; NOBMI2-NEXT: orq %rcx, %rdx
; NOBMI2-NEXT: andq %rdx, %r8
; NOBMI2-NEXT: xorq %r8, %rdx
; NOBMI2-NEXT: shrq $4, %r8
; NOBMI2-NEXT: orq %rdx, %r8
; NOBMI2-NEXT: andq %r8, %r9
; NOBMI2-NEXT: xorq %r9, %r8
; NOBMI2-NEXT: shrq $8, %r9
; NOBMI2-NEXT: orq %r8, %r9
; NOBMI2-NEXT: andq %r9, %r10
; NOBMI2-NEXT: xorq %r10, %r9
; NOBMI2-NEXT: shrq $16, %r10
; NOBMI2-NEXT: orq %r9, %r10
; NOBMI2-NEXT: andq %r10, %rax
; NOBMI2-NEXT: andq %r11, %rax
; NOBMI2-NEXT: xorq %rax, %r10
; NOBMI2-NEXT: shrq $32, %rax
; NOBMI2-NEXT: orq %r10, %rax
; NOBMI2-NEXT: popq %rbx
; NOBMI2-NEXT: retq
%res = call i64 @llvm.pext.i64(i64 %val, i64 %mask)
ret i64 %res
}
define i32 @pext_mask_zero(i32 %val) nounwind {
; BMI2-LABEL: pext_mask_zero:
; BMI2: # %bb.0:
; BMI2-NEXT: xorl %eax, %eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_mask_zero:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: xorl %eax, %eax
; NOBMI2-NEXT: retq
%res = call i32 @llvm.pext.i32(i32 %val, i32 0)
ret i32 %res
}
define i32 @pext_mask_allones(i32 %val) nounwind {
; BMI2-LABEL: pext_mask_allones:
; BMI2: # %bb.0:
; BMI2-NEXT: movl %edi, %eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_mask_allones:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: movl %edi, %eax
; NOBMI2-NEXT: retq
%res = call i32 @llvm.pext.i32(i32 %val, i32 -1)
ret i32 %res
}
define i32 @pext_const_fold() nounwind {
; BMI2-LABEL: pext_const_fold:
; BMI2: # %bb.0:
; BMI2-NEXT: movl $10, %eax
; BMI2-NEXT: retq
;
; NOBMI2-LABEL: pext_const_fold:
; NOBMI2: # %bb.0:
; NOBMI2-NEXT: movl $10, %eax
; NOBMI2-NEXT: retq
%res = call i32 @llvm.pext.i32(i32 170, i32 204)
ret i32 %res
}