[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-16 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/120526 >From cc30e98287ec0ceca490f1f6a16a0190ff243ed6 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Thu, 19 Dec 2024 14:09:04 +0800 Subject: [PATCH] clang/limits.h: Avoid including limits.h twice The limits.h of gl

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-16 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > but that leads to the question of: why is including musl's limits.h a problem? It cause some warning like ``` ./include/bits/xopen_lim.h:84:10: warning: "NL_NMAX" redefined 84 | # define NL_NMAXINT_MAX ``` https://github.com/llvm/llvm-project/pull/120526

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-13 Thread YunQiang Su via cfe-commits
wzssyqa wrote: You are right. My patch only fix the first problem: making a unit test of glibc happy. The failure test case of glibc is: * check-local-headers See: https://github.com/llvm/llvm-project/pull/120673 also. https://github.com/llvm/llvm-project/pull/120526 __

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-07 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > I'm confused why this is necessary, we already work around glibc's quirk here: > > https://github.com/llvm/llvm-project/blob/a15fedc399d5d1aa07c14531e5cd8d3efc583600/clang/lib/Headers/limits.h#L18 > > > which should then hit glibc's header guard here: > https://sourceware.org/

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2025-01-07 Thread YunQiang Su via cfe-commits
wzssyqa wrote: ping https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2025-01-07 Thread YunQiang Su via cfe-commits
wzssyqa wrote: ping https://github.com/llvm/llvm-project/pull/120673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2025-01-07 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/120673 >From ef5e52370d202431c1e6970fc57a7a04b9e83b89 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 20 Dec 2024 02:55:49 + Subject: [PATCH 1/2] Clang/Preprocessor: Not add headers of __has_include into Dep

[clang] [Clang][MIPS] Send correct architecture for MinGW toolchains (PR #121042)

2025-01-04 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/121042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][MIPS] Create specific targets for MIPS PE/COFF (PR #121040)

2024-12-24 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/121040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][MIPS] Send correct architecture for MinGW toolchains (PR #121042)

2024-12-24 Thread YunQiang Su via cfe-commits
@@ -85,6 +85,10 @@ // RUN: | FileCheck %s --check-prefix CHECK_MINGW_EC_LINK // CHECK_MINGW_EC_LINK: "-m" "arm64ecpe" +// RUN: %clang --target=mipsel-windows-gnu -### -o /dev/null %s 2>&1 \ +// RUN: | FileCheck %s --check-prefix CHECK_MINGW_MIPSPE +// CHECK_MINGW_MIPSPE: "

[clang] [llvm] Clang/buildFMulAdd: Use negated attribute (PR #121038)

2024-12-24 Thread YunQiang Su via cfe-commits
wzssyqa wrote: Depends on https://github.com/llvm/llvm-project/pull/121027 https://github.com/llvm/llvm-project/pull/121038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Clang/buildFMulAdd: Use negated attribute (PR #121038)

2024-12-24 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa converted_to_draft https://github.com/llvm/llvm-project/pull/121038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Clang/buildFMulAdd: Use negated attribute (PR #121038)

2024-12-24 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/121038 Use negated attribute if negMul or negAdd. So that we can lower fneg+fmuladd to fmul+fsub if needed. 1) It can save one machine instruction: fneg/fmul/fadd vs fmul/fsub 2) In strict mode, `c-a*b` may be

[clang] [clang-tools-extra] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2024-12-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/120673 >From ef5e52370d202431c1e6970fc57a7a04b9e83b89 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 20 Dec 2024 02:55:49 + Subject: [PATCH 1/2] Clang/Preprocessor: Not add headers of __has_include into Dep

[clang] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2024-12-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/120673 >From ef5e52370d202431c1e6970fc57a7a04b9e83b89 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 20 Dec 2024 02:55:49 + Subject: [PATCH] Clang/Preprocessor: Not add headers of __has_include into DepColl

[clang] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2024-12-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2024-12-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang/Preprocessor: Not add headers of __has_include into DepColloctor (PR #120673)

2024-12-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/120673 When we preprocess the bellow code with clang -E -MD -MF #if __has_include() // DO NOTHING #endif #if 0 && __has_include() #include #endif It will list limits.h in the dependencies. The sa

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/120526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang/limits.h: Avoid including limits.h twice (PR #120526)

2024-12-18 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/120526 The limits.h of glibc, aka /usr/include/limits.h file of *-linux-gnu systems, has `#include_next `, so the limits.h from clang is included. And in the limits.h for clang, `#include_next ` is also used. Normall

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-11-24 Thread YunQiang Su via cfe-commits
wzssyqa wrote: @arsenm ping https://github.com/llvm/llvm-project/pull/113133 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] APFloat: Fix maxnum and minnum with sNaN (PR #112854)

2024-10-22 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/112854 >From ad7c6b648f3bb88ce075fa15cf8915350e4981ab Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 18 Oct 2024 16:33:19 +0800 Subject: [PATCH 1/2] APFloat: Fix maxnum and minnum with sNaN See: https://github.

[clang] [llvm] APFloat: Fix maxnum and minnum with sNaN (PR #112854)

2024-10-22 Thread YunQiang Su via cfe-commits
@@ -582,7 +582,46 @@ TEST(APFloatTest, MinNum) { APFloat zp(0.0); APFloat zn(-0.0); EXPECT_EQ(-0.0, minnum(zp, zn).convertToDouble()); - EXPECT_EQ(-0.0, minnum(zn, zp).convertToDouble()); + + APInt intPayload_89ab(64, 0x89ab); wzssyqa wrote: It is not

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-22 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/113133 >From 4cb7472aaa8973651a85057ee2f7ca7415d8ea72 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 21 Oct 2024 15:18:38 +0800 Subject: [PATCH 1/6] Clang: emit llvm.minnum and llvm.maxnum with nsz always See:

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/113133 >From ec7d885a7bc89fcb35c08890fde2f07da1e61984 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 21 Oct 2024 15:18:38 +0800 Subject: [PATCH 1/5] Clang: emit llvm.minnum and llvm.maxnum with nsz always See:

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/113133 >From ec7d885a7bc89fcb35c08890fde2f07da1e61984 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 21 Oct 2024 15:18:38 +0800 Subject: [PATCH 1/3] Clang: emit llvm.minnum and llvm.maxnum with nsz always See:

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/113133 >From ec7d885a7bc89fcb35c08890fde2f07da1e61984 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 21 Oct 2024 15:18:38 +0800 Subject: [PATCH 1/2] Clang: emit llvm.minnum and llvm.maxnum with nsz always See:

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread YunQiang Su via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK + +float fminf (float, float); +double fmin (double, double); +long double fminl (long double, long double); +float fmaxf (float, float); +double fmax (double, double);

[clang] [llvm] APFloat: Fix maxnum and minnum with sNaN (PR #112854)

2024-10-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/112854 >From 30da4359c2b36d6fef88108b68800833dd514a22 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 18 Oct 2024 16:33:19 +0800 Subject: [PATCH] APFloat: Fix maxnum and minnum with sNaN See: https://github.com/

[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

2024-10-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/113133 See: https://github.com/llvm/llvm-project/pull/112852 We will define llvm.minnum and llvm.maxnum with +0.0>-0.0, by default, while libc doesn't require it. >From ec7d885a7bc89fcb35c08890fde2f07da1e61984 Mon Se

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-14 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > Maybe should add support for elementwise builtins next https://github.com/llvm/llvm-project/issues/112164 https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-14 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-14 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From 98e909e0eff233c2ee3c5e7f3094e35004326bd0 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 01/12] Clang: Support minimumnum and maximumnum intrinsics We just

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-13 Thread YunQiang Su via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s +// FIXME: %clang_cc1 -std=c++17 -fsyntax-only -verify -fexperimental-new-constant-interpreter %s +// expected-no-diagnostics + +constexpr double NaN = __builtin_nan(""); +constexpr double Inf = __builtin_in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-12 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 01/11] Clang: Support minimumnum and maximumnum intrinsics We just

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 01/11] Clang: Support minimumnum and maximumnum intrinsics We just

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
@@ -372,6 +372,31 @@ void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) { // HAS_MAYTRAP: declare float @llvm.experimental.constrained.minnum.f32( // HAS_MAYTRAP: declare x86_fp80 @llvm.experimental.constrained.minnum.f80( + fmaximum_num(*d,*d);

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
@@ -15314,6 +15314,32 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { Result = RHS; wzssyqa wrote: I guess it was due to that the `APFloat::minnum` claims that it fellow `IEEE-754 2019 minimumNumber semantics`. and `fmin` needs to follow t

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 01/10] Clang: Support minimumnum and maximumnum intrinsics We just

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > > Can you add a test that passes a non-float value and checks that it's > > rejected? > > Do you mean something like this? > > ``` > $ cat xx.c > #include > > float f(char *a, char *b) { > return fminimum_num(a, b); > } > $ ./bin/clang -std=c23 -O2 -S -emit-llvm xx.

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/9] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/8] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
@@ -15314,6 +15314,32 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { Result = RHS; return true; } + + case Builtin::BI__builtin_fmaximum_num: + case Builtin::BI__builtin_fmaximum_numf: + case Builtin::BI__builtin_fmaximum_numl: + case Builtin::B

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/7] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > Add it as a succcessful test then to check that the `EvaluateFloat` calls > don't fail done. https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/6] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
@@ -15314,6 +15314,32 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { Result = RHS; wzssyqa wrote: I have no idea. I will try to fixed in future patches. https://github.com/llvm/llvm-project/issues/111991 https://github.com/llvm/llvm-proje

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From c08b0a8d34107dc4563c434485ba5f326ab8df93 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/5] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
@@ -475,6 +475,12 @@ SYMBOL(fmaxl, None, ) SYMBOL(fmin, None, ) SYMBOL(fminf, None, ) SYMBOL(fminl, None, ) +SYMBOL(fmaximum_num, None, ) wzssyqa wrote: Oh, yes. It is autogenerated from https://github.com/PeterFeicht/cppreference-doc/releases. If we need to

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > > Yes, but also with an integer please Clang can convert integer to float, so it won't be a failure. https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > Can you add a test that passes a non-float value and checks that it's > rejected? Do you mean something like this? ``` $ cat xx.c #include float f(char *a, char *b) { return fminimum_num(a, b); } $ ./bin/clang -std=c23 -O2 -S -emit-llvm xx.c xx.c:4:22: error: passin

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-10-11 Thread YunQiang Su via cfe-commits
wzssyqa wrote: I cannot reproduce the fail of `Driver/hip-partial-link.hip`. Any idea about it? https://github.com/llvm/llvm-project/pull/96281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-19 Thread YunQiang Su via cfe-commits
wzssyqa wrote: OK. Then I will work on GCC with this support. https://github.com/llvm/llvm-project/pull/107664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-19 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/107664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-19 Thread YunQiang Su via cfe-commits
wzssyqa wrote: Sorry for the late comment. I find a problem. With the IR code like ``` define dso_local float @f1(float noundef %a, float noundef %b) local_unnamed_addr #0 { entry: %call = tail call float @llvm.minimumnum.f32(float noundef %a, float noundef %b) #2 ret float %call } `./bin/

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-19 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > My understanding is that all of these `musl*` environments have been added to > GCC and LLVM on an as-needed basis for toolchains, not necessarily because > musl itself needs them. Do you have interesting to add them to GCC? I guess we need to add config.sub/config.guess firs

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-20 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > I figure out another use case: > > ``` > f: > fadd.w $w0,$w1,$w2 > ``` > > ``` > # ./bin/clang --target=mipsel-linux-gnu -mfp64 -Wa,-mmsa -fintegrated-as -c > xx.s > xx.s:2:2: error: instruction requires a CPU feature not currently enabled > fadd.w $w0,$w1,

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-08-20 Thread YunQiang Su via cfe-commits
wzssyqa wrote: I figure out another use case: ``` f: fadd.w $w0,$w1,$w2 ``` ``` # ./bin/clang --target=mipsel-linux-gnu -mfp64 -Wa,-mmsa -fintegrated-as -c xx.s xx.s:2:2: error: instruction requires a CPU feature not currently enabled fadd.w $w0,$w1,$w2 ^ ``` ``` # ./

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-07-31 Thread YunQiang Su via cfe-commits
wzssyqa wrote: I think that you may need to detect that whether integrated-as is used. If so, pass `-target-feature` option. https://github.com/llvm/llvm-project/pull/99615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang] Support -Wa, options -mmsa and -mno-msa (PR #99615)

2024-07-31 Thread YunQiang Su via cfe-commits
wzssyqa wrote: I have a try of your patch ``` $ ./bin/clang --target=mips-linux-gnu -mfp64 -Wa,-mmsa nn.c error: unknown argument: '-mmsa' ``` ``` mipsel-linux-gnu-gcc-14 -mfp64 -Wa,-mmsa nn.c ``` has no such problem. https://github.com/llvm/llvm-project/pull/99615

[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

2024-07-05 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > @wzssyqa Is it OK with you if I go ahead and merge this PR? I plan to follow > up with further improvements but this is necessary to fix the build of LLVM > runtime libraries in the bootstrapping build. It is OK for me, while I have no permission to approve such a patch. http

[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

2024-07-05 Thread YunQiang Su via cfe-commits
@@ -183,6 +183,24 @@ message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}") set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}") +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(option_prefix "") + if (CMAKE_C_SIMULATE_ID MATCHES "MSVC") +set(opti

[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

2024-07-05 Thread YunQiang Su via cfe-commits
@@ -368,14 +368,22 @@ macro(construct_compiler_rt_default_triple) "Default triple for which compiler-rt runtimes will be built.") endif() - if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "Clang") set(option_prefix "") if

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-06-26 Thread YunQiang Su via cfe-commits
@@ -3636,6 +3648,22 @@ def Fmin : FPMathTemplate, LibBuiltin<"math.h"> { let OnlyBuiltinPrefixedAliasIsConstexpr = 1; } +def FmaximumNum : FPMathTemplate, LibBuiltin<"math.h"> { wzssyqa wrote: Yes. They are in C23: https://libc.llvm.org/c23.html https://gi

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-06-25 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/96281 >From 1f357abed9d9e304b12ddd05a525557a8b0082c6 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Fri, 21 Jun 2024 14:28:42 +0800 Subject: [PATCH 1/2] Clang: Support minimumnum and maximumnum intrinsics We just in

[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

2024-06-25 Thread YunQiang Su via cfe-commits
@@ -368,14 +368,22 @@ macro(construct_compiler_rt_default_triple) "Default triple for which compiler-rt runtimes will be built.") endif() - if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") + if(CMAKE_C_COMPILER_ID MATCHES "Clang") set(option_prefix "") if

[clang] [compiler-rt] [llvm] [CMake] Use Clang to infer the target triple (PR #89425)

2024-06-25 Thread YunQiang Su via cfe-commits
@@ -183,6 +183,24 @@ message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}") set(LLVM_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}") +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(option_prefix "") + if (CMAKE_C_SIMULATE_ID MATCHES "MSVC") +set(opti

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-06-21 Thread YunQiang Su via cfe-commits
@@ -3636,6 +3648,22 @@ def Fmin : FPMathTemplate, LibBuiltin<"math.h"> { let OnlyBuiltinPrefixedAliasIsConstexpr = 1; } +def FmaximumNum : FPMathTemplate, LibBuiltin<"math.h"> { wzssyqa wrote: Oh, newer libc does have this function: https://www.gnu.org/sof

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-21 Thread YunQiang Su via cfe-commits
wzssyqa wrote: @nikic Thanks. I submit an RFC now https://discourse.llvm.org/t/rfc-fix-llvm-min-f-and-llvm-max-f-intrinsics/79735 https://github.com/llvm/llvm-project/pull/93841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-21 Thread YunQiang Su via cfe-commits
wzssyqa wrote: @nikic thanks. Please also revert https://github.com/llvm/llvm-project/commit/225d8fc8eb24fb797154c1ef6dcbe5ba033142da https://github.com/llvm/llvm-project/pull/93841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] Clang: Support minimumnum and maximumnum intrinsics (PR #96281)

2024-06-20 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/96281 We just introduce llvm.minimumnum and llvm.maximumnum intrinsics support to llvm. Let's support them in Clang. See: #93033 >From 5605426ee61ec58cad701103a43922b67792ccaf Mon Sep 17 00:00:00 2001 From: YunQiang

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-20 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/93841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-11 Thread YunQiang Su via cfe-commits
@@ -15868,6 +15868,51 @@ The returned value is completely identical to the input except for the sign bit; in particular, if the input is a NaN, then the quiet/signaling bit and payload are perfectly preserved. +.. _i_fminmax_family: + +'``llvm.min.*``' Intrinsics Comparation

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-11 Thread YunQiang Su via cfe-commits
@@ -15868,6 +15868,51 @@ The returned value is completely identical to the input except for the sign bit; in particular, if the input is a NaN, then the quiet/signaling bit and payload are perfectly preserved. +.. _i_fminmax_family: + +'``llvm.min.*``' Intrinsics Comparation

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-11 Thread YunQiang Su via cfe-commits
@@ -15883,6 +15883,95 @@ The returned value is completely identical to the input except for the sign bit; in particular, if the input is a NaN, then the quiet/signaling bit and payload are perfectly preserved. +.. _i_fminmax_family: + +'``llvm.min.*``' Intrinsics Comparation

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-11 Thread YunQiang Su via cfe-commits
@@ -15883,6 +15883,95 @@ The returned value is completely identical to the input except for the sign bit; in particular, if the input is a NaN, then the quiet/signaling bit and payload are perfectly preserved. +.. _i_fminmax_family: + +'``llvm.min.*``' Intrinsics Comparation

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-11 Thread YunQiang Su via cfe-commits
@@ -15883,6 +15883,95 @@ The returned value is completely identical to the input except for the sign bit; in particular, if the input is a NaN, then the quiet/signaling bit and payload are perfectly preserved. +.. _i_fminmax_family: + +'``llvm.min.*``' Intrinsics Comparation

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-10 Thread YunQiang Su via cfe-commits
@@ -16055,6 +16145,90 @@ of the two arguments. -0.0 is considered to be less than +0.0 for this intrinsic. Note that these are the semantics specified in the draft of IEEE 754-2019. +.. _i_minimumnum: + +'``llvm.minimumnum.*``' Intrinsic +^ + +

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-06-01 Thread YunQiang Su via cfe-commits
@@ -32,27 +32,29 @@ class StoreInst; /// These are the kinds of recurrences that we support. enum class RecurKind { - None, ///< Not a recurrence. - Add, ///< Sum of integers. - Mul, ///< Product of integers. - Or, ///< Bitwise or logical OR of integers

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
@@ -9130,6 +9142,15 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) { if (visitBinaryFloatCall(I, ISD::FMAXNUM)) return; break; + case LibFunc_fminimum_num: + case LibFunc_fminimum_numf: +if (visitBinaryFloatCall(I, ISD::FMI

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
@@ -9130,6 +9142,15 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) { if (visitBinaryFloatCall(I, ISD::FMAXNUM)) return; break; + case LibFunc_fminimum_num: + case LibFunc_fminimum_numf: +if (visitBinaryFloatCall(I, ISD::FMI

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/93841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
@@ -631,6 +631,46 @@ TEST(APFloatTest, Maximum) { EXPECT_TRUE(std::isnan(maximum(nan, f1).convertToDouble())); } +TEST(APFloatTest, MinimumNumber) { + APFloat f1(1.0); + APFloat f2(2.0); + APFloat zp(0.0); + APFloat zn(-0.0); + APFloat nan = APFloat::getNaN(APFloat::IEE

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
wzssyqa wrote: > > 3. PowerPC: has some interaction with the behavior of `minnum/maxnum`: need > > define `fcanonicalize`. > > AMDGPU has the same handling. This is to break the signaling nan handling > from IEEE to the broken old glibc libm behavior. If we fix the definition to > match IEEE,

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-31 Thread YunQiang Su via cfe-commits
@@ -16049,6 +16094,84 @@ of the two arguments. -0.0 is considered to be less than +0.0 for this intrinsic. Note that these are the semantics specified in the draft of IEEE 754-2019. +.. _i_minimumnum: + +'``llvm.minimumnum.*``' Intrinsic +^ + +

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-30 Thread YunQiang Su via cfe-commits
wzssyqa wrote: TODO: implement for architectures that don't have `fmin/fmax` instructions: This is the example of MIPS pre-R6: ``` mins: .setnoreorder .setnomacro mtc1$0,$f1 add.s $f0,$f12,$f1 add.s $f13,$f13,$f1 c.un.s $fcc0,$f0

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-30 Thread YunQiang Su via cfe-commits
wzssyqa wrote: @peterwaller-arm I noticed that in `llvm/test/CodeGen/AArch64/combine_andor_with_cmps.ll`, `FMAXNUM_IEEE` is claimed that it is not supported. While I noticed that `fmaxnm` follows the rules of `maxNUM` of IEEE754-2008. Is there any other limitation of `fmaxnm`? https://github.

[clang] [llvm] Intrinsic: introduce minimumnum and maximumnum (PR #93841)

2024-05-30 Thread YunQiang Su via cfe-commits
wzssyqa wrote: Since we need to reuse some logic of `minnum/maxnum` to implement `minimumnum/maximumnum`, let's add them before switch the behavior of `minnum/maxnum`. Known not working ports, will be fixed in future PRs: 1. X86: the current `minnum/maxnum` cannot process +0 vs -0 as `minimu

[clang] [llvm] IR: Add module level attribution language-standard (PR #93159)

2024-05-23 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/93159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] IR: Add module level attribution language-standard (PR #93159)

2024-05-23 Thread YunQiang Su via cfe-commits
wzssyqa wrote: Let's close it. https://github.com/llvm/llvm-project/pull/93159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] IR: Add module level attribution language-standard (PR #93159)

2024-05-23 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa converted_to_draft https://github.com/llvm/llvm-project/pull/93159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] IR: Add module level attribution language-standard (PR #93159)

2024-05-23 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/93159 The backend may have interest on the language-standard level of source file. Let's pass it to IR. In a ll file, it looks like language-standard = "gnu17" >From 3e413bae6ba18276e4d47075d48d656e4f732b5e Mon Se

[clang] MIPS/Clang: Add more false option pairs into validateTarget (PR #91968)

2024-05-22 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/91968 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] MIPS/Clang: Add more false option pairs into validateTarget (PR #91968)

2024-05-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/91968 >From cccd9606fd574726c2cde2e473d1e05a62147caf Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 13 May 2024 21:46:40 +0800 Subject: [PATCH] MIPS/Clang: Add more false option pairs into validateTarget The op

[clang] MIPS/Clang: Add more false option pairs into validateTarget (PR #91968)

2024-05-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa updated https://github.com/llvm/llvm-project/pull/91968 >From cccd9606fd574726c2cde2e473d1e05a62147caf Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Mon, 13 May 2024 21:46:40 +0800 Subject: [PATCH] MIPS/Clang: Add more false option pairs into validateTarget The op

[clang] MIPS/Clang: handleTargetFeatures, add +fp64 if +msa and no other +-fp (PR #92728)

2024-05-21 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa closed https://github.com/llvm/llvm-project/pull/92728 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   >