1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+experimental-zbt -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV64ZBT
5 declare i32 @llvm.riscv.fsl.i32(i32, i32, i32)
7 define i32 @fsl_i32(i32 %a, i32 %b, i32 %c) nounwind {
8 ; RV64ZBT-LABEL: fsl_i32:
10 ; RV64ZBT-NEXT: fslw a0, a0, a1, a2
12 %1 = call i32 @llvm.riscv.fsl.i32(i32 %a, i32 %b, i32 %c)
16 define i32 @fsl_i32_demandedbits(i32 %a, i32 %b, i32 %c) nounwind {
17 ; RV64ZBT-LABEL: fsl_i32_demandedbits:
19 ; RV64ZBT-NEXT: andi a1, a1, 31
20 ; RV64ZBT-NEXT: fslw a0, a0, a1, a2
22 %bmask = and i32 %b, 95
23 %1 = call i32 @llvm.riscv.fsl.i32(i32 %a, i32 %bmask, i32 %c)
27 declare i32 @llvm.riscv.fsr.i32(i32, i32, i32)
29 define i32 @fsr_i32(i32 %a, i32 %b, i32 %c) nounwind {
30 ; RV64ZBT-LABEL: fsr_i32:
32 ; RV64ZBT-NEXT: fsrw a0, a0, a1, a2
34 %1 = call i32 @llvm.riscv.fsr.i32(i32 %a, i32 %b, i32 %c)
38 define i32 @fsr_i32_demandedbits(i32 %a, i32 %b, i32 %c) nounwind {
39 ; RV64ZBT-LABEL: fsr_i32_demandedbits:
41 ; RV64ZBT-NEXT: andi a1, a1, 31
42 ; RV64ZBT-NEXT: fsrw a0, a0, a1, a2
44 %bmask = and i32 %b, 95
45 %1 = call i32 @llvm.riscv.fsr.i32(i32 %a, i32 %bmask, i32 %c)
49 define i32 @fsli_i32(i32 %a, i32 %b) nounwind {
50 ; RV64ZBT-LABEL: fsli_i32:
52 ; RV64ZBT-NEXT: fsriw a0, a1, a0, 27
54 %1 = call i32 @llvm.riscv.fsl.i32(i32 %a, i32 %b, i32 5)
58 define i32 @fsri_i32(i32 %a, i32 %b) nounwind {
59 ; RV64ZBT-LABEL: fsri_i32:
61 ; RV64ZBT-NEXT: fsriw a0, a0, a1, 15
63 %1 = call i32 @llvm.riscv.fsr.i32(i32 %a, i32 %b, i32 15)
67 declare i64 @llvm.riscv.fsl.i64(i64, i64, i64)
69 define i64 @fsl_i64(i64 %a, i64 %b, i64 %c) nounwind {
70 ; RV64ZBT-LABEL: fsl_i64:
72 ; RV64ZBT-NEXT: fsl a0, a0, a1, a2
74 %1 = call i64 @llvm.riscv.fsl.i64(i64 %a, i64 %b, i64 %c)
78 define i64 @fsl_i64_demandedbits(i64 %a, i64 %b, i64 %c) nounwind {
79 ; RV64ZBT-LABEL: fsl_i64_demandedbits:
81 ; RV64ZBT-NEXT: andi a1, a1, 63
82 ; RV64ZBT-NEXT: fsl a0, a0, a1, a2
84 %bmask = and i64 %b, 191
85 %1 = call i64 @llvm.riscv.fsl.i64(i64 %a, i64 %bmask, i64 %c)
89 declare i64 @llvm.riscv.fsr.i64(i64, i64, i64)
91 define i64 @fsr_i64(i64 %a, i64 %b, i64 %c) nounwind {
92 ; RV64ZBT-LABEL: fsr_i64:
94 ; RV64ZBT-NEXT: fsr a0, a0, a1, a2
96 %1 = call i64 @llvm.riscv.fsr.i64(i64 %a, i64 %b, i64 %c)
100 define i64 @fsr_i64_demandedbits(i64 %a, i64 %b, i64 %c) nounwind {
101 ; RV64ZBT-LABEL: fsr_i64_demandedbits:
103 ; RV64ZBT-NEXT: andi a1, a1, 63
104 ; RV64ZBT-NEXT: fsr a0, a0, a1, a2
106 %bmask = and i64 %b, 191
107 %1 = call i64 @llvm.riscv.fsr.i64(i64 %a, i64 %bmask, i64 %c)
111 define i64 @fsli_i64(i64 %a, i64 %b) nounwind {
112 ; RV64ZBT-LABEL: fsli_i64:
114 ; RV64ZBT-NEXT: fsri a0, a1, a0, 49
116 %1 = call i64 @llvm.riscv.fsl.i64(i64 %a, i64 %b, i64 15)
120 define i64 @fsri_i64(i64 %a, i64 %b) nounwind {
121 ; RV64ZBT-LABEL: fsri_i64:
123 ; RV64ZBT-NEXT: fsri a0, a0, a1, 5
125 %1 = call i64 @llvm.riscv.fsr.i64(i64 %a, i64 %b, i64 5)