Add patterns for doing floating point round with various rounding modes
followed by conversion to int as a single FCVT* instruction.
Details
Diff Detail
Event Timeline
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | ||
---|---|---|
2119 | Perhaps, put an assertion at the top of the function: assert((N->getOpcode() == ISD::FP_TO_SINT || N->getOpcode() == ISD::FP_TO_UINT) && "Unexpected opcode!"); Then this logic could be simplified to something like: | |
2124 | I don't think this will ever assert; the const string will always evaluate to true. | |
2131 | Missing FTRUNC. | |
3330 | Maybe a static helper function or fold the logic into the callee? |
Hi Geoff,
Generally, what is stopping this transform being implemented in TableGen? Is it just the generation of the inexact flag?
James
James,
Yes, the FRINTX generation just seemed like a bit too much to do in TableGen (if it is even possible, I didn't try it).
-Geoff
Perhaps, put an assertion at the top of the function:
assert((N->getOpcode() == ISD::FP_TO_SINT || N->getOpcode() == ISD::FP_TO_UINT) && "Unexpected opcode!");
Then this logic could be simplified to something like:
unsigned FpConVariant = N->getOpcode() == ISD::FP_TO_SINT ? 0 : 1;