[PATCH] D24011: [ConstantFold] Add a flag for ppc_fp128 constant folding, since APFloat doesn't support double-double semantic

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 17:38:34 PDT 2016


iteratee added a comment.

> Yes, but Hubert is right. To fully make this change, you'll need to disable constexpr evaluation of long doubles in Clang also (which I suspect might make it non-conforming).


An incorrect frontend behavior isn't a good justification for keeping an incorrect backend behavior.

> In the end, I don't think that going for the easy fix here is all that useful. We'll need to invest the time to making an APFloat-based double-double implementation and use that for constant folding.


Correctness is its own reward.
As a plus, this patch doesn't interfere with someone else adding double double support to APFloat and using that in both the frontend and the backend.

> If the implementations in compiler-rt/lib/builtins/ppc/gcc_q*.c are good, then we could base the implementation, algorithmically, on those.


Yes, that would be the way forward.

I think the important question here is if this patch is an improvement on the way to the best solution you've outlined here.
Tim and I both think that is.


https://reviews.llvm.org/D24011





More information about the llvm-commits mailing list