Add support for casting between fixed point types and integer types, floating point types, or other fixed point types.
Tested casts include implicit casting during assignment, passing as a function argument, returning from a function, and an explicit C style cast.
This patch introduces 6 different cast types: fixed to int, int to fixed, fixed to float, float to fix, fixed to boolean, and fixed to fixed.
Also included are:
- A small fix for a bug where we could parse 0k as a fixed point literal.
- Limit the targets tested on to x86_64-linux when checking LLVM IR. This is done to avoid not capturing extra keywords we did not expect when running these tests on other platforms.
Are these opaque bit-patterns? I think there should be a type which abstracts over constant fixed-point values, something APSInt-like that also carries the signedness and scale. For now that type can live in Clang; if LLVM wants to add intrinsic support for fixed-point, it'll be easy enough to move it there.