Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new #[target_feature = "..."] attribute. #38079

Merged
merged 1 commit into from
Dec 3, 2016

Commits on Nov 30, 2016

  1. Add new #[target_feature = "..."] attribute.

    This commit adds a new attribute that instructs the compiler to emit
    target specific code for a single function. For example, the following
    function is permitted to use instructions that are part of SSE 4.2:
    
        #[target_feature = "+sse4.2"]
        fn foo() { ... }
    
    In particular, use of this attribute does not require setting the
    -C target-feature or -C target-cpu options on rustc.
    
    This attribute does not have any protections built into it. For example,
    nothing stops one from calling the above `foo` function on hosts without
    SSE 4.2 support. Doing so may result in a SIGILL.
    
    This commit also expands the target feature whitelist to include lzcnt,
    popcnt and sse4a. Namely, lzcnt and popcnt have their own CPUID bits,
    but were introduced with SSE4.
    BurntSushi committed Nov 30, 2016
    Configuration menu
    Copy the full SHA
    80ef1db View commit details
    Browse the repository at this point in the history