1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-b -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV64B
4 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbe -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s -check-prefix=RV64ZBE
7 declare i32 @llvm.riscv.bcompress.i32(i32 %a, i32 %b)
9 define signext i32 @bcompress32(i32 signext %a, i32 signext %b) nounwind {
10 ; RV64B-LABEL: bcompress32:
12 ; RV64B-NEXT: bcompressw a0, a0, a1
15 ; RV64ZBE-LABEL: bcompress32:
17 ; RV64ZBE-NEXT: bcompressw a0, a0, a1
19 %tmp = call i32 @llvm.riscv.bcompress.i32(i32 %a, i32 %b)
23 define signext i32 @bcompress32_demandedbits(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
24 ; RV64B-LABEL: bcompress32_demandedbits:
26 ; RV64B-NEXT: add a0, a0, a1
27 ; RV64B-NEXT: add a1, a2, a3
28 ; RV64B-NEXT: bcompressw a0, a0, a1
31 ; RV64ZBE-LABEL: bcompress32_demandedbits:
33 ; RV64ZBE-NEXT: add a0, a0, a1
34 ; RV64ZBE-NEXT: add a1, a2, a3
35 ; RV64ZBE-NEXT: bcompressw a0, a0, a1
39 %tmp = call i32 @llvm.riscv.bcompress.i32(i32 %e, i32 %f)
43 declare i32 @llvm.riscv.bdecompress.i32(i32 %a, i32 %b)
45 define signext i32 @bdecompress32(i32 signext %a, i32 signext %b) nounwind {
46 ; RV64B-LABEL: bdecompress32:
48 ; RV64B-NEXT: bdecompressw a0, a0, a1
51 ; RV64ZBE-LABEL: bdecompress32:
53 ; RV64ZBE-NEXT: bdecompressw a0, a0, a1
55 %tmp = call i32 @llvm.riscv.bdecompress.i32(i32 %a, i32 %b)
59 define signext i32 @bdecompress32_demandedbits(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d) nounwind {
60 ; RV64B-LABEL: bdecompress32_demandedbits:
62 ; RV64B-NEXT: add a0, a0, a1
63 ; RV64B-NEXT: add a1, a2, a3
64 ; RV64B-NEXT: bdecompressw a0, a0, a1
67 ; RV64ZBE-LABEL: bdecompress32_demandedbits:
69 ; RV64ZBE-NEXT: add a0, a0, a1
70 ; RV64ZBE-NEXT: add a1, a2, a3
71 ; RV64ZBE-NEXT: bdecompressw a0, a0, a1
75 %tmp = call i32 @llvm.riscv.bdecompress.i32(i32 %e, i32 %f)
79 declare i64 @llvm.riscv.bcompress.i64(i64 %a, i64 %b)
81 define i64 @bcompress64(i64 %a, i64 %b) nounwind {
82 ; RV64B-LABEL: bcompress64:
84 ; RV64B-NEXT: bcompress a0, a0, a1
87 ; RV64ZBE-LABEL: bcompress64:
89 ; RV64ZBE-NEXT: bcompress a0, a0, a1
91 %tmp = call i64 @llvm.riscv.bcompress.i64(i64 %a, i64 %b)
95 declare i64 @llvm.riscv.bdecompress.i64(i64 %a, i64 %b)
97 define i64 @bdecompress64(i64 %a, i64 %b) nounwind {
98 ; RV64B-LABEL: bdecompress64:
100 ; RV64B-NEXT: bdecompress a0, a0, a1
103 ; RV64ZBE-LABEL: bdecompress64:
105 ; RV64ZBE-NEXT: bdecompress a0, a0, a1
107 %tmp = call i64 @llvm.riscv.bdecompress.i64(i64 %a, i64 %b)