Landing: 8363c2392832

Project / Subsystem

gcc / gcc

Date

2026-07-03

Author

Jeff Law

Commit

8363c2392832a6600e49d4ac8361bf3e2052601b

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
8363c2392832a6600e49d4ac8361bf3e2052601b
source_type
github
headline
Utilize shNadd.uw during ADD synthesis
tldr
Enhances RISC-V ADD instruction synthesis by using the shNadd.uw instruction for specific constants.
author
Jeff Law
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • RISC-V
  • optimization
  • code generation
discussion_id_link
bugzilla_pr
date
2026-07-03T00:00:00.000Z

This patch improves the GCC compiler’s code generation for RISC-V architectures by enabling the use of the shNadd.uw instruction during the synthesis of addition operations. This instruction is particularly useful for additions involving constants where a shifted zero-extended value is involved. The change allows for more efficient instruction sequences, replacing a sequence of li and slli.uw with a single sh1add.uw for certain constants, such as src + 0x1ffffe000.