I want to be able to specify this, but only for a specific user
instruction.
Details
- Reviewers
RKSimon craig.topper efriedma spatel
Diff Detail
Event Timeline
Just add an opcode field to be sure it's only used here. It's a lot simpler patch and sufficient for my needs rather than updating all of the individual places this is needed
Given its limited use I don't see why we shouldn't just update the existing isFPExtFree to take Opcode, SrcVT and DstVT - all of which may be useful.
The problem with the opcode is this does have a caller from the IR path from codegenprepare (although this feature doesn't seem to be hit by any tests in tree), so there needs to at least be a different one for that. Adding the other VT just makes this messier, since now it is more context dependent.
We should provide both the source and destination VT for any query like this... should be easy to provide even on the IR path.
But anyway, there's a difference between a free fp-extend (like on PowerPC or x87, where the value actually doesn't require a conversion at all), and an fp-extend which can be folded into other arithmetic operations. It probably doesn't make sense to make them use the same API. That said, the version checking whether an extend is foldable should probably have a different name.
It would appear to me that the PPC-only portion of this is NFC since it'll still return true for any floating point destination type. So I would say that the PPC back end is fine with those (as long as the assert gets a message :)).
However, shouldn't this patch have a test case?
Add assertion message