[PATCH] x86: Check XMM destination when optimizing 128-bit VPBROADCASTQ

Project / Subsystem

binutils / x86

Date

2026-05-27

Proposer

H.J. Lu <hjl.tools@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

All attributes

project
binutils
subsystem
x86
patch_id
discussion_id
CAMe9rOqfwneN-54vwwLez0_YGTBn88NuzCzL9=N4h5kio2mVJQ@mail.gmail.com
source_type
public_inbox
title
[PATCH] x86: Check XMM destination when optimizing 128-bit VPBROADCASTQ
headline
x86: Fix VPBROADCASTQ optimization in assembler
tldr
The assembler incorrectly optimizes `vpbroadcastq` with a YMM destination; this patch fixes it by checking for an XMM destination.
proposer
H.J. Lu <hjl.tools@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
[]
series_id
series_role
standalone
series_parts
[]
tags
  • x86
  • assembler
  • optimization
  • VPBROADCASTQ
  • VPUNPCKLQDQ
bugzilla_url
date
2026-05-27T00:00:00.000Z

[PATCH] x86: Check XMM destination when optimizing 128-bit VPBROADCASTQ

H.J. Lu provides a patch that fixes an incorrect optimization in the x86 assembler. The original optimization of vpbroadcastq %xmmN, %xmmM to vpunpcklqdq %xmmN, %xmmN, %xmmM didn’t check if the destination was an XMM register, leading to incorrect code generation when the destination was a YMM register. The patch adds this check.