[all-commits] [llvm/llvm-project] 9e7c99: Additionally set f32 mode with denormal-fp-math

dcandler via All-commits all-commits at lists.llvm.org
Fri Apr 29 07:07:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e7c9967c3fd573ef53b145e24e6a1e6ba930c82
      https://github.com/llvm/llvm-project/commit/9e7c9967c3fd573ef53b145e24e6a1e6ba930c82
  Author: David Candler <david.candler at arm.com>
  Date:   2022-04-29 (Fri, 29 Apr 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/CodeGen/denormalfpmode-f32.c

  Log Message:
  -----------
  Additionally set f32 mode with denormal-fp-math

When the denormal-fp-math option is used, this should set the
denormal handling mode for all floating point types. However,
currently 32-bit float types can ignore this setting as there is a
variant of the option, denormal-fp-math-f32, specifically for that type
which takes priority when checking the mode based on type and remains
at the default of IEEE. From the description, denormal-fp-math would
be expected to set the mode for floats unless overridden by the f32
variant, and code in the front end only emits the f32 option if it is
different to the general one, so setting just denormal-fp-math should
be valid.

This patch changes the denormal-fp-math option to also set the f32
mode. If denormal-fp-math-f32 is also specified, this is then
overridden as expected, but if it is absent floats will be set to the
mode specified by the former option, rather than remain on the default.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D122589




More information about the All-commits mailing list