Set this on any source level floating-point type argument,
return value, call return or outgoing parameter which is lowered
to a valid IR type for the attribute. Currently this isn't
applied to emitted intrinsics since those don't go through
ABI code.
Details
Diff Detail
Event Timeline
clang/lib/CodeGen/CGCall.cpp | ||
---|---|---|
2212 | Clang doesn't have support for -f[no-]signaling-nans yet, but the gcc documentation for the option states:
This strikes me as saying that sNaNs are treated as qNaN (akin to the nsz fast-math flag) rather than saying that it's UB to have sNaN as a value, thus, I don't think it makes sense for -fno-signaling-nans to translate into a nofpclass attribute. |
(Sounds reasonable conceptually, but I'm not familiar enough with clang codegen for the details.)
I'm generally okay with the approach of this patch. I'm not sufficiently well-versed in the clang codegen side of things to know if this covers all of the bases, and I'd appreciate someone who is familiar with that side of things to approve this patch.
I'm in the same boat as @nikic -- the patch looks reasonable in principle, but I'm not familiar with the nuanaces of FP codegen.
Looks fine from a codegen perspective, assuming these are the semantics we want for -ffinite-math-only.
clang/lib/CodeGen/CGCall.cpp | ||
---|---|---|
3052 | What cases does this cover that aren't already covered by the code in CodeGenModule::ConstructAttributeList? |
Clang doesn't have support for -f[no-]signaling-nans yet, but the gcc documentation for the option states:
This strikes me as saying that sNaNs are treated as qNaN (akin to the nsz fast-math flag) rather than saying that it's UB to have sNaN as a value, thus, I don't think it makes sense for -fno-signaling-nans to translate into a nofpclass attribute.