[llvm] [llubi] Upstream existing floating-point intrinsics (PR #196034)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun May 10 12:31:08 PDT 2026
================
@@ -0,0 +1,27 @@
+; NOTE: Assertions have been autogenerated by utils/update_llubi_test_checks.py UTC_ARGS: --version 6
+; RUN: llubi --verbose < %s 2>&1 | FileCheck %s
+
+define void @main() {
+ %fmax_1 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmax_2 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmax_3 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmax_4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+
+ %fmin_1 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmin_2 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmin_3 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+ %fmin_4 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.0, float +snan(0x42), float 4.0, float 6.0>)
+
+ ret void
+}
+; CHECK: Entering function: main
+; CHECK-NEXT: %fmax_1 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 6.000000e+00
+; CHECK-NEXT: %fmax_2 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 0x7F800042
+; CHECK-NEXT: %fmax_3 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 0x7FC00042
+; CHECK-NEXT: %fmax_4 = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 4.000000e+00
+; CHECK-NEXT: %fmin_1 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 1.000000e+00
+; CHECK-NEXT: %fmin_2 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 1.000000e+00
+; CHECK-NEXT: %fmin_3 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 1.000000e+00
+; CHECK-NEXT: %fmin_4 = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> <float 1.000000e+00, float +snan(0x42), float 4.000000e+00, float 6.000000e+00>) => float 1.000000e+00
----------------
nikic wrote:
May need more calls, looks like we're getting four times 1.0 for fmin...
https://github.com/llvm/llvm-project/pull/196034
More information about the llvm-commits
mailing list