llvm-project/llvm/test/CodeGen/X86/bmi2.ll

100 lines
2.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+bmi,+bmi2 | FileCheck %s
define i32 @bzhi32(i32 %x, i32 %y) {
; CHECK-LABEL: bzhi32:
; CHECK: # %bb.0:
; CHECK-NEXT: bzhil %esi, %edi, %eax
; CHECK-NEXT: retq
%tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x, i32 %y)
ret i32 %tmp
}
define i32 @bzhi32_load(i32* %x, i32 %y) {
; CHECK-LABEL: bzhi32_load:
; CHECK: # %bb.0:
; CHECK-NEXT: bzhil %esi, (%rdi), %eax
; CHECK-NEXT: retq
%x1 = load i32, i32* %x
%tmp = tail call i32 @llvm.x86.bmi.bzhi.32(i32 %x1, i32 %y)
ret i32 %tmp
}
declare i32 @llvm.x86.bmi.bzhi.32(i32, i32)
define i64 @bzhi64(i64 %x, i64 %y) {
; CHECK-LABEL: bzhi64:
; CHECK: # %bb.0:
; CHECK-NEXT: bzhiq %rsi, %rdi, %rax
; CHECK-NEXT: retq
%tmp = tail call i64 @llvm.x86.bmi.bzhi.64(i64 %x, i64 %y)
ret i64 %tmp
}
declare i64 @llvm.x86.bmi.bzhi.64(i64, i64)
define i32 @pdep32(i32 %x, i32 %y) {
; CHECK-LABEL: pdep32:
; CHECK: # %bb.0:
; CHECK-NEXT: pdepl %esi, %edi, %eax
; CHECK-NEXT: retq
%tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y)
ret i32 %tmp
}
define i32 @pdep32_load(i32 %x, i32* %y) {
; CHECK-LABEL: pdep32_load:
; CHECK: # %bb.0:
; CHECK-NEXT: pdepl (%rsi), %edi, %eax
; CHECK-NEXT: retq
%y1 = load i32, i32* %y
%tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y1)
ret i32 %tmp
}
declare i32 @llvm.x86.bmi.pdep.32(i32, i32)
define i64 @pdep64(i64 %x, i64 %y) {
; CHECK-LABEL: pdep64:
; CHECK: # %bb.0:
; CHECK-NEXT: pdepq %rsi, %rdi, %rax
; CHECK-NEXT: retq
%tmp = tail call i64 @llvm.x86.bmi.pdep.64(i64 %x, i64 %y)
ret i64 %tmp
}
declare i64 @llvm.x86.bmi.pdep.64(i64, i64)
define i32 @pext32(i32 %x, i32 %y) {
; CHECK-LABEL: pext32:
; CHECK: # %bb.0:
; CHECK-NEXT: pextl %esi, %edi, %eax
; CHECK-NEXT: retq
%tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y)
ret i32 %tmp
}
define i32 @pext32_load(i32 %x, i32* %y) {
; CHECK-LABEL: pext32_load:
; CHECK: # %bb.0:
; CHECK-NEXT: pextl (%rsi), %edi, %eax
; CHECK-NEXT: retq
%y1 = load i32, i32* %y
%tmp = tail call i32 @llvm.x86.bmi.pext.32(i32 %x, i32 %y1)
ret i32 %tmp
}
declare i32 @llvm.x86.bmi.pext.32(i32, i32)
define i64 @pext64(i64 %x, i64 %y) {
; CHECK-LABEL: pext64:
; CHECK: # %bb.0:
; CHECK-NEXT: pextq %rsi, %rdi, %rax
; CHECK-NEXT: retq
%tmp = tail call i64 @llvm.x86.bmi.pext.64(i64 %x, i64 %y)
ret i64 %tmp
}
declare i64 @llvm.x86.bmi.pext.64(i64, i64)