1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+tbm | FileCheck %s --check-prefix=X64
4 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/tbm-builtins.c
6 define i64 @test__bextri_u64(i64 %a0) {
7 ; X64-LABEL: test__bextri_u64:
9 ; X64-NEXT: bextrq $3841, %rdi, %rax # imm = 0xF01
11 %1 = call i64 @llvm.x86.tbm.bextri.u64(i64 %a0, i64 3841)
15 define i64 @test__blcfill_u64(i64 %a0) {
16 ; X64-LABEL: test__blcfill_u64:
18 ; X64-NEXT: leaq 1(%rdi), %rax
19 ; X64-NEXT: andq %rdi, %rax
26 define i64 @test__blci_u64(i64 %a0) {
27 ; X64-LABEL: test__blci_u64:
29 ; X64-NEXT: leaq 1(%rdi), %rax
30 ; X64-NEXT: xorq $-1, %rax
31 ; X64-NEXT: orq %rdi, %rax
39 define i64 @test__blcic_u64(i64 %a0) {
40 ; X64-LABEL: test__blcic_u64:
42 ; X64-NEXT: movq %rdi, %rax
43 ; X64-NEXT: movq %rdi, %rcx
44 ; X64-NEXT: xorq $-1, %rcx
45 ; X64-NEXT: addq $1, %rax
46 ; X64-NEXT: andq %rcx, %rax
54 define i64 @test__blcmsk_u64(i64 %a0) {
55 ; X64-LABEL: test__blcmsk_u64:
57 ; X64-NEXT: leaq 1(%rdi), %rax
58 ; X64-NEXT: xorq %rdi, %rax
65 define i64 @test__blcs_u64(i64 %a0) {
66 ; X64-LABEL: test__blcs_u64:
68 ; X64-NEXT: leaq 1(%rdi), %rax
69 ; X64-NEXT: orq %rdi, %rax
76 define i64 @test__blsfill_u64(i64 %a0) {
77 ; X64-LABEL: test__blsfill_u64:
79 ; X64-NEXT: movq %rdi, %rax
80 ; X64-NEXT: subq $1, %rax
81 ; X64-NEXT: orq %rdi, %rax
88 define i64 @test__blsic_u64(i64 %a0) {
89 ; X64-LABEL: test__blsic_u64:
91 ; X64-NEXT: movq %rdi, %rax
92 ; X64-NEXT: movq %rdi, %rcx
93 ; X64-NEXT: xorq $-1, %rcx
94 ; X64-NEXT: subq $1, %rax
95 ; X64-NEXT: orq %rcx, %rax
103 define i64 @test__t1mskc_u64(i64 %a0) {
104 ; X64-LABEL: test__t1mskc_u64:
106 ; X64-NEXT: movq %rdi, %rax
107 ; X64-NEXT: movq %rdi, %rcx
108 ; X64-NEXT: xorq $-1, %rcx
109 ; X64-NEXT: addq $1, %rax
110 ; X64-NEXT: orq %rcx, %rax
118 define i64 @test__tzmsk_u64(i64 %a0) {
119 ; X64-LABEL: test__tzmsk_u64:
121 ; X64-NEXT: movq %rdi, %rax
122 ; X64-NEXT: movq %rdi, %rcx
123 ; X64-NEXT: xorq $-1, %rcx
124 ; X64-NEXT: subq $1, %rax
125 ; X64-NEXT: andq %rcx, %rax
133 declare i64 @llvm.x86.tbm.bextri.u64(i64, i64)