Landing: f6971e28e71e

Project / Subsystem

gcc / gcc

Date

2026-05-28

Author

Roger Sayle

Commit

f6971e28e71eda7f8a1d1247f57ee7f16828864d

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
f6971e28e71eda7f8a1d1247f57ee7f16828864d
source_type
github
headline
x86_64: Improve SSE Code Generation for 128-bit Integer Comparisons
tldr
Enables scalar-to-vector transformation for 128-bit integer comparisons on x86_64 with SSE, resulting in more efficient code.
author
Roger Sayle
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • x86_64
  • sse
  • optimization
  • code generation
  • vectorization
discussion_id_link
bugzilla_pr
date
2026-05-28T00:00:00.000Z

The i386 STV pass has been enhanced to handle SUBREG conversions for TImode values, which allows scalar-to-vector transformation of 128-bit integer comparisons when compiling for x86_64 with SSE. This optimization avoids transferring 128-bit vectors to the scalar unit for equality testing, resulting in significantly more efficient code. For example, comparing two __m128i vectors for equality now uses pxor and ptest instructions, avoiding several move and logical operations.