Skip to content

--memory64-lowering is not compatible with SIMD #4638

Description

@sbc100

If I take a simple SIMD test from emscripten and build with MEMORY64=2 (lowering) I get errors like this one:

$ wasm-opt --memory64-lowering --strip-producers in.wasm -o out.wasm -g --mvp-features --enable-simd --enable-memory64
[wasm-validator error in function main] i64 != i32: load_splat address must match memory index type, on 
(v128.load8_splat offset=79
 (local.get $4)
)
Fatal: error after opts

Without --memory64-lowering the above command work. I've attached in.wasm.

in.wasm.zip

Activity

  1. warvstar commented on Jan 1, 2024

    @warvstar

    I'm currently running into this issue. Do you know how much work might be involved to fix this?

  2. kripken commented on Jan 2, 2024

    @kripken
    Member

    @warvstar it's a small amount of work per SIMD instruction, I believe. For example for SIMDLoad this would work, which is basically the same as for a normal Load,

      void visitSIMDLoad(SIMDLoad* curr) { wrapAddress64(curr->ptr, curr->memory); }

    (and a test should be added here). There are a number of SIMD instructions, so covering them all is where most of the work is.

  3. RAIHERE commented on Aug 30, 2025

    @RAIHERE

    @warvstar it's a small amount of work per SIMD instruction, I believe. For example for SIMDLoad this would work, which is basically the same as for a normal Load,

    void visitSIMDLoad(SIMDLoad* curr) { wrapAddress64(curr->ptr, curr->memory); }
    (and a test should be added here). There are a number of SIMD instructions, so covering them all is where most of the work is.

  4. changed the title [-]simd seem to break --memory64-lowering[/-] [+]--memory64-lowering is not compatible with SIMD[/+] on Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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