26 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// RUN: %clang_cc1 -triple riscv32 -target-feature +xandesbfhcvt -emit-llvm %s -o - \3// RUN: -disable-O0-optnone | opt -S -passes=mem2reg | FileCheck %s4// RUN: %clang_cc1 -triple riscv64 -target-feature +xandesbfhcvt -emit-llvm %s -o - \5// RUN: -disable-O0-optnone | opt -S -passes=mem2reg | FileCheck %s6 7#include <riscv_nds.h>8 9// CHECK-LABEL: @test_fcvt_s_bf16(10// CHECK-NEXT: entry:11// CHECK-NEXT: [[TMP0:%.*]] = fpext bfloat [[BF:%.*]] to float12// CHECK-NEXT: ret float [[TMP0]]13//14float test_fcvt_s_bf16(__bf16 bf) {15 return __riscv_nds_fcvt_s_bf16(bf);16}17 18// CHECK-LABEL: @test_fcvt_bf16_s(19// CHECK-NEXT: entry:20// CHECK-NEXT: [[TMP0:%.*]] = fptrunc float [[SF:%.*]] to bfloat21// CHECK-NEXT: ret bfloat [[TMP0]]22//23__bf16 test_fcvt_bf16_s(float sf) {24 return __riscv_nds_fcvt_bf16_s(sf);25}26