This patch proposes an abstract type that represents fixed point numbers, similar to APInt or APSInt that was discussed in https://reviews.llvm.org/D48456#inline-425585. This type holds a value, scale, and saturation and is meant to perform intermediate calculations on constant fixed point values.
Currently this class is used as a way for handling the conversions between fixed point numbers with different sizes and radixes. For example, if I'm casting from a signed _Accum to a saturated unsigned short _Accum, I will need to check the value of the signed _Accum to see if it fits into the short _Accum which involves getting and comparing against the max/min values of the short _Accum. The FixedPointNumber class currently handles the radix shifting and extension when converting to a signed _Accum.
Please forward-declare FixedPointSemantics and APFixedPoint instead of including them here. This file is #included into almost the entire project, but relatively few files will actually need to use any of the functionality of APFixedPoint. Among other things, it will make your life much happier bringing up this feature if every tiny change to the APFixedPoint interface doesn't force a full recompile.