[cfe-dev] fixed point notation in clang

Bevin Hansson via cfe-dev cfe-dev at lists.llvm.org
Tue Nov 24 01:01:36 PST 2015


On 11/11/2015 11:52 AM, Fabio Gritti via cfe-dev wrote:
> Hi, we are trying to implement in the LLVM/Clang framework the fixed 
> point notation as specified in the ISO/IEC TR 18037 
> (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf ).
>
> Do you know if there is anybody working on this? If not, do you have 
> any advice or idea for the implementation of the non-saturating part?
>
We have been working on implementing support for fixed-point in LLVM and 
Clang for our proprietary target which is programmed in DSP-C, the 
precursor of Embedded C. We initially attempted to implement this by 
modifying the existing integer type to support a scaling factor, but 
this turned out to be an unwieldy solution.

We are currently working on adding support for DSP-C to Clang. As you 
mentioned, mailing list recommendations have been to use existing 
integer types for fixed-point operations and intrinsics for saturation. 
This is the approach we have chosen, but we have decided to implement 
multiplication and division of fixed-point numbers with intrinsics as 
well in order to simplify instruction selection.

We would be happy to trade ideas about the subject with you and work out 
a solution that would be acceptable by the larger LLVM community.

Regards,
Bevin



More information about the cfe-dev mailing list