https://github.com/nihui updated https://github.com/llvm/llvm-project/pull/89062
>From c9e664be047d980786aa50ac682be529971caedd Mon Sep 17 00:00:00 2001 From: nihui <shuizhuyuan...@126.com> Date: Wed, 17 Apr 2024 20:04:00 +0800 Subject: [PATCH] fix UB in bfloat16 scalar conversion --- clang/include/clang/Basic/arm_neon.td | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/arm_neon.td b/clang/include/clang/Basic/arm_neon.td index 6d655c39360d3b..6390ba3f9fe5e5 100644 --- a/clang/include/clang/Basic/arm_neon.td +++ b/clang/include/clang/Basic/arm_neon.td @@ -275,7 +275,7 @@ def OP_VCVT_BF16_F32_HI_A32 (call "vget_low", $p0))>; def OP_CVT_F32_BF16 - : Op<(bitcast "R", (op "<<", (bitcast "int32_t", $p0), + : Op<(bitcast "R", (op "<<", (cast "int32_t", (bitcast "int16_t", $p0)), (literal "int32_t", "16")))>; //===----------------------------------------------------------------------===// _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits