// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -no-opaque-pointers -triple riscv64 -target-feature +experimental-zbt -emit-llvm %s -o - \
// RUN: | FileCheck %s -check-prefix=RV64ZBT
// RV64ZBT-LABEL: @fsl(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: [[RS3_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: store i32 [[RS3:%.*]], i32* [[RS3_ADDR]], align 4
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV1:%.*]] = sext i32 [[TMP1]] to i64
// RV64ZBT-NEXT: [[TMP2:%.*]] = load i32, i32* [[RS3_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV2:%.*]] = sext i32 [[TMP2]] to i64
// RV64ZBT-NEXT: [[TMP3:%.*]] = call i64 @llvm.riscv.fsl.i64(i64 [[CONV]], i64 [[CONV1]], i64 [[CONV2]])
// RV64ZBT-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP3]] to i32
// RV64ZBT-NEXT: ret i32 [[CONV3]]
//
int
// RV64ZBT-LABEL: @fsr(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: [[RS3_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: store i32 [[RS3:%.*]], i32* [[RS3_ADDR]], align 4
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV1:%.*]] = sext i32 [[TMP1]] to i64
// RV64ZBT-NEXT: [[TMP2:%.*]] = load i32, i32* [[RS3_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV2:%.*]] = sext i32 [[TMP2]] to i64
// RV64ZBT-NEXT: [[TMP3:%.*]] = call i64 @llvm.riscv.fsr.i64(i64 [[CONV]], i64 [[CONV1]], i64 [[CONV2]])
// RV64ZBT-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP3]] to i32
// RV64ZBT-NEXT: ret i32 [[CONV3]]
//
int
// RV64ZBT-LABEL: @fsri(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i32, align 4
// RV64ZBT-NEXT: store i32 [[RS1:%.*]], i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: store i32 [[RS2:%.*]], i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i32, i32* [[RS1_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV:%.*]] = sext i32 [[TMP0]] to i64
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i32, i32* [[RS2_ADDR]], align 4
// RV64ZBT-NEXT: [[CONV1:%.*]] = sext i32 [[TMP1]] to i64
// RV64ZBT-NEXT: [[TMP2:%.*]] = call i64 @llvm.riscv.fsr.i64(i64 [[CONV]], i64 [[CONV1]], i64 15)
// RV64ZBT-NEXT: [[CONV2:%.*]] = trunc i64 [[TMP2]] to i32
// RV64ZBT-NEXT: ret i32 [[CONV2]]
//
int
// RV64ZBT-LABEL: @fslw(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: [[RS3_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: store i64 [[RS1:%.*]], i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: store i64 [[RS2:%.*]], i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: store i64 [[RS3:%.*]], i64* [[RS3_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i64, i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i64, i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP2:%.*]] = load i64, i64* [[RS3_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP3:%.*]] = call i64 @llvm.riscv.fsl.i64(i64 [[TMP0]], i64 [[TMP1]], i64 [[TMP2]])
// RV64ZBT-NEXT: ret i64 [[TMP3]]
//
long
// RV64ZBT-LABEL: @fsrw(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: [[RS3_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: store i64 [[RS1:%.*]], i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: store i64 [[RS2:%.*]], i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: store i64 [[RS3:%.*]], i64* [[RS3_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i64, i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i64, i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP2:%.*]] = load i64, i64* [[RS3_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP3:%.*]] = call i64 @llvm.riscv.fsr.i64(i64 [[TMP0]], i64 [[TMP1]], i64 [[TMP2]])
// RV64ZBT-NEXT: ret i64 [[TMP3]]
//
long
// RV64ZBT-LABEL: @fsriw(
// RV64ZBT-NEXT: entry:
// RV64ZBT-NEXT: [[RS1_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: [[RS2_ADDR:%.*]] = alloca i64, align 8
// RV64ZBT-NEXT: store i64 [[RS1:%.*]], i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: store i64 [[RS2:%.*]], i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP0:%.*]] = load i64, i64* [[RS1_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP1:%.*]] = load i64, i64* [[RS2_ADDR]], align 8
// RV64ZBT-NEXT: [[TMP2:%.*]] = call i64 @llvm.riscv.fsr.i64(i64 [[TMP0]], i64 [[TMP1]], i64 15)
// RV64ZBT-NEXT: ret i64 [[TMP2]]
//
long