1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefixes=RV64I
4 ; RUN: llc -mtriple=riscv64 -mattr=+xtheadbs -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s -check-prefixes=RV64XTHEADBS
7 define signext i32 @th_tst_i32(i32 signext %a) nounwind {
8 ; RV64I-LABEL: th_tst_i32:
10 ; RV64I-NEXT: slli a0, a0, 58
11 ; RV64I-NEXT: srli a0, a0, 63
14 ; RV64XTHEADBS-LABEL: th_tst_i32:
15 ; RV64XTHEADBS: # %bb.0:
16 ; RV64XTHEADBS-NEXT: th.tst a0, a0, 5
17 ; RV64XTHEADBS-NEXT: ret
19 %and = and i32 %shr, 1
23 define i64 @the_tst_i64(i64 %a) nounwind {
24 ; RV64I-LABEL: the_tst_i64:
26 ; RV64I-NEXT: slli a0, a0, 58
27 ; RV64I-NEXT: srli a0, a0, 63
30 ; RV64XTHEADBS-LABEL: the_tst_i64:
31 ; RV64XTHEADBS: # %bb.0:
32 ; RV64XTHEADBS-NEXT: th.tst a0, a0, 5
33 ; RV64XTHEADBS-NEXT: ret
35 %and = and i64 %shr, 1
39 define signext i32 @th_tst_i32_cmp(i32 signext %a) nounwind {
40 ; RV64I-LABEL: th_tst_i32_cmp:
42 ; RV64I-NEXT: slli a0, a0, 58
43 ; RV64I-NEXT: srli a0, a0, 63
46 ; RV64XTHEADBS-LABEL: th_tst_i32_cmp:
47 ; RV64XTHEADBS: # %bb.0:
48 ; RV64XTHEADBS-NEXT: th.tst a0, a0, 5
49 ; RV64XTHEADBS-NEXT: ret
51 %cmp = icmp ne i32 %and, 0
52 %zext = zext i1 %cmp to i32
56 define i64 @th_tst_i64_cmp(i64 %a) nounwind {
57 ; RV64I-LABEL: th_tst_i64_cmp:
59 ; RV64I-NEXT: slli a0, a0, 58
60 ; RV64I-NEXT: srli a0, a0, 63
63 ; RV64XTHEADBS-LABEL: th_tst_i64_cmp:
64 ; RV64XTHEADBS: # %bb.0:
65 ; RV64XTHEADBS-NEXT: th.tst a0, a0, 5
66 ; RV64XTHEADBS-NEXT: ret
68 %cmp = icmp ne i64 %and, 0
69 %zext = zext i1 %cmp to i64