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

Cranelift: load.f32x2 unimplemented on x86_64 #8075

Open
bjorn3 opened this issue Mar 9, 2024 · 2 comments
Open

Cranelift: load.f32x2 unimplemented on x86_64 #8075

bjorn3 opened this issue Mar 9, 2024 · 2 comments
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Mar 9, 2024

Thanks for filing an issue! Please fill out the TODOs below.

.clif Test Case

function u0:0(f32x2) -> f32x2 system_v {
    ss0 = explicit_slot 16
    ss1 = explicit_slot 16
    sig0 = (f32) -> f32 system_v
    fn0 = u0:1 sig0 ; "cosf"

block0(v0: f32x2):
    stack_store v0, ss1

; _0 = simd_fcos::<f32x2>(move _1)
    v1 = stack_load.f32 ss1
    v2 = call fn0(v1) ; lib_call cosf
    stack_store v2, ss0
    v3 = stack_load.f32 ss1+4
    v4 = call fn0(v3) ; lib_call cosf
    stack_store v4, ss0+4

    v5 = stack_load.f32x2 ss0
    return v5
}

Steps to Reproduce

  • Compile on x86_64

Expected Results

Compiles

Actual Results

thread '<unnamed>' panicked at /home/bjorn/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cranelift-codegen-0.105.2/src/machinst/lower.rs:766:21:
should be implemented in ISLE: inst = `v5 = load.f32x2 notrap v11`, type = `Some(types::F32X2)`
stack backtrace:
   0: rust_begin_unwind
             at /rustc/46b180ec2452d388c5d9c14009442e2e0beb01d7/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/46b180ec2452d388c5d9c14009442e2e0beb01d7/library/core/src/panicking.rs:72:14
   2: cranelift_codegen::machinst::compile::compile
   3: <cranelift_codegen::isa::x64::X64Backend as cranelift_codegen::isa::TargetIsa>::compile_function
   4: cranelift_codegen::context::Context::compile_stencil
   5: cranelift_codegen::context::Context::compile_and_emit
   6: <cranelift_object::backend::ObjectModule as cranelift_module::module::Module>::define_function_with_control_plane
   7: cranelift_module::module::Module::define_function
   8: rustc_codegen_cranelift::base::compile_fn

Versions and Environment

Cranelift version or commit: Cranelift 1.105.2

Operating system: N/A

Architecture: x86_64

Extra Info

Anything else you'd like to add?

@bjorn3 bjorn3 added bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator labels Mar 9, 2024
@bjorn3
Copy link
Contributor Author

bjorn3 commented Mar 9, 2024

I haven't checked if store.f32x2 works. load.f32x2 does work on AArch64.

@cfallin
Copy link
Member

cfallin commented Mar 10, 2024

Thanks for reporting! I suspect you'll find a bunch more holes with "narrow SIMD" (64-bit vectors) on x86 -- this mostly exists only on aarch64 for now. As with other missing implementations, we'd be happy to take a PR from anyone and this could make a decent starter issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

No branches or pull requests

2 participants