← Back to Pull requests

Fix VPBROADCASTM instruction feature gating #847

Closed
unknown closed this pull request without merging on Aug 28, 2026 18:54 UTC
View on GitHub
unknown unknown commented on Aug 28, 2026 18:50 UTC
Author

Problem

VPBROADCASTMB2Q and VPBROADCASTMW2D require AVX512CD for their
512-bit forms. Their 128- and 256-bit forms additionally require
AVX512VL. The instructions are also available through AVX10.1.

Both Bochs opcode declarations currently use BX_ISA_AVX512, the base
AVX512F feature, as their guard. Consequently, decoder initialization
retains their execution handlers on a processor configuration that
provides AVX512F but not AVX512CD, even though the instructions should
raise #UD.

For example:

CPU model:        corei7_skylake_x
excluded feature: avx512cd
AVX512F:          enabled
AVX512CD:         disabled

62 f2 fe 48 2a c1    vpbroadcastmb2q zmm0, k1
62 f2 7e 48 3a c1    vpbroadcastmw2d zmm0, k1

expected: #UD for both instructions
before:   both use the base AVX512F decoder guard

Fix

Use BX_ISA_AVX512_CD as the feature guard for both VPBROADCASTM
opcode declarations.

This makes decoder availability agree with the architectural AVX512CD
requirement. The decoder's existing AVX10.1 fallback remains applicable
to the corrected feature guard.

Architectural reference

The Intel® 64 and IA-32 Architectures Software Developer’s Manual,
Volume 2C, section “VPBROADCASTM—Broadcast Mask to Vector Register,”
lists AVX512CD for the 512-bit forms and AVX512VL together with
AVX512CD for the 128- and 256-bit forms. AVX10.1 is listed as the
alternative feature path.

  • Intel® 64 and IA-32 Architectures Software Developer’s Manual

  • Intel® Software Developer Manuals download page
  • Validation

    The affected 32- and 64-bit decoder objects were forcibly rebuilt,
    followed by a successful full Bochs relink:

    make -C bochs/cpu -B decoder/fetchdecode32.o decoder/fetchdecode64.o
    make -C bochs -j2
    

    A temporary long-mode probe selected corei7_skylake_x, excluded
    avx512cd while retaining AVX512F, enabled opmask and ZMM state in
    XCR0, and executed both 512-bit instruction encodings.

    After the fix:

    VPBROADCASTMB2Q=#UD
    VPBROADCASTMW2D=#UD
    BV:DONE status=pass
    

    AVX10.1 alternative remains functional: with AVX512CD disabled but avx10_1 added, both instructions execute after the patch.

    Diff: 298 lines (+223 / -75) across 3 files Reviewer: stlintel Review duration: 4m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 298 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 54% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #847"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40% (MEDIUM) · Higher = larger blast radius
    40%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.5% · Lower = rushed or shallow review
    44.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.2% · Safe to merge
    22.2%