1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+tbm | FileCheck %s
4 define i64 @test_x86_tbm_bextri_u64(i64 %a) nounwind readnone {
5 ; CHECK-LABEL: test_x86_tbm_bextri_u64:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: bextrq $3841, %rdi, %rax # imm = 0xF01
10 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 3841)
14 declare i64 @llvm.x86.tbm.bextri.u64(i64, i64) nounwind readnone
16 define i64 @test_x86_tbm_bextri_u64_m(ptr nocapture %a) nounwind readonly {
17 ; CHECK-LABEL: test_x86_tbm_bextri_u64_m:
18 ; CHECK: # %bb.0: # %entry
19 ; CHECK-NEXT: bextrq $3841, (%rdi), %rax # imm = 0xF01
22 %tmp1 = load i64, ptr %a, align 8
23 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %tmp1, i64 3841)
27 define i64 @test_x86_tbm_bextri_u64_bigint(i64 %a) nounwind readnone {
28 ; CHECK-LABEL: test_x86_tbm_bextri_u64_bigint:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: bextrq $65535, %rdi, %rax # imm = 0xFFFF
33 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 549755813887)
37 define i64 @test_x86_tbm_bextri_u64_z(i64 %a, i64 %b) nounwind readnone {
38 ; CHECK-LABEL: test_x86_tbm_bextri_u64_z:
39 ; CHECK: # %bb.0: # %entry
40 ; CHECK-NEXT: bextrq $3841, %rdi, %rax # imm = 0xF01
41 ; CHECK-NEXT: cmoveq %rsi, %rax
44 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 3841)
45 %1 = icmp eq i64 %0, 0
46 %2 = select i1 %1, i64 %b, i64 %0