Luc Forget 95fbc18a70
[MLIR][Wasm] Extending Wasm binary to WasmSSA dialect importer (#154452)
This is a cherry pick of #154053 with a fix for bad handling of
endianess when loading float and double litteral from the binary.

---------

Co-authored-by: Ferdinand Lemaire <ferdinand.lemaire@woven-planet.global>
Co-authored-by: Jessica Paquette <jessica.paquette@woven-planet.global>
Co-authored-by: Luc Forget <luc.forget@woven.toyota>
2025-08-20 10:55:55 +02:00

28 lines
762 B
MLIR

// RUN: yaml2obj %S/inputs/shl.yaml.wasm -o - | mlir-translate --import-wasm | FileCheck %s
/* Source code used to generate this test:
(module
(func (export "shl_i32") (result i32)
i32.const 10
i32.const 3
i32.shl)
(func (export "shl_i64") (result i64)
i64.const 10
i64.const 3
i64.shl)
)
*/
// CHECK-LABEL: wasmssa.func @shl_i32() -> i32 {
// CHECK: %0 = wasmssa.const 10 : i32
// CHECK: %1 = wasmssa.const 3 : i32
// CHECK: %2 = wasmssa.shl %0 by %1 bits : i32
// CHECK: wasmssa.return %2 : i32
// CHECK-LABEL: wasmssa.func @shl_i64() -> i64 {
// CHECK: %0 = wasmssa.const 10 : i64
// CHECK: %1 = wasmssa.const 3 : i64
// CHECK: %2 = wasmssa.shl %0 by %1 bits : i64
// CHECK: wasmssa.return %2 : i64