[clang] [llvm] [clang][RISCV] Add Xsfvfofp4min C intrinsics (PR #245142)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 22:52:58 PST 2026


================
@@ -0,0 +1,134 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
+// REQUIRES: riscv-registered-target
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -target-feature +xsfvfofp4min -disable-O0-optnone \
+// RUN:   -emit-llvm %s -o - | opt -S -passes=mem2reg | \
+// RUN:   FileCheck --check-prefix=CHECK-RV64 %s
+
+#include <sifive_vector.h>
+
+// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i8> @test_vfext_vf2_f8e4m3mf4(
+// CHECK-RV64-SAME: <vscale x 1 x i8> [[VS2:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] {
+// CHECK-RV64-NEXT:  [[ENTRY:.*:]]
+// CHECK-RV64-NEXT:    [[TMP0:%.*]] = call <vscale x 2 x i8> @llvm.riscv.vfext.vf2.nxv2i8.nxv1i8.i64(<vscale x 2 x i8> poison, <vscale x 1 x i8> [[VS2]], i64 [[VL]])
+// CHECK-RV64-NEXT:    ret <vscale x 2 x i8> [[TMP0]]
+//
+vfloat8e4m3mf4_t test_vfext_vf2_f8e4m3mf4(vfloat4e2m1mf8_t vs2, size_t vl) {
+  return __riscv_vfext_vf2_f8e4m3mf4(vs2, vl);
----------------
topperc wrote:

```suggestion
  return __riscv_sf_vfext_vf2_f8e4m3mf4(vs2, vl);
```

https://github.com/llvm/llvm-project/pull/245142


More information about the cfe-commits mailing list