This is an archive of the discontinued LLVM Phabricator instance.

Add a class for fixed point arithmetic
Needs ReviewPublic

Authored by evstupac on Aug 18 2017, 1:42 PM.

Details

Reviewers
scanon
sanjoy
Summary

The patch add FixedPoint64 class for unsigned fixed point arithmetic and corresponding tests.
The new class will be used to update https://reviews.llvm.org/D30527.
I've skipped signed arithmetic, because the class is supposed to be used to work with probabilities and costs.
For now point is fixed in the middle [32 bits].[32 bits], which makes calculations simple and fast.

Diff Detail

Event Timeline

evstupac created this revision.Aug 18 2017, 1:42 PM

You mention "For now point is fixed in the middle [32 bits].[32 bits], which makes calculations simple and fast.". Perhaps this should be commented in the code as well.

sanjoy resigned from this revision.Jan 29 2022, 5:33 PM