Skip to content

Add design document for division simplification in XLS.#4091

Draft
copybara-service[bot] wants to merge 1 commit intomainfrom
test_896714607
Draft

Add design document for division simplification in XLS.#4091
copybara-service[bot] wants to merge 1 commit intomainfrom
test_896714607

Conversation

@copybara-service
Copy link
Copy Markdown

Add design document for division simplification in XLS.

This document outlines a design for simplifying division operations where the divisor takes a small set of values, using PartialInfoQueryEngine to analyze possible divisor values. The design covers cases where divisors are powers of two, general constants, or a hybrid mix, and suggests implementation in three phases. Divisions by powers of two can be simplified to either a shift-by-encode or to division by constants (which will later be reduced to shifts by constants), while divisions by general values can be simplified to division by constants (which will later be reduced to multiply-and-shift form).

This document outlines a design for simplifying division operations where the divisor takes a small set of values, using PartialInfoQueryEngine to analyze possible divisor values. The design covers cases where divisors are powers of two, general constants, or a hybrid mix, and suggests implementation in three phases. Divisions by powers of two can be simplified to either a shift-by-encode or to division by constants (which will later be reduced to shifts by constants), while divisions by general values can be simplified to division by constants (which will later be reduced to multiply-and-shift form).

PiperOrigin-RevId: 896714607
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant