2017-08-13 19:56:15 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=+tbm < %s | FileCheck %s
|
2013-09-28 02:38:42 +08:00
|
|
|
|
|
|
|
define i32 @test_x86_tbm_bextri_u32(i32 %a) nounwind readnone {
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrl $2814, %edi, %eax # imm = 0xAFE
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-09-28 02:38:42 +08:00
|
|
|
entry:
|
|
|
|
%0 = tail call i32 @llvm.x86.tbm.bextri.u32(i32 %a, i32 2814)
|
|
|
|
ret i32 %0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @llvm.x86.tbm.bextri.u32(i32, i32) nounwind readnone
|
|
|
|
|
|
|
|
define i32 @test_x86_tbm_bextri_u32_m(i32* nocapture %a) nounwind readonly {
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u32_m:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrl $2814, (%rdi), %eax # imm = 0xAFE
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-09-28 02:38:42 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load i32, i32* %a, align 4
|
2013-09-28 02:38:42 +08:00
|
|
|
%0 = tail call i32 @llvm.x86.tbm.bextri.u32(i32 %tmp1, i32 2814)
|
|
|
|
ret i32 %0
|
|
|
|
}
|
|
|
|
|
2017-08-13 20:16:00 +08:00
|
|
|
define i32 @test_x86_tbm_bextri_u32_z(i32 %a, i32 %b) nounwind readonly {
|
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u32_z:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrl $2814, %edi, %eax # imm = 0xAFE
|
2017-08-13 20:16:00 +08:00
|
|
|
; CHECK-NEXT: cmovel %esi, %eax
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%0 = tail call i32 @llvm.x86.tbm.bextri.u32(i32 %a, i32 2814)
|
|
|
|
%1 = icmp eq i32 %0, 0
|
|
|
|
%2 = select i1 %1, i32 %b, i32 %0
|
|
|
|
ret i32 %2
|
|
|
|
}
|
|
|
|
|
2013-09-28 02:38:42 +08:00
|
|
|
define i64 @test_x86_tbm_bextri_u64(i64 %a) nounwind readnone {
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u64:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrq $2814, %rdi, %rax # imm = 0xAFE
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-09-28 02:38:42 +08:00
|
|
|
entry:
|
2013-10-03 12:16:45 +08:00
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 2814)
|
2013-09-28 02:38:42 +08:00
|
|
|
ret i64 %0
|
|
|
|
}
|
|
|
|
|
2013-10-03 12:16:45 +08:00
|
|
|
declare i64 @llvm.x86.tbm.bextri.u64(i64, i64) nounwind readnone
|
2013-09-28 02:38:42 +08:00
|
|
|
|
|
|
|
define i64 @test_x86_tbm_bextri_u64_m(i64* nocapture %a) nounwind readonly {
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u64_m:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrq $2814, (%rdi), %rax # imm = 0xAFE
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-09-28 02:38:42 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp1 = load i64, i64* %a, align 8
|
2013-10-03 12:16:45 +08:00
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %tmp1, i64 2814)
|
2013-09-28 02:38:42 +08:00
|
|
|
ret i64 %0
|
|
|
|
}
|
2017-08-13 20:16:00 +08:00
|
|
|
|
|
|
|
define i64 @test_x86_tbm_bextri_u64_z(i64 %a, i64 %b) nounwind readnone {
|
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u64_z:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2018-01-12 14:21:36 +08:00
|
|
|
; CHECK-NEXT: bextrq $2814, %rdi, %rax # imm = 0xAFE
|
2017-08-13 20:16:00 +08:00
|
|
|
; CHECK-NEXT: cmoveq %rsi, %rax
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 2814)
|
|
|
|
%1 = icmp eq i64 %0, 0
|
|
|
|
%2 = select i1 %1, i64 %b, i64 %0
|
|
|
|
ret i64 %2
|
|
|
|
}
|