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 3 4define 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 8; CHECK-NEXT: retq 9entry: 10 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 3841) 11 ret i64 %0 12} 13 14declare i64 @llvm.x86.tbm.bextri.u64(i64, i64) nounwind readnone 15 16define i64 @test_x86_tbm_bextri_u64_m(i64* 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 20; CHECK-NEXT: retq 21entry: 22 %tmp1 = load i64, i64* %a, align 8 23 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %tmp1, i64 3841) 24 ret i64 %0 25} 26 27define 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 31; CHECK-NEXT: retq 32entry: 33 %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 549755813887) 34 ret i64 %0 35} 36 37define 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 42; CHECK-NEXT: retq 43entry: 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 47 ret i64 %2 48} 49