1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbkb -emit-llvm %s -o - \
// RUN: -disable-O0-optnone | opt -S -passes=mem2reg \
// RUN: | FileCheck %s -check-prefix=RV32ZBKB
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbkb -emit-llvm %s -o - \
// RUN: -disable-O0-optnone | opt -S -passes=mem2reg \
// RUN: | FileCheck %s -check-prefix=RV64ZBKB
#include <riscv_bitmanip.h>
// RV32ZBKB-LABEL: @brev8_32(
// RV32ZBKB-NEXT: entry:
// RV32ZBKB-NEXT: [[TMP0:%.*]] = call i32 @llvm.riscv.brev8.i32(i32 [[RS1:%.*]])
// RV32ZBKB-NEXT: ret i32 [[TMP0]]
//
// RV64ZBKB-LABEL: @brev8_32(
// RV64ZBKB-NEXT: entry:
// RV64ZBKB-NEXT: [[TMP0:%.*]] = call i32 @llvm.riscv.brev8.i32(i32 [[RS1:%.*]])
// RV64ZBKB-NEXT: ret i32 [[TMP0]]
//
uint32_t brev8_32(uint32_t rs1)
{
return __riscv_brev8_32(rs1);
}
#if __riscv_xlen == 64
// RV64ZBKB-LABEL: @brev8_64(
// RV64ZBKB-NEXT: entry:
// RV64ZBKB-NEXT: [[TMP0:%.*]] = call i64 @llvm.riscv.brev8.i64(i64 [[RS1:%.*]])
// RV64ZBKB-NEXT: ret i64 [[TMP0]]
//
uint64_t brev8_64(uint64_t rs1)
{
return __riscv_brev8_64(rs1);
}
#endif
#if __riscv_xlen == 32
// RV32ZBKB-LABEL: @zip(
// RV32ZBKB-NEXT: entry:
// RV32ZBKB-NEXT: [[TMP0:%.*]] = call i32 @llvm.riscv.zip.i32(i32 [[RS1:%.*]])
// RV32ZBKB-NEXT: ret i32 [[TMP0]]
//
uint32_t zip(uint32_t rs1)
{
return __riscv_zip_32(rs1);
}
// RV32ZBKB-LABEL: @unzip(
// RV32ZBKB-NEXT: entry:
// RV32ZBKB-NEXT: [[TMP0:%.*]] = call i32 @llvm.riscv.unzip.i32(i32 [[RS1:%.*]])
// RV32ZBKB-NEXT: ret i32 [[TMP0]]
//
uint32_t unzip(uint32_t rs1)
{
return __riscv_unzip_32(rs1);
}
#endif
|