Compiler projects using llvm
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -no-opaque-pointers -triple riscv64 -target-feature +zbkc -emit-llvm %s -o - \
// RUN:     | FileCheck %s  -check-prefix=RV64ZBKC

// RV64ZBKC-LABEL: @clmul(
// RV64ZBKC-NEXT:  entry:
// RV64ZBKC-NEXT:    [[A_ADDR:%.*]] = alloca i64, align 8
// RV64ZBKC-NEXT:    [[B_ADDR:%.*]] = alloca i64, align 8
// RV64ZBKC-NEXT:    store i64 [[A:%.*]], i64* [[A_ADDR]], align 8
// RV64ZBKC-NEXT:    store i64 [[B:%.*]], i64* [[B_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP0:%.*]] = load i64, i64* [[A_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP1:%.*]] = load i64, i64* [[B_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP2:%.*]] = call i64 @llvm.riscv.clmul.i64(i64 [[TMP0]], i64 [[TMP1]])
// RV64ZBKC-NEXT:    ret i64 [[TMP2]]
//
long clmul(long a, long b) {
  return __builtin_riscv_clmul(a, b);
}

// RV64ZBKC-LABEL: @clmulh(
// RV64ZBKC-NEXT:  entry:
// RV64ZBKC-NEXT:    [[A_ADDR:%.*]] = alloca i64, align 8
// RV64ZBKC-NEXT:    [[B_ADDR:%.*]] = alloca i64, align 8
// RV64ZBKC-NEXT:    store i64 [[A:%.*]], i64* [[A_ADDR]], align 8
// RV64ZBKC-NEXT:    store i64 [[B:%.*]], i64* [[B_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP0:%.*]] = load i64, i64* [[A_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP1:%.*]] = load i64, i64* [[B_ADDR]], align 8
// RV64ZBKC-NEXT:    [[TMP2:%.*]] = call i64 @llvm.riscv.clmulh.i64(i64 [[TMP0]], i64 [[TMP1]])
// RV64ZBKC-NEXT:    ret i64 [[TMP2]]
//
long clmulh(long a, long b) {
  return __builtin_riscv_clmulh(a, b);
}