Skip to content

Non-fatal 'error' with global_asm "instruction requires: AVX-512 ISA" on target that supports AVX-512 #50477

Closed
@gamozolabs

Description

@gamozolabs

This is a weird issue that seems to only affect optimized builds.

Building this with nightly via rustc -C target-cpu=knl -O src\main.rs produces errors, however this does not stop compilation and allows an executable to be produced. The resultant executable appears to be correct as to what is expected.

Building with rustc -C target-cpu=knl src\main.rs (no optimizations) prints no errors and works as expected.

Tested on x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu systems running rustc 1.27.0-nightly (f9bfe840f 2018-05-05)

#![feature(global_asm)]

/// This triggers an error from the compiler (assembler?)
/// however it does not seem to be fatal enough to stop
/// the program from building. This error only occurs with
/// optimizations enabled
///
/// C:\dev\rust_test>rustc -C target-cpu=knl -O src\main.rs
/// error: instruction requires: AVX-512 ISA
///     kmovw k3, eax
///     ^
/// error: instruction requires: AVX-512 ISA
///     kmovw k3, eax
///     ^
/// 
/// C:\dev\rust_test>rustc -C target-cpu=knl src\main.rs
/// 
/// C:\dev\rust_test>rustc -V
/// rustc 1.27.0-nightly (f9bfe840f 2018-05-05)

global_asm!(r#"
    .intel_syntax

    kmovw k3, eax

    .att_syntax
"#);

fn main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-SIMDArea: SIMD (Single Instruction Multiple Data)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions