Landing: 28f6899c51c4

Project / Subsystem

gcc / match-sat-alu.pd

Date

2026-09-05

Author

Kyrylo Tkachov

Commit

28f6899c51c456302943d549ab78d9bb022f36d8

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match-sat-alu.pd
patch_id
—
commit_hash
28f6899c51c456302943d549ab78d9bb022f36d8
source_type
github
headline
Recognize complement tests for unsigned saturating addition.
tldr
GCC can now recognize complement tests for unsigned saturating addition, optimizing it to a single instruction on AArch64.
author
Kyrylo Tkachov
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • aarch64
  • • vectorization
discussion_id_link
—
bugzilla_pr
—
date
2026-09-05T00:00:00.000Z

The match-sat-alu.pd pattern matching has been extended to recognize comparisons involving the complement of an operand for unsigned saturating addition. This allows the compiler to replace code like X > ~Y ? MAX : X + Y with a single uqadd instruction on AArch64, reducing four vector operations to one.