[Cfp-interest 3354] Re: JTC1/SC22/WG14/CFP 2025/01/08 Meeting minutes
Joshua Cranmer
joshua.cranmer at intel.com
Thu Jan 9 12:49:21 PST 2025
On 1/9/2025 0:10, Damian McGuckin wrote:
>
> Joshua,
>
> On Wed, 8 Jan 2025, Joshua Cranmer wrote:
>
>> On 1/8/2025 14:13, Jerome Coonen wrote:
>> Joshua: C++ doesn't want pragmas, but wants templates instead.
>> Have
>> tried to propose, but have found resistance.
>
> Can you share an example of the template approach, specifically the
> one with the 11 template arguments?
One hasn't been proposed yet, but the general thinking is that something
like this would exist:
template <typename T, round mode, exception behavior, ...>
class float;
which starts to get obscene if you represent the fast-math-related
behavior as individual parameters.
>
>> Joshua: C++ does all FENV_ACCESS on a per-function basis.
>>
>> C++ implementations allow something like FENV_ACCESS on a
>> per-function basis.
>
> Do you have an example please?
MSVC implements a few FP programs, like #pragma fp_control
<https://learn.microsoft.com/en-us/cpp/preprocessor/float-control?view=msvc-170>
(the documentation doesn't say it, but tests on compiler explorer
confirm that it's function-level).
Clang has a rich set of pragmas
(https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags),
in addition to implementing the MSVC pragmas, that work on a per-block
basis. It also implements #pragma STDC FENV_ACCESS directly.
GCC has the -frounding-math parameter that controls the same thing as
FENV_ACCESS, and I think (though I haven't tested) it's possible to
specify this with the per-function attribute allowing custom
optimizations to be applied to functions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20250109/75292207/attachment.htm>
More information about the Cfp-interest
mailing list