[PATCH 1/2] x86: correct implied-AVX512VL checking
Project / Subsystem
binutils / x86
Date
2026-07-17
Proposer
Jan Beulich <jbeulich@suse.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • Accurately checking implied CPU features prevents incorrect instruction generation but adds complexity to the assembler's parsing logic.
- • The fix ensures that instructions requiring AVX512VL are only generated when appropriate, preventing potential runtime errors or incorrect behavior.
All attributes
- project
- binutils
- subsystem
- x86
- patch_id
- —
- discussion_id
- 0b12f559-3206-4cfe-ae6d-f74035af8473@suse.com
- source_type
- public_inbox
- title
- [PATCH 1/2] x86: correct implied-AVX512VL checking
- headline
- x86: correct implied-AVX512VL checking
- tldr
- Fixes assembler logic that incorrectly bypassed operand size checks for instructions implicitly using AVX512VL.
- proposer
- Jan Beulich <jbeulich@suse.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • Accurately checking implied CPU features prevents incorrect instruction generation but adds complexity to the assembler's parsing logic.
- • The fix ensures that instructions requiring AVX512VL are only generated when appropriate, preventing potential runtime errors or incorrect behavior.
- series_id
- binutils:x86: correct implied-avx512vl checking
- series_role
- reply
- series_parts
- []
- tags
-
- • binutils
- • x86
- • AVX
- • assembler
- • compiler
- bugzilla_url
- —
- date
- 2026-07-17T00:00:00.000Z
[PATCH 1/2] x86: correct implied-AVX512VL checking
This patch corrects an issue in the GNU assembler’s x86 backend where operand size checks for instructions that implicitly use AVX512VL were being bypassed. The check_VecOperands function was not correctly considering both t->cpu and t->cpu_any when determining if AVX512VL was implied. This led to incorrect assembly of instructions that require AVX512VL, even when it wasn’t explicitly enabled or when incorrect operand sizes were used. The patch modifies the logic to OR the CPU flags from both t->cpu and t->cpu_any before ANDing with avx512, and also corrects the check for cpu.bitfield.cpuavx512vl.