[llvm] [SPIRV] Added Support for the constrained conversion intrinsics (PR #157437)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 00:16:12 PDT 2025


================
@@ -0,0 +1,230 @@
+; RUN: llc -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
+
+define float @sitofp_f32_i32(i32 %in) {
+; CHECK-DAG: OpName %[[#]] "conv"
+; CHECK-DAG: OpConvertSToF %[[#]] %[[#]]
+; CHECK-DAG: OpDecorate %[[#]] FPRoundingMode RTE
+; CHECK-DAG: OpReturnValue %[[#]]
+entry:
+    %conv = tail call float @llvm.experimental.constrained.sitofp.f32.i32(i32 %in, metadata !"round.tonearest", metadata !"fpexcept.strict")
+    ret float %conv
+}
+
+define float @sitofp_f32_i16(i16 %in) {
+; CHECK-DAG: OpName %[[#]] "conv1"
----------------
arsenm wrote:

Did it print a warning on error? Somehow only 2 spirv tests are using update_llc_test_checks. Is it getting confused by the second run line? 

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


More information about the llvm-commits mailing list