[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-25 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/89477 >From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 19 Apr 2024 17:53:52 -0700 Subject: [PATCH 1/3] Clean up denormal handling with -ffp-model, -ffast-math,

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

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

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-24 Thread Fangrui Song via cfe-commits
@@ -2942,6 +2942,10 @@ static void RenderFloatingPointOptions(const ToolChain , const Driver , if (Val.equals("fast")) { FPModel = Val; applyFastMath(); +// The target-specific getDefaultDenormalModeForType handler should +// account for

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-24 Thread Fangrui Song via cfe-commits
@@ -5,12 +5,15 @@ // crtfastmath enables ftz and daz // RUN: %clang -### -target x86_64-unknown-linux-gnu -ffast-math --sysroot=%S/Inputs/basic_linux_tree -c %s -v 2>&1 | FileCheck -check-prefix=CHECK-PRESERVESIGN %s +// RUN: %clang -### -target x86_64-unknown-linux-gnu

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-24 Thread Andy Kaylor via cfe-commits
andykaylor wrote: This patch will need extensive changes once https://github.com/llvm/llvm-project/pull/80475 lands. We're basically decoupling "denormal-fp-math" from fast-math, but I think we still want to link "crtfastmath.o" when --fp-model=fast is used, as we do with -ffast-math.

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-24 Thread Fangrui Song via cfe-commits
@@ -1314,11 +1314,17 @@ bool ToolChain::isFastMathRuntimeAvailable(const ArgList , Arg *A = Args.getLastArg(options::OPT_ffast_math, options::OPT_fno_fast_math, options::OPT_funsafe_math_optimizations, -

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-24 Thread Matt Arsenault via cfe-commits
arsenm wrote: > Some of the GPU targets, IIRC, want daz/ftz by default. Not all targets have > DAZ/FTZ bits that can be set; I think RISC-V is in this category, although to > be honest, trying to track down all the ISA extensions to make sure is a bit > beyond my ken. > OpenCL allows you to

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-23 Thread Joshua Cranmer via cfe-commits
jcranmer-intel wrote: > I'm not sure what the correct behavior is across all platforms. My > perspective on this is heavily X86-biased, so I'd really like some guidance > from people who work on other targets about their expectations. I think I saw > at least one target that sets

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-23 Thread Zahira Ammarguellat via cfe-commits
https://github.com/zahiraam approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-22 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > This effort is highly desirable, c.f. this [blog > post](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html), > so thanks for that! > > Xref: #57589, #80475, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55522 My patch here still leaves the

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-20 Thread via cfe-commits
h-vetinari wrote: This effort is highly desirable, c.f. this [blog post](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html), so thanks for that! https://github.com/llvm/llvm-project/pull/89477 ___ cfe-commits mailing

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-19 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 5b4ed0dc9fac9144efe74da77517dcff46e731e9 cd8df1939a456c05a1d94c471627fc5a7a332fc1 --

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This is an attempt to better align the denormal handling of -ffp-model=fast with the behavior of -ffast-math. The clang user's manual claims that -ffp-model=fast "behaves identically to specifying both

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Andy Kaylor (andykaylor) Changes This is an attempt to better align the denormal handling of -ffp-model=fast with the behavior of -ffast-math. The clang user's manual claims that -ffp-model=fast "behaves identically to specifying

[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)

2024-04-19 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/89477 This is an attempt to better align the denormal handling of -ffp-model=fast with the behavior of -ffast-math. The clang user's manual claims that -ffp-model=fast "behaves identically to specifying both