Bug: https://llvm.org/bugs/show_bug.cgi?id=24549
- Softening support of f16 was never finished, really. Always promote f16 to f32. If f32 is not legal, rely on f32 legalization after promotion.
- Update SoftenFloatRes_FP_EXTEND to look for a promoted operand if the operand's type action is to promote.
- Add the test case from the linked bug.
Ideally, we should test all the cases in
test/CodeGen/ARM/fp16-promote.ll with -vfp2. Doing that needs extra
work:
- some functions in this test don't compile
- all the functions need a new set of CHECKs for when both f32 and f16 are illegal.
IIUC, this means we'll do something like:
even though __gnu_h2f_ieee expects uint16_t. On ARM uint16_t will get promoted to i32, but now we're interpreting a full f32-softened-to-i32 as an i16-promoted-to-i32, no?
Doesn't this mean it's possible to get stuff like:
by legalizing:
?