Landing: 5c55e923bcf1

Project / Subsystem

gcc / s390

Date

2026-07-01

Author

Stefan Schulze Frielinghaus

Commit

5c55e923bcf191dbfdf65467b04e21c27adba1d6

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
s390
patch_id
commit_hash
5c55e923bcf191dbfdf65467b04e21c27adba1d6
source_type
github
headline
s390: Correct bitmasks for bit extraction instructions
tldr
Fixes incorrect bitmask generation for s390's RISBG instruction when used for bit extraction with shifts.
author
Stefan Schulze Frielinghaus
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • s390
  • instruction selection
  • bugfix
discussion_id_link
bugzilla_pr
date
2026-07-01T00:00:00.000Z

This commit corrects an issue on the s390 architecture where the compiler generated incorrect bitmasks for the *extzv_<mode>_{srl,sll}<clobbercc_or_nocc> patterns. These patterns are intended to be implemented by the RISBG instruction, which performs a left rotate. However, the original code did not properly adjust the bitmask to account for the rotated bits, leading to incorrect results when the vacated bits of a shift operation were supposed to be zero. This fix modifies the output templates to use the correct bitmasks, ensuring accurate bit extraction and aligning behavior with the expected zeroing of vacated bits.