[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,269 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +// RUN: %clang_cc1 -disable-llvm-passes -O3 -triple x86_64 %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK + +typedef _Float16 half8 __attribute__((ext_

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/129207 >From 917e3b80ae7962a4f0bd5735cdc88163fcdbdcc7 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 28 Feb 2025 16:09:04 +0800 Subject: [PATCH 1/2] Clang: Add minnum/maxnum builtin functions support With https

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/129207 With https://github.com/llvm/llvm-project/pull/112852, we claimed that llvm.minnum and llvm.maxnum should treat +0.0>-0.0, while libc doesn't require fmin(3)/fmax(3) for it. To make llvm.minnum/llvm.maxnum eas

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread YunQiang Su via cfe-commits
@@ -209,6 +209,18 @@ def FmaxF16F128 : Builtin, F16F128MathTemplate { let Prototype = "T(T, T)"; } +def MinNum : Builtin { wzssyqa wrote: I prefer to drop it. Since we don't provide the function name without __builtin, such as `fmimnum`. https://github.c

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread Matt Arsenault via cfe-commits
@@ -209,6 +209,18 @@ def FmaxF16F128 : Builtin, F16F128MathTemplate { let Prototype = "T(T, T)"; } +def MinNum : Builtin { arsenm wrote: Should the keep the f prefix convention? I suppose we aren't following a libm function, so it might make sense to drop

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: YunQiang Su (wzssyqa) Changes With https://github.com/llvm/llvm-project/pull/112852, we claimed that llvm.minnum and llvm.maxnum should treat +0.0>-0.0, while libc doesn't require fmin(3)/fmax(3) for it. To make llvm.minnum/llvm.

[clang] Clang: Add minnum/maxnum builtin functions (PR #129207)

2025-02-28 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/129207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits