Skip to content

x86-64: Some extern "C" functions use U64x2 on a softfloat target, which makes no sense #758

Closed
@RalfJung

Description

@RalfJung

Passing U64x2 across an extern "C" boundary on x86-64 requires SSE; it is hence not possible to pass those types when SSE is disabled, which is the case for softfloat targets. (See rust-lang/rust#116558 for more context on how ABI and SIMD target features interact.) This comes up, for instance, when building for x86_64-unknown-uefi.

Here are the places where a SIMD type is passed via extern "C":

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/float/conv.rs:395:1
    |
395 | / intrinsics! {
396 | |     #[arm_aeabi_alias = __aeabi_f2uiz]
397 | |     pub extern "C" fn __fixunssfsi(f: f32) -> u32 {
398 | |         float_to_unsigned_int(f)
...   |
443 | | }
    | |_- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: `#[warn(abi_unsupported_vector_types)]` on by default
    = note: this warning originates in the macro `intrinsics` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/float/conv.rs:395:1
    |
395 | / intrinsics! {
396 | |     #[arm_aeabi_alias = __aeabi_f2uiz]
397 | |     pub extern "C" fn __fixunssfsi(f: f32) -> u32 {
398 | |         float_to_unsigned_int(f)
...   |
443 | | }
    | |_- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: this warning originates in the macro `intrinsics` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/float/conv.rs:446:1
    |
446 | / intrinsics! {
447 | |     #[arm_aeabi_alias = __aeabi_f2iz]
448 | |     pub extern "C" fn __fixsfsi(f: f32) -> i32 {
449 | |         float_to_signed_int(f)
...   |
494 | | }
    | |_- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: this warning originates in the macro `intrinsics` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/int/sdiv.rs:168:1
    |
168 |   sdiv!(__udivti3, __divti3, u128, i128, win64_128bit_abi_hack);
    |   ------------------------------------------------------------- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: this warning originates in the macro `intrinsics` which comes from the expansion of the macro `sdiv` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/int/sdiv.rs:169:1
    |
169 |   smod!(__umodti3, __modti3, u128, i128, win64_128bit_abi_hack);
    |   ------------------------------------------------------------- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: this warning originates in the macro `intrinsics` which comes from the expansion of the macro `smod` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this function definition uses a SIMD vector type that (with the chosen ABI) requires the `sse` target feature, which is not enabled
   --> src/macros.rs:260:13
    |
260 | /             extern $abi fn $name( $($argname: $ty),* )
261 | |                 -> $crate::macros::win64_128bit_abi_hack::U64x2
    | |_______________________________________________________________^ function defined here
    |
   ::: src/int/udiv.rs:7:1
    |
7   | / intrinsics! {
8   | |     #[maybe_use_optimized_c_shim]
9   | |     #[arm_aeabi_alias = __aeabi_uidiv]
10  | |     /// Returns `n / d`
...   |
106 | | }
    | |_- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #116558 <https://github.com/rust-lang/rust/issues/116558>
    = help: consider enabling it globally (`-C target-feature=+sse`) or locally (`#[target_feature(enable="sse")]`)
    = note: this warning originates in the macro `intrinsics` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions