Skip to content

Extend and backport SubNode peephole - #254

Merged
cliffclick merged 3 commits into
SeaOfNodes:mainfrom
fuhsnn:sub-peephole
Sep 25, 2026
Merged

cliffclick merged 3 commits into
SeaOfNodes:mainfrom
fuhsnn:sub-peephole

Conversation

@fuhsnn

@fuhsnn fuhsnn commented Sep 25, 2026

Copy link
Copy Markdown
Contributor
  • Add two subtraction peephole patterns, (x - 0) == x and (0 - x) == -x.
  • Backport two existing patterns added in ch10 to ch4.
  • Add corresponding tests and documentation.

fuhsnn and others added 3 commits September 25, 2026 11:27
Require resolved integer mode in chapter 25 so zero subtraction preserves floating-point signed zero. Keep nonnumeric operands in the graph for subtraction diagnostics.

Add signed-zero coverage from chapter 12 and null-subtraction diagnostics from chapter 22. Confirmed the regressions fail on the original PR. Full Make suites pass in chapters 4-25 (5462 tests), including fresh chapter 25 sys.o compilation.

@cliffclick cliffclick left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Includes corrections for null-0 and flt-zero sign flippage

@cliffclick
cliffclick merged commit dd907c2 into SeaOfNodes:main Sep 25, 2026
0 of 2 checks passed
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.

2 participants