Thiago Macieira
2018-10-15 05:28:43 UTC
Ref: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1246r0.html
The paper proposes a new function attribute to prevent the generation of
floating point instructions by the compiler, clearly marking such a function.
I like the proposal, it's an interesting evolution.
I just have a few questions to the authors:
1) kernel implementations are usually the opposite: they use no floating
point by default, except in a few specific cases. Is the intention that every
function that doesn't use floating-point be marked? That seems like a recipe
for mistake, as it would be easy to forget to mark a few functions. Would it
be possible to provide a translation-unit-wide marker saying "none of these
functions require floating point"?
2) if there's a TU-wide marker, should there be an inverse attribute
"yes_float" (with a better name)?
3) I'm also not sure the name "no_float" is the best. As you note in point #4
of what it means to use such an attribute, an implementation-defined
consequence is that vectorisation should be suppressed as those use the same
registers as floating point. But that's not the case for all architectures,
x86 32-bit being the prime example. Therefore, "no_float" changing the code
generation for integral / byte-level operations could be surprising. Have you
received any other suggestions for a name? Possibly splitting the behaviour
between FP and integral vector codegen changes?
It's especially surprising that one would mark [[no_float]] functions that
already don't do floating point. It seems that kernel developers would be
abusing the attribute for its implementation-specific side-effects, instead of
the main purpose. And if one wants to deal with implementation-specific
effects, why should that be in the standard?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
The paper proposes a new function attribute to prevent the generation of
floating point instructions by the compiler, clearly marking such a function.
I like the proposal, it's an interesting evolution.
I just have a few questions to the authors:
1) kernel implementations are usually the opposite: they use no floating
point by default, except in a few specific cases. Is the intention that every
function that doesn't use floating-point be marked? That seems like a recipe
for mistake, as it would be easy to forget to mark a few functions. Would it
be possible to provide a translation-unit-wide marker saying "none of these
functions require floating point"?
2) if there's a TU-wide marker, should there be an inverse attribute
"yes_float" (with a better name)?
3) I'm also not sure the name "no_float" is the best. As you note in point #4
of what it means to use such an attribute, an implementation-defined
consequence is that vectorisation should be suppressed as those use the same
registers as floating point. But that's not the case for all architectures,
x86 32-bit being the prime example. Therefore, "no_float" changing the code
generation for integral / byte-level operations could be surprising. Have you
received any other suggestions for a name? Possibly splitting the behaviour
between FP and integral vector codegen changes?
It's especially surprising that one would mark [[no_float]] functions that
already don't do floating point. It seems that kernel developers would be
abusing the attribute for its implementation-specific side-effects, instead of
the main purpose. And if one wants to deal with implementation-specific
effects, why should that be in the standard?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3924444.JBScVLu4Tn%40tjmaciei-mobl1.
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3924444.JBScVLu4Tn%40tjmaciei-mobl1.