[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread via cfe-commits
https://github.com/PiJoules closed https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/81207 >From 58a33e3792d2447cf99ac9959c80333299a9a2dc Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 8 Feb 2024 16:12:35 -0800 Subject: [PATCH] [clang] Add fixed point precision macros This defines the builtin

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Fangrui Song via cfe-commits
@@ -768,6 +768,59 @@ void InitializeOpenCLFeatureTestMacros(const TargetInfo &TI, Builder.defineMacro("__opencl_c_int64"); } +std::string ConstructFixedPointLiteral(llvm::APFixedPoint Val, + llvm::StringRef Suffix) { + if (Val.isSigned

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. Aside from a minor nit with the documentation, LGTM! https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Aaron Ballman via cfe-commits
@@ -297,6 +297,12 @@ DWARF Support in Clang Floating Point Support in Clang --- +Fixed Point Support in Clang +--- AaronBallman wrote: ```suggestion Fixed Point Support in Clang -

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-14 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,67 @@ +/// Assert the fixed point precision macros according to N1169 7.18a.3 are +/// defined when -ffixed-point is provided. + +// RUN: %clang_cc1 -triple=x86_64 -E -dM -ffixed-point -x c < /dev/null | FileCheck -match-full-lines %s +// RUN: %clang_cc1 -triple=x86_64

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
https://github.com/PiJoules edited https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
@@ -1097,6 +1150,47 @@ static void InitializePredefinedMacros(const TargetInfo &TI, TI.getTypeWidth(TI.getIntMaxType()) && "uintmax_t and intmax_t have different widths?"); + if (LangOpts.FixedPoint) { +// Each unsigned type has the same width as th

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
PiJoules wrote: > I'm by no means a fixed-point expert, so this is a bit of a drive-by review. > > One thing to note is that we shouldn't be using N1169 because TR 18037 is > freely available: > https://standards.iso.org/ittf/PubliclyAvailableStandards/c051126_ISO_IEC_TR_18037_2008.zip > > Th

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/81207 >From 3696de68d417e6aaec50ef3b01332420effd2ac2 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 8 Feb 2024 16:12:35 -0800 Subject: [PATCH] [clang] Add fixed point precision macros This defines the builtin

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/81207 >From 07c05200a5001711fed5cd776946a6ac7dd6c3b6 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 8 Feb 2024 16:12:35 -0800 Subject: [PATCH] [clang] Add fixed point precision macros This defines the builtin

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
@@ -0,0 +1,67 @@ +/// Assert the fixed point precision macros according to N1169 7.18a.3 are +/// defined when -ffixed-point is provided. + +// RUN: %clang_cc1 -triple=x86_64 -E -dM -ffixed-point -x c < /dev/null | FileCheck -match-full-lines %s +// RUN: %clang_cc1 -triple=x86_64

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread Aaron Ballman via cfe-commits
@@ -1097,6 +1150,47 @@ static void InitializePredefinedMacros(const TargetInfo &TI, TI.getTypeWidth(TI.getIntMaxType()) && "uintmax_t and intmax_t have different widths?"); + if (LangOpts.FixedPoint) { +// Each unsigned type has the same width as th

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,67 @@ +/// Assert the fixed point precision macros according to N1169 7.18a.3 are +/// defined when -ffixed-point is provided. + +// RUN: %clang_cc1 -triple=x86_64 -E -dM -ffixed-point -x c < /dev/null | FileCheck -match-full-lines %s +// RUN: %clang_cc1 -triple=x86_64

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I'm by no means a fixed-point expert, so this is a bit of a drive-by review. One thing to note is that we shouldn't be using N1169 because TR 18037 is freely available: https://standards.iso.org/ittf/PubliclyAvailableStandards/c051126_ISO_IEC_TR_18037

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-13 Thread via cfe-commits
PiJoules wrote: ping https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-08 Thread via cfe-commits
PiJoules wrote: cc @lntue https://github.com/llvm/llvm-project/pull/81207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-08 Thread via cfe-commits
https://github.com/PiJoules updated https://github.com/llvm/llvm-project/pull/81207 >From 3360e6cf2542d4a53f87d8cafdd3a5638bd4a4ef Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 8 Feb 2024 16:12:35 -0800 Subject: [PATCH] [clang] Add fixed point precision macros This defines the builtin

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-adt Author: None (PiJoules) Changes This defines the builtin macros specified in `7.18a.3 Precision macros` of N1169. These are the `__*__` versions of them and the formal definitions in stdfix.h can use them. --- Full diff: https://github.com/ll

[clang] [llvm] [clang] Add fixed point precision macros (PR #81207)

2024-02-08 Thread via cfe-commits
https://github.com/PiJoules created https://github.com/llvm/llvm-project/pull/81207 This defines the builtin macros specified in `7.18a.3 Precision macros` of N1169. These are the `__*__` versions of them and the formal definitions in stdfix.h can use them. >From 23f6ff492970eed134af025307d0c