Landing: 49e640dc4675

Project / Subsystem

gcc / match-sat-alu.pd

Date

2026-08-21

Author

Kyrylo Tkachov

Commit

49e640dc4675de1f48166906a11950cb6698e77f

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
match-sat-alu.pd
patch_id
—
commit_hash
49e640dc4675de1f48166906a11950cb6698e77f
source_type
github
headline
match-sat-alu.pd: Recognize signed saturating truncation after a shift
tldr
GCC now optimizes signed saturating truncation that follows an arithmetic right shift, simplifying code.
author
Kyrylo Tkachov
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • gcc
  • • aarch64
discussion_id_link
—
bugzilla_pr
—
date
2026-08-21T00:00:00.000Z

GCC’s match-sat-alu.pd pattern matcher can now recognize and optimize signed saturating truncation that occurs after an arithmetic right shift. This optimization allows the saturation value to use the original input while the shift operates on the already shifted value. This can simplify complex code sequences, such as an AArch64 example that reduces to a single SQSHRN instruction.