2017-08-13 19:56:15 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2018-06-03 21:38:52 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+tbm | FileCheck %s
|
2017-08-13 20:16:00 +08:00
|
|
|
|
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-06-04 02:15:06 +08:00
|
|
|
; CHECK-NEXT: bextrq $3841, %rdi, %rax # imm = 0xF01
|
2017-08-13 19:56:15 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-09-28 02:38:42 +08:00
|
|
|
entry:
|
2018-06-04 02:15:06 +08:00
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 3841)
|
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-06-04 02:15:06 +08:00
|
|
|
; CHECK-NEXT: bextrq $3841, (%rdi), %rax # imm = 0xF01
|
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
|
2018-06-04 02:15:06 +08:00
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %tmp1, i64 3841)
|
2013-09-28 02:38:42 +08:00
|
|
|
ret i64 %0
|
|
|
|
}
|
2017-08-13 20:16:00 +08:00
|
|
|
|
2018-06-06 18:52:10 +08:00
|
|
|
define i64 @test_x86_tbm_bextri_u64_bigint(i64 %a) nounwind readnone {
|
|
|
|
; CHECK-LABEL: test_x86_tbm_bextri_u64_bigint:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: bextrq $65535, %rdi, %rax # imm = 0xFFFF
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 549755813887)
|
|
|
|
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-06-04 02:15:06 +08:00
|
|
|
; CHECK-NEXT: bextrq $3841, %rdi, %rax # imm = 0xF01
|
2017-08-13 20:16:00 +08:00
|
|
|
; CHECK-NEXT: cmoveq %rsi, %rax
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
entry:
|
2018-06-04 02:15:06 +08:00
|
|
|
%0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 3841)
|
2017-08-13 20:16:00 +08:00
|
|
|
%1 = icmp eq i64 %0, 0
|
|
|
|
%2 = select i1 %1, i64 %b, i64 %0
|
|
|
|
ret i64 %2
|
|
|
|
}
|