Skip to content

Add base2.fixed.div lowering with multiplicative inverse #3

@KFAFSP

Description

@KFAFSP

On closed Z groups, we can implement division by a constant divisor by computing a constant multiplicative inverse that we can multiply a quotient with. This optimization is necessary to achieve good fixed-point division performance, and is common in mainline compilers already.

  • Are there parameters to this process? The precision of the inverse may be adjusted. How does the lowering derive these paramters? (Maybe introduce a base2.fixed.reciprocal operation for this).
  • Implement a lowering from base2.fixed.div (maybe also base2.div) to multiplication for constant rhs terms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions