Skip to content

Missing warning about target_feature when using for core::arch::x86_64 functions #74028

@tesuji

Description

@tesuji

I tried this code: https://rust.godbolt.org/z/b9A7oP

extern crate core;

use core::arch::x86_64::__m128;
use core::arch::x86_64::_mm_extract_ps;
use core::arch::x86_64::_mm_hadd_ps;

pub unsafe fn add_reduce(a: __m128, b: __m128) -> f32 {
    let c = _mm_hadd_ps(a, b);
    f32::from_bits(_mm_extract_ps(c, 0) as u32)
}

I expect to see this happens: rustc lint about missing target_feature in add_reduce when using _mm_extract_ps.

Instead this happen: There is no warning and functions are not inlined.

Meta

  • rustc 1.46.0-nightly (3503f56 2020-07-02) x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions