Skip to content

Improve XLS C++ synthesis-only fixed-point and integer library correctness and performance. - #4744

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_962222249
Draft

Improve XLS C++ synthesis-only fixed-point and integer library correctness and performance.#4744
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_962222249

Conversation

@copybara-service

Copy link
Copy Markdown

Improve XLS C++ synthesis-only fixed-point and integer library correctness and performance.

This CL optimizes and fixes several issues in the xls_fixed and xls_int synthesis-only headers:

  • Replaces per-bit loops with slice operations to prevent O(W^2) IR node generation during synthesis.
  • Fixes operand width calculations for division to correctly handle signed/unsigned mismatches.
  • Implements the modulo (%) and modulo-assign (%=) operators for XlsInt.
  • Restricts implicit conversions to 64-bit built-in types for XlsInt types wider than 64 bits.
  • Adds support for set_val() and ac::init_array() to initialize fixed-point and integer arrays with special values (zero, quantum, min, max).
  • Adds shift operators taking plain int offsets.
  • Adds comprehensive unit tests covering rounding, saturation, division, modulo, and array initialization.

…tness and performance.

This CL optimizes and fixes several issues in the xls_fixed and xls_int synthesis-only headers:
- Replaces per-bit loops with slice operations to prevent O(W^2) IR node generation during synthesis.
- Fixes operand width calculations for division to correctly handle signed/unsigned mismatches.
- Implements the modulo (%) and modulo-assign (%=) operators for XlsInt.
- Restricts implicit conversions to 64-bit built-in types for XlsInt types wider than 64 bits.
- Adds support for set_val() and ac::init_array() to initialize fixed-point and integer arrays with special values (zero, quantum, min, max).
- Adds shift operators taking plain int offsets.
- Adds comprehensive unit tests covering rounding, saturation, division, modulo, and array initialization.

PiperOrigin-RevId: 962222249
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