1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+zbkb -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s -check-prefix=RV32ZBKB
5 declare i32 @llvm.riscv.brev8(i32);
7 define i32 @brev8(i32 %a) nounwind {
8 ; RV32ZBKB-LABEL: brev8:
10 ; RV32ZBKB-NEXT: brev8 a0, a0
12 %val = call i32 @llvm.riscv.brev8(i32 %a)
16 ; Test that rev8 is recognized as preserving zero extension.
17 define zeroext i16 @brev8_knownbits(i16 zeroext %a) nounwind {
18 ; RV32ZBKB-LABEL: brev8_knownbits:
20 ; RV32ZBKB-NEXT: brev8 a0, a0
22 %zext = zext i16 %a to i32
23 %val = call i32 @llvm.riscv.brev8(i32 %zext)
24 %trunc = trunc i32 %val to i16
28 declare i32 @llvm.bswap.i32(i32)
30 define i32 @rev8_i32(i32 %a) nounwind {
31 ; RV32ZBKB-LABEL: rev8_i32:
33 ; RV32ZBKB-NEXT: rev8 a0, a0
35 %1 = tail call i32 @llvm.bswap.i32(i32 %a)
39 declare i32 @llvm.riscv.zip(i32);
41 define i32 @zip(i32 %a) nounwind {
42 ; RV32ZBKB-LABEL: zip:
44 ; RV32ZBKB-NEXT: zip a0, a0
46 %val = call i32 @llvm.riscv.zip(i32 %a)
50 declare i32 @llvm.riscv.unzip(i32);
52 define i32 @unzip(i32 %a) nounwind {
53 ; RV32ZBKB-LABEL: unzip:
55 ; RV32ZBKB-NEXT: unzip a0, a0
57 %val = call i32 @llvm.riscv.unzip(i32 %a)