From 88da7cb18256447a8216804319d15189f8c4ec79 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 25 Dec 2023 17:07:44 +0100 Subject: [PATCH] feat: pass all i32 tests Signed-off-by: Henry --- crates/tinywasm/src/runtime/executor/mod.rs | 2 + crates/tinywasm/tests/generated/mvp.csv | 2 +- .../tinywasm/tests/generated/progress-mvp.svg | 6 +- examples/wast/i32.wast | 985 ------------------ examples/wast/i64.wast | 494 +++++++++ 5 files changed, 500 insertions(+), 989 deletions(-) delete mode 100644 examples/wast/i32.wast create mode 100644 examples/wast/i64.wast diff --git a/crates/tinywasm/src/runtime/executor/mod.rs b/crates/tinywasm/src/runtime/executor/mod.rs index fced5c2..9eb6cdb 100644 --- a/crates/tinywasm/src/runtime/executor/mod.rs +++ b/crates/tinywasm/src/runtime/executor/mod.rs @@ -352,6 +352,8 @@ fn exec_one( F32ConvertI64U => conv_2!(i64, u64, f32, stack), F64ConvertI32U => conv_2!(i32, u32, f64, stack), F64ConvertI64U => conv_2!(i64, u64, f64, stack), + I32Extend8S => conv_2!(i32, i8, i32, stack), + I32Extend16S => conv_2!(i32, i16, i32, stack), I64ExtendI32U => conv_2!(i32, u32, i64, stack), I64ExtendI32S => conv_1!(i32, i64, stack), I32WrapI64 => conv_1!(i64, i32, stack), diff --git a/crates/tinywasm/tests/generated/mvp.csv b/crates/tinywasm/tests/generated/mvp.csv index cca8a3a..22fbc2a 100644 --- a/crates/tinywasm/tests/generated/mvp.csv +++ b/crates/tinywasm/tests/generated/mvp.csv @@ -1,4 +1,4 @@ 0.0.3,9258,7567,[{"name":"address.wast","passed":0,"failed":54},{"name":"align.wast","passed":0,"failed":109},{"name":"binary-leb128.wast","passed":66,"failed":25},{"name":"binary.wast","passed":104,"failed":8},{"name":"block.wast","passed":0,"failed":171},{"name":"br.wast","passed":0,"failed":21},{"name":"br_if.wast","passed":0,"failed":30},{"name":"br_table.wast","passed":0,"failed":25},{"name":"call.wast","passed":0,"failed":22},{"name":"call_indirect.wast","passed":0,"failed":56},{"name":"comments.wast","passed":4,"failed":4},{"name":"const.wast","passed":702,"failed":76},{"name":"conversions.wast","passed":0,"failed":93},{"name":"custom.wast","passed":10,"failed":1},{"name":"data.wast","passed":0,"failed":61},{"name":"elem.wast","passed":0,"failed":76},{"name":"endianness.wast","passed":0,"failed":1},{"name":"exports.wast","passed":21,"failed":73},{"name":"f32.wast","passed":1005,"failed":1509},{"name":"f32_bitwise.wast","passed":1,"failed":363},{"name":"f32_cmp.wast","passed":2401,"failed":6},{"name":"f64.wast","passed":1005,"failed":1509},{"name":"f64_bitwise.wast","passed":1,"failed":363},{"name":"f64_cmp.wast","passed":2401,"failed":6},{"name":"fac.wast","passed":0,"failed":2},{"name":"float_exprs.wast","passed":269,"failed":591},{"name":"float_literals.wast","passed":34,"failed":129},{"name":"float_memory.wast","passed":0,"failed":6},{"name":"float_misc.wast","passed":138,"failed":303},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":4,"failed":75},{"name":"func_ptrs.wast","passed":0,"failed":16},{"name":"global.wast","passed":4,"failed":49},{"name":"i32.wast","passed":0,"failed":96},{"name":"i64.wast","passed":0,"failed":42},{"name":"if.wast","passed":0,"failed":118},{"name":"imports.wast","passed":1,"failed":156},{"name":"inline-module.wast","passed":0,"failed":1},{"name":"int_exprs.wast","passed":38,"failed":70},{"name":"int_literals.wast","passed":5,"failed":46},{"name":"labels.wast","passed":1,"failed":28},{"name":"left-to-right.wast","passed":0,"failed":1},{"name":"linking.wast","passed":1,"failed":66},{"name":"load.wast","passed":0,"failed":60},{"name":"local_get.wast","passed":2,"failed":34},{"name":"local_set.wast","passed":5,"failed":48},{"name":"local_tee.wast","passed":0,"failed":42},{"name":"loop.wast","passed":0,"failed":43},{"name":"memory.wast","passed":0,"failed":34},{"name":"memory_grow.wast","passed":0,"failed":19},{"name":"memory_redundancy.wast","passed":0,"failed":1},{"name":"memory_size.wast","passed":0,"failed":6},{"name":"memory_trap.wast","passed":0,"failed":172},{"name":"names.wast","passed":484,"failed":1},{"name":"nop.wast","passed":0,"failed":5},{"name":"return.wast","passed":0,"failed":21},{"name":"select.wast","passed":0,"failed":32},{"name":"skip-stack-guard-page.wast","passed":0,"failed":11},{"name":"stack.wast","passed":0,"failed":2},{"name":"start.wast","passed":0,"failed":10},{"name":"store.wast","passed":0,"failed":59},{"name":"switch.wast","passed":1,"failed":27},{"name":"token.wast","passed":16,"failed":42},{"name":"traps.wast","passed":3,"failed":33},{"name":"type.wast","passed":1,"failed":2},{"name":"unreachable.wast","passed":0,"failed":59},{"name":"unreached-invalid.wast","passed":0,"failed":118},{"name":"unwind.wast","passed":1,"failed":49},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":0,"failed":176}] 0.0.4,9258,10909,[{"name":"address.wast","passed":0,"failed":54},{"name":"align.wast","passed":0,"failed":109},{"name":"binary-leb128.wast","passed":66,"failed":25},{"name":"binary.wast","passed":104,"failed":8},{"name":"block.wast","passed":0,"failed":171},{"name":"br.wast","passed":0,"failed":21},{"name":"br_if.wast","passed":0,"failed":30},{"name":"br_table.wast","passed":0,"failed":25},{"name":"call.wast","passed":0,"failed":22},{"name":"call_indirect.wast","passed":0,"failed":56},{"name":"comments.wast","passed":4,"failed":4},{"name":"const.wast","passed":702,"failed":76},{"name":"conversions.wast","passed":0,"failed":93},{"name":"custom.wast","passed":10,"failed":1},{"name":"data.wast","passed":0,"failed":61},{"name":"elem.wast","passed":0,"failed":76},{"name":"endianness.wast","passed":0,"failed":1},{"name":"exports.wast","passed":21,"failed":73},{"name":"f32.wast","passed":1005,"failed":1509},{"name":"f32_bitwise.wast","passed":1,"failed":363},{"name":"f32_cmp.wast","passed":2401,"failed":6},{"name":"f64.wast","passed":1005,"failed":1509},{"name":"f64_bitwise.wast","passed":1,"failed":363},{"name":"f64_cmp.wast","passed":2401,"failed":6},{"name":"fac.wast","passed":0,"failed":2},{"name":"float_exprs.wast","passed":269,"failed":591},{"name":"float_literals.wast","passed":34,"failed":129},{"name":"float_memory.wast","passed":0,"failed":6},{"name":"float_misc.wast","passed":138,"failed":303},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":4,"failed":75},{"name":"func_ptrs.wast","passed":0,"failed":16},{"name":"global.wast","passed":4,"failed":49},{"name":"i32.wast","passed":0,"failed":96},{"name":"i64.wast","passed":0,"failed":42},{"name":"if.wast","passed":0,"failed":118},{"name":"imports.wast","passed":1,"failed":156},{"name":"inline-module.wast","passed":0,"failed":1},{"name":"int_exprs.wast","passed":38,"failed":70},{"name":"int_literals.wast","passed":5,"failed":46},{"name":"labels.wast","passed":1,"failed":28},{"name":"left-to-right.wast","passed":0,"failed":1},{"name":"linking.wast","passed":1,"failed":66},{"name":"load.wast","passed":0,"failed":60},{"name":"local_get.wast","passed":2,"failed":34},{"name":"local_set.wast","passed":5,"failed":48},{"name":"local_tee.wast","passed":0,"failed":42},{"name":"loop.wast","passed":0,"failed":43},{"name":"memory.wast","passed":0,"failed":34},{"name":"memory_grow.wast","passed":0,"failed":19},{"name":"memory_redundancy.wast","passed":0,"failed":1},{"name":"memory_size.wast","passed":0,"failed":6},{"name":"memory_trap.wast","passed":0,"failed":172},{"name":"names.wast","passed":484,"failed":1},{"name":"nop.wast","passed":0,"failed":5},{"name":"return.wast","passed":0,"failed":21},{"name":"select.wast","passed":0,"failed":32},{"name":"skip-stack-guard-page.wast","passed":0,"failed":11},{"name":"stack.wast","passed":0,"failed":2},{"name":"start.wast","passed":0,"failed":10},{"name":"store.wast","passed":0,"failed":59},{"name":"switch.wast","passed":1,"failed":27},{"name":"token.wast","passed":16,"failed":42},{"name":"traps.wast","passed":3,"failed":33},{"name":"type.wast","passed":1,"failed":2},{"name":"unreachable.wast","passed":0,"failed":59},{"name":"unreached-invalid.wast","passed":0,"failed":118},{"name":"unwind.wast","passed":1,"failed":49},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":0,"failed":176}] 0.0.5,11135,9093,[{"name":"address.wast","passed":1,"failed":259},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":78,"failed":13},{"name":"binary.wast","passed":107,"failed":5},{"name":"block.wast","passed":170,"failed":53},{"name":"br.wast","passed":20,"failed":77},{"name":"br_if.wast","passed":29,"failed":89},{"name":"br_table.wast","passed":24,"failed":150},{"name":"call.wast","passed":18,"failed":73},{"name":"call_indirect.wast","passed":34,"failed":136},{"name":"comments.wast","passed":5,"failed":3},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":25,"failed":594},{"name":"custom.wast","passed":10,"failed":1},{"name":"data.wast","passed":22,"failed":39},{"name":"elem.wast","passed":27,"failed":72},{"name":"endianness.wast","passed":1,"failed":68},{"name":"exports.wast","passed":90,"failed":6},{"name":"f32.wast","passed":1018,"failed":1496},{"name":"f32_bitwise.wast","passed":4,"failed":360},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":1018,"failed":1496},{"name":"f64_bitwise.wast","passed":4,"failed":360},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":1,"failed":7},{"name":"float_exprs.wast","passed":275,"failed":625},{"name":"float_literals.wast","passed":112,"failed":51},{"name":"float_memory.wast","passed":0,"failed":90},{"name":"float_misc.wast","passed":138,"failed":303},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":81,"failed":91},{"name":"func_ptrs.wast","passed":7,"failed":29},{"name":"global.wast","passed":50,"failed":60},{"name":"i32.wast","passed":85,"failed":375},{"name":"i64.wast","passed":31,"failed":385},{"name":"if.wast","passed":116,"failed":125},{"name":"imports.wast","passed":23,"failed":160},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":38,"failed":70},{"name":"int_literals.wast","passed":25,"failed":26},{"name":"labels.wast","passed":13,"failed":16},{"name":"left-to-right.wast","passed":0,"failed":96},{"name":"linking.wast","passed":5,"failed":127},{"name":"load.wast","passed":59,"failed":38},{"name":"local_get.wast","passed":18,"failed":18},{"name":"local_set.wast","passed":38,"failed":15},{"name":"local_tee.wast","passed":41,"failed":56},{"name":"loop.wast","passed":42,"failed":78},{"name":"memory.wast","passed":30,"failed":49},{"name":"memory_grow.wast","passed":11,"failed":85},{"name":"memory_redundancy.wast","passed":1,"failed":7},{"name":"memory_size.wast","passed":6,"failed":36},{"name":"memory_trap.wast","passed":1,"failed":181},{"name":"names.wast","passed":484,"failed":2},{"name":"nop.wast","passed":4,"failed":84},{"name":"return.wast","passed":20,"failed":64},{"name":"select.wast","passed":28,"failed":120},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":2,"failed":5},{"name":"start.wast","passed":4,"failed":16},{"name":"store.wast","passed":59,"failed":9},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":39,"failed":19},{"name":"traps.wast","passed":4,"failed":32},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":0,"failed":64},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":9,"failed":41},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}] -0.0.6-alpha.0,12848,7380,[{"name":"address.wast","passed":5,"failed":255},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":90,"failed":1},{"name":"binary.wast","passed":110,"failed":2},{"name":"block.wast","passed":192,"failed":31},{"name":"br.wast","passed":84,"failed":13},{"name":"br_if.wast","passed":86,"failed":32},{"name":"br_table.wast","passed":25,"failed":149},{"name":"call.wast","passed":29,"failed":62},{"name":"call_indirect.wast","passed":36,"failed":134},{"name":"comments.wast","passed":5,"failed":3},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":25,"failed":594},{"name":"custom.wast","passed":11,"failed":0},{"name":"data.wast","passed":47,"failed":14},{"name":"elem.wast","passed":50,"failed":49},{"name":"endianness.wast","passed":1,"failed":68},{"name":"exports.wast","passed":90,"failed":6},{"name":"f32.wast","passed":1174,"failed":1340},{"name":"f32_bitwise.wast","passed":4,"failed":360},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":1018,"failed":1496},{"name":"f64_bitwise.wast","passed":4,"failed":360},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":2,"failed":6},{"name":"float_exprs.wast","passed":511,"failed":389},{"name":"float_literals.wast","passed":163,"failed":0},{"name":"float_memory.wast","passed":6,"failed":84},{"name":"float_misc.wast","passed":328,"failed":113},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":116,"failed":56},{"name":"func_ptrs.wast","passed":10,"failed":26},{"name":"global.wast","passed":51,"failed":59},{"name":"i32.wast","passed":446,"failed":14},{"name":"i64.wast","passed":31,"failed":385},{"name":"if.wast","passed":118,"failed":123},{"name":"imports.wast","passed":74,"failed":109},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":108,"failed":0},{"name":"int_literals.wast","passed":29,"failed":22},{"name":"labels.wast","passed":14,"failed":15},{"name":"left-to-right.wast","passed":1,"failed":95},{"name":"linking.wast","passed":21,"failed":111},{"name":"load.wast","passed":60,"failed":37},{"name":"local_get.wast","passed":30,"failed":6},{"name":"local_set.wast","passed":49,"failed":4},{"name":"local_tee.wast","passed":65,"failed":32},{"name":"loop.wast","passed":92,"failed":28},{"name":"memory.wast","passed":34,"failed":45},{"name":"memory_grow.wast","passed":12,"failed":84},{"name":"memory_redundancy.wast","passed":1,"failed":7},{"name":"memory_size.wast","passed":6,"failed":36},{"name":"memory_trap.wast","passed":2,"failed":180},{"name":"names.wast","passed":485,"failed":1},{"name":"nop.wast","passed":43,"failed":45},{"name":"return.wast","passed":21,"failed":63},{"name":"select.wast","passed":84,"failed":64},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":2,"failed":5},{"name":"start.wast","passed":9,"failed":11},{"name":"store.wast","passed":59,"failed":9},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":58,"failed":0},{"name":"traps.wast","passed":14,"failed":22},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":50,"failed":14},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":27,"failed":23},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}] +0.0.6-alpha.0,12862,7366,[{"name":"address.wast","passed":5,"failed":255},{"name":"align.wast","passed":108,"failed":48},{"name":"binary-leb128.wast","passed":90,"failed":1},{"name":"binary.wast","passed":110,"failed":2},{"name":"block.wast","passed":192,"failed":31},{"name":"br.wast","passed":84,"failed":13},{"name":"br_if.wast","passed":86,"failed":32},{"name":"br_table.wast","passed":25,"failed":149},{"name":"call.wast","passed":29,"failed":62},{"name":"call_indirect.wast","passed":36,"failed":134},{"name":"comments.wast","passed":5,"failed":3},{"name":"const.wast","passed":778,"failed":0},{"name":"conversions.wast","passed":25,"failed":594},{"name":"custom.wast","passed":11,"failed":0},{"name":"data.wast","passed":47,"failed":14},{"name":"elem.wast","passed":50,"failed":49},{"name":"endianness.wast","passed":1,"failed":68},{"name":"exports.wast","passed":90,"failed":6},{"name":"f32.wast","passed":1174,"failed":1340},{"name":"f32_bitwise.wast","passed":4,"failed":360},{"name":"f32_cmp.wast","passed":2407,"failed":0},{"name":"f64.wast","passed":1018,"failed":1496},{"name":"f64_bitwise.wast","passed":4,"failed":360},{"name":"f64_cmp.wast","passed":2407,"failed":0},{"name":"fac.wast","passed":2,"failed":6},{"name":"float_exprs.wast","passed":511,"failed":389},{"name":"float_literals.wast","passed":163,"failed":0},{"name":"float_memory.wast","passed":6,"failed":84},{"name":"float_misc.wast","passed":328,"failed":113},{"name":"forward.wast","passed":1,"failed":4},{"name":"func.wast","passed":116,"failed":56},{"name":"func_ptrs.wast","passed":10,"failed":26},{"name":"global.wast","passed":51,"failed":59},{"name":"i32.wast","passed":460,"failed":0},{"name":"i64.wast","passed":31,"failed":385},{"name":"if.wast","passed":118,"failed":123},{"name":"imports.wast","passed":74,"failed":109},{"name":"inline-module.wast","passed":1,"failed":0},{"name":"int_exprs.wast","passed":108,"failed":0},{"name":"int_literals.wast","passed":29,"failed":22},{"name":"labels.wast","passed":14,"failed":15},{"name":"left-to-right.wast","passed":1,"failed":95},{"name":"linking.wast","passed":21,"failed":111},{"name":"load.wast","passed":60,"failed":37},{"name":"local_get.wast","passed":30,"failed":6},{"name":"local_set.wast","passed":49,"failed":4},{"name":"local_tee.wast","passed":65,"failed":32},{"name":"loop.wast","passed":92,"failed":28},{"name":"memory.wast","passed":34,"failed":45},{"name":"memory_grow.wast","passed":12,"failed":84},{"name":"memory_redundancy.wast","passed":1,"failed":7},{"name":"memory_size.wast","passed":6,"failed":36},{"name":"memory_trap.wast","passed":2,"failed":180},{"name":"names.wast","passed":485,"failed":1},{"name":"nop.wast","passed":43,"failed":45},{"name":"return.wast","passed":21,"failed":63},{"name":"select.wast","passed":84,"failed":64},{"name":"skip-stack-guard-page.wast","passed":1,"failed":10},{"name":"stack.wast","passed":2,"failed":5},{"name":"start.wast","passed":9,"failed":11},{"name":"store.wast","passed":59,"failed":9},{"name":"switch.wast","passed":2,"failed":26},{"name":"token.wast","passed":58,"failed":0},{"name":"traps.wast","passed":14,"failed":22},{"name":"type.wast","passed":3,"failed":0},{"name":"unreachable.wast","passed":50,"failed":14},{"name":"unreached-invalid.wast","passed":118,"failed":0},{"name":"unwind.wast","passed":27,"failed":23},{"name":"utf8-custom-section-id.wast","passed":176,"failed":0},{"name":"utf8-import-field.wast","passed":176,"failed":0},{"name":"utf8-import-module.wast","passed":176,"failed":0},{"name":"utf8-invalid-encoding.wast","passed":176,"failed":0}] diff --git a/crates/tinywasm/tests/generated/progress-mvp.svg b/crates/tinywasm/tests/generated/progress-mvp.svg index 50c3d97..bac7227 100644 --- a/crates/tinywasm/tests/generated/progress-mvp.svg +++ b/crates/tinywasm/tests/generated/progress-mvp.svg @@ -49,11 +49,11 @@ v0.0.5 (11135) -v0.0.6-alpha.0 (12848) +v0.0.6-alpha.0 (12862) - - + + diff --git a/examples/wast/i32.wast b/examples/wast/i32.wast deleted file mode 100644 index 3228e46..0000000 --- a/examples/wast/i32.wast +++ /dev/null @@ -1,985 +0,0 @@ -;; i32 operations - -(module - (func (export "add") (param $x i32) (param $y i32) (result i32) (i32.add (local.get $x) (local.get $y))) - (func (export "sub") (param $x i32) (param $y i32) (result i32) (i32.sub (local.get $x) (local.get $y))) - (func (export "mul") (param $x i32) (param $y i32) (result i32) (i32.mul (local.get $x) (local.get $y))) - (func (export "div_s") (param $x i32) (param $y i32) (result i32) (i32.div_s (local.get $x) (local.get $y))) - (func (export "div_u") (param $x i32) (param $y i32) (result i32) (i32.div_u (local.get $x) (local.get $y))) - (func (export "rem_s") (param $x i32) (param $y i32) (result i32) (i32.rem_s (local.get $x) (local.get $y))) - (func (export "rem_u") (param $x i32) (param $y i32) (result i32) (i32.rem_u (local.get $x) (local.get $y))) - (func (export "and") (param $x i32) (param $y i32) (result i32) (i32.and (local.get $x) (local.get $y))) - (func (export "or") (param $x i32) (param $y i32) (result i32) (i32.or (local.get $x) (local.get $y))) - (func (export "xor") (param $x i32) (param $y i32) (result i32) (i32.xor (local.get $x) (local.get $y))) - (func (export "shl") (param $x i32) (param $y i32) (result i32) (i32.shl (local.get $x) (local.get $y))) - (func (export "shr_s") (param $x i32) (param $y i32) (result i32) (i32.shr_s (local.get $x) (local.get $y))) - (func (export "shr_u") (param $x i32) (param $y i32) (result i32) (i32.shr_u (local.get $x) (local.get $y))) - (func (export "rotl") (param $x i32) (param $y i32) (result i32) (i32.rotl (local.get $x) (local.get $y))) - (func (export "rotr") (param $x i32) (param $y i32) (result i32) (i32.rotr (local.get $x) (local.get $y))) - (func (export "clz") (param $x i32) (result i32) (i32.clz (local.get $x))) - (func (export "ctz") (param $x i32) (result i32) (i32.ctz (local.get $x))) - (func (export "popcnt") (param $x i32) (result i32) (i32.popcnt (local.get $x))) - (func (export "extend8_s") (param $x i32) (result i32) (i32.extend8_s (local.get $x))) - (func (export "extend16_s") (param $x i32) (result i32) (i32.extend16_s (local.get $x))) - (func (export "eqz") (param $x i32) (result i32) (i32.eqz (local.get $x))) - (func (export "eq") (param $x i32) (param $y i32) (result i32) (i32.eq (local.get $x) (local.get $y))) - (func (export "ne") (param $x i32) (param $y i32) (result i32) (i32.ne (local.get $x) (local.get $y))) - (func (export "lt_s") (param $x i32) (param $y i32) (result i32) (i32.lt_s (local.get $x) (local.get $y))) - (func (export "lt_u") (param $x i32) (param $y i32) (result i32) (i32.lt_u (local.get $x) (local.get $y))) - (func (export "le_s") (param $x i32) (param $y i32) (result i32) (i32.le_s (local.get $x) (local.get $y))) - (func (export "le_u") (param $x i32) (param $y i32) (result i32) (i32.le_u (local.get $x) (local.get $y))) - (func (export "gt_s") (param $x i32) (param $y i32) (result i32) (i32.gt_s (local.get $x) (local.get $y))) - (func (export "gt_u") (param $x i32) (param $y i32) (result i32) (i32.gt_u (local.get $x) (local.get $y))) - (func (export "ge_s") (param $x i32) (param $y i32) (result i32) (i32.ge_s (local.get $x) (local.get $y))) - (func (export "ge_u") (param $x i32) (param $y i32) (result i32) (i32.ge_u (local.get $x) (local.get $y))) -) - -(assert_return (invoke "add" (i32.const 1) (i32.const 1)) (i32.const 2)) -(assert_return (invoke "add" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "add" (i32.const -1) (i32.const -1)) (i32.const -2)) -(assert_return (invoke "add" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "add" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x80000000)) -(assert_return (invoke "add" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x7fffffff)) -(assert_return (invoke "add" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "add" (i32.const 0x3fffffff) (i32.const 1)) (i32.const 0x40000000)) - -(assert_return (invoke "sub" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "sub" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "sub" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "sub" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000000)) -(assert_return (invoke "sub" (i32.const 0x80000000) (i32.const 1)) (i32.const 0x7fffffff)) -(assert_return (invoke "sub" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "sub" (i32.const 0x3fffffff) (i32.const -1)) (i32.const 0x40000000)) - -(assert_return (invoke "mul" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "mul" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "mul" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "mul" (i32.const 0x10000000) (i32.const 4096)) (i32.const 0)) -(assert_return (invoke "mul" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "mul" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000)) -(assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x80000001)) -(assert_return (invoke "mul" (i32.const 0x01234567) (i32.const 0x76543210)) (i32.const 0x358e7470)) -(assert_return (invoke "mul" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) - -(assert_trap (invoke "div_s" (i32.const 1) (i32.const 0)) "integer divide by zero") -(assert_trap (invoke "div_s" (i32.const 0) (i32.const 0)) "integer divide by zero") -(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const -1)) "integer overflow") -(assert_trap (invoke "div_s" (i32.const 0x80000000) (i32.const 0)) "integer divide by zero") -(assert_return (invoke "div_s" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "div_s" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "div_s" (i32.const 0) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "div_s" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "div_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0xc0000000)) -(assert_return (invoke "div_s" (i32.const 0x80000001) (i32.const 1000)) (i32.const 0xffdf3b65)) -(assert_return (invoke "div_s" (i32.const 5) (i32.const 2)) (i32.const 2)) -(assert_return (invoke "div_s" (i32.const -5) (i32.const 2)) (i32.const -2)) -(assert_return (invoke "div_s" (i32.const 5) (i32.const -2)) (i32.const -2)) -(assert_return (invoke "div_s" (i32.const -5) (i32.const -2)) (i32.const 2)) -(assert_return (invoke "div_s" (i32.const 7) (i32.const 3)) (i32.const 2)) -(assert_return (invoke "div_s" (i32.const -7) (i32.const 3)) (i32.const -2)) -(assert_return (invoke "div_s" (i32.const 7) (i32.const -3)) (i32.const -2)) -(assert_return (invoke "div_s" (i32.const -7) (i32.const -3)) (i32.const 2)) -(assert_return (invoke "div_s" (i32.const 11) (i32.const 5)) (i32.const 2)) -(assert_return (invoke "div_s" (i32.const 17) (i32.const 7)) (i32.const 2)) - -(assert_trap (invoke "div_u" (i32.const 1) (i32.const 0)) "integer divide by zero") -(assert_trap (invoke "div_u" (i32.const 0) (i32.const 0)) "integer divide by zero") -(assert_return (invoke "div_u" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "div_u" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "div_u" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "div_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "div_u" (i32.const 0x80000000) (i32.const 2)) (i32.const 0x40000000)) -(assert_return (invoke "div_u" (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8fef)) -(assert_return (invoke "div_u" (i32.const 0x80000001) (i32.const 1000)) (i32.const 0x20c49b)) -(assert_return (invoke "div_u" (i32.const 5) (i32.const 2)) (i32.const 2)) -(assert_return (invoke "div_u" (i32.const -5) (i32.const 2)) (i32.const 0x7ffffffd)) -(assert_return (invoke "div_u" (i32.const 5) (i32.const -2)) (i32.const 0)) -(assert_return (invoke "div_u" (i32.const -5) (i32.const -2)) (i32.const 0)) -(assert_return (invoke "div_u" (i32.const 7) (i32.const 3)) (i32.const 2)) -(assert_return (invoke "div_u" (i32.const 11) (i32.const 5)) (i32.const 2)) -(assert_return (invoke "div_u" (i32.const 17) (i32.const 7)) (i32.const 2)) - -(assert_trap (invoke "rem_s" (i32.const 1) (i32.const 0)) "integer divide by zero") -(assert_trap (invoke "rem_s" (i32.const 0) (i32.const 0)) "integer divide by zero") -(assert_return (invoke "rem_s" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 0) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 0x80000000) (i32.const 2)) (i32.const 0)) -(assert_return (invoke "rem_s" (i32.const 0x80000001) (i32.const 1000)) (i32.const -647)) -(assert_return (invoke "rem_s" (i32.const 5) (i32.const 2)) (i32.const 1)) -(assert_return (invoke "rem_s" (i32.const -5) (i32.const 2)) (i32.const -1)) -(assert_return (invoke "rem_s" (i32.const 5) (i32.const -2)) (i32.const 1)) -(assert_return (invoke "rem_s" (i32.const -5) (i32.const -2)) (i32.const -1)) -(assert_return (invoke "rem_s" (i32.const 7) (i32.const 3)) (i32.const 1)) -(assert_return (invoke "rem_s" (i32.const -7) (i32.const 3)) (i32.const -1)) -(assert_return (invoke "rem_s" (i32.const 7) (i32.const -3)) (i32.const 1)) -(assert_return (invoke "rem_s" (i32.const -7) (i32.const -3)) (i32.const -1)) -(assert_return (invoke "rem_s" (i32.const 11) (i32.const 5)) (i32.const 1)) -(assert_return (invoke "rem_s" (i32.const 17) (i32.const 7)) (i32.const 3)) - -(assert_trap (invoke "rem_u" (i32.const 1) (i32.const 0)) "integer divide by zero") -(assert_trap (invoke "rem_u" (i32.const 0) (i32.const 0)) "integer divide by zero") -(assert_return (invoke "rem_u" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "rem_u" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "rem_u" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "rem_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0x80000000)) -(assert_return (invoke "rem_u" (i32.const 0x80000000) (i32.const 2)) (i32.const 0)) -(assert_return (invoke "rem_u" (i32.const 0x8ff00ff0) (i32.const 0x10001)) (i32.const 0x8001)) -(assert_return (invoke "rem_u" (i32.const 0x80000001) (i32.const 1000)) (i32.const 649)) -(assert_return (invoke "rem_u" (i32.const 5) (i32.const 2)) (i32.const 1)) -(assert_return (invoke "rem_u" (i32.const -5) (i32.const 2)) (i32.const 1)) -(assert_return (invoke "rem_u" (i32.const 5) (i32.const -2)) (i32.const 5)) -(assert_return (invoke "rem_u" (i32.const -5) (i32.const -2)) (i32.const -5)) -(assert_return (invoke "rem_u" (i32.const 7) (i32.const 3)) (i32.const 1)) -(assert_return (invoke "rem_u" (i32.const 11) (i32.const 5)) (i32.const 1)) -(assert_return (invoke "rem_u" (i32.const 17) (i32.const 7)) (i32.const 3)) - -(assert_return (invoke "and" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "and" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "and" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "and" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "and" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "and" (i32.const 0x7fffffff) (i32.const -1)) (i32.const 0x7fffffff)) -(assert_return (invoke "and" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xf0f0f0f0)) -(assert_return (invoke "and" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff)) - -(assert_return (invoke "or" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "or" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "or" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "or" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "or" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1)) -(assert_return (invoke "or" (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000)) -(assert_return (invoke "or" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0xffffffff)) -(assert_return (invoke "or" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0xffffffff)) - -(assert_return (invoke "xor" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "xor" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "xor" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "xor" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "xor" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const -1)) -(assert_return (invoke "xor" (i32.const 0x80000000) (i32.const 0)) (i32.const 0x80000000)) -(assert_return (invoke "xor" (i32.const -1) (i32.const 0x80000000)) (i32.const 0x7fffffff)) -(assert_return (invoke "xor" (i32.const -1) (i32.const 0x7fffffff)) (i32.const 0x80000000)) -(assert_return (invoke "xor" (i32.const 0xf0f0ffff) (i32.const 0xfffff0f0)) (i32.const 0x0f0f0f0f)) -(assert_return (invoke "xor" (i32.const 0xffffffff) (i32.const 0xffffffff)) (i32.const 0)) - -(assert_return (invoke "shl" (i32.const 1) (i32.const 1)) (i32.const 2)) -(assert_return (invoke "shl" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "shl" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0xfffffffe)) -(assert_return (invoke "shl" (i32.const 0xffffffff) (i32.const 1)) (i32.const 0xfffffffe)) -(assert_return (invoke "shl" (i32.const 0x80000000) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "shl" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x80000000)) -(assert_return (invoke "shl" (i32.const 1) (i32.const 31)) (i32.const 0x80000000)) -(assert_return (invoke "shl" (i32.const 1) (i32.const 32)) (i32.const 1)) -(assert_return (invoke "shl" (i32.const 1) (i32.const 33)) (i32.const 2)) -(assert_return (invoke "shl" (i32.const 1) (i32.const -1)) (i32.const 0x80000000)) -(assert_return (invoke "shl" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0x80000000)) - -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const 1)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff)) -(assert_return (invoke "shr_s" (i32.const 0x80000000) (i32.const 1)) (i32.const 0xc0000000)) -(assert_return (invoke "shr_s" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 32)) (i32.const 1)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 33)) (i32.const 0)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "shr_s" (i32.const 1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "shr_s" (i32.const 0x80000000) (i32.const 31)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const 32)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const 33)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const -1)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const 0x7fffffff)) (i32.const -1)) -(assert_return (invoke "shr_s" (i32.const -1) (i32.const 0x80000000)) (i32.const -1)) - -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const 1)) (i32.const 0x7fffffff)) -(assert_return (invoke "shr_u" (i32.const 0x7fffffff) (i32.const 1)) (i32.const 0x3fffffff)) -(assert_return (invoke "shr_u" (i32.const 0x80000000) (i32.const 1)) (i32.const 0x40000000)) -(assert_return (invoke "shr_u" (i32.const 0x40000000) (i32.const 1)) (i32.const 0x20000000)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 32)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 33)) (i32.const 0)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "shr_u" (i32.const 1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const 0x80000000) (i32.const 31)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const 32)) (i32.const -1)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const 33)) (i32.const 0x7fffffff)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "shr_u" (i32.const -1) (i32.const 0x80000000)) (i32.const -1)) - -(assert_return (invoke "rotl" (i32.const 1) (i32.const 1)) (i32.const 2)) -(assert_return (invoke "rotl" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "rotl" (i32.const -1) (i32.const 1)) (i32.const -1)) -(assert_return (invoke "rotl" (i32.const 1) (i32.const 32)) (i32.const 1)) -(assert_return (invoke "rotl" (i32.const 0xabcd9876) (i32.const 1)) (i32.const 0x579b30ed)) -(assert_return (invoke "rotl" (i32.const 0xfe00dc00) (i32.const 4)) (i32.const 0xe00dc00f)) -(assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x183a5c76)) -(assert_return (invoke "rotl" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00100000)) -(assert_return (invoke "rotl" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x183a5c76)) -(assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0x579beed3)) -(assert_return (invoke "rotl" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0x579beed3)) -(assert_return (invoke "rotl" (i32.const 1) (i32.const 31)) (i32.const 0x80000000)) -(assert_return (invoke "rotl" (i32.const 0x80000000) (i32.const 1)) (i32.const 1)) - -(assert_return (invoke "rotr" (i32.const 1) (i32.const 1)) (i32.const 0x80000000)) -(assert_return (invoke "rotr" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "rotr" (i32.const -1) (i32.const 1)) (i32.const -1)) -(assert_return (invoke "rotr" (i32.const 1) (i32.const 32)) (i32.const 1)) -(assert_return (invoke "rotr" (i32.const 0xff00cc00) (i32.const 1)) (i32.const 0x7f806600)) -(assert_return (invoke "rotr" (i32.const 0x00080000) (i32.const 4)) (i32.const 0x00008000)) -(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 5)) (i32.const 0x1d860e97)) -(assert_return (invoke "rotr" (i32.const 0x00008000) (i32.const 37)) (i32.const 0x00000400)) -(assert_return (invoke "rotr" (i32.const 0xb0c1d2e3) (i32.const 0xff05)) (i32.const 0x1d860e97)) -(assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0xffffffed)) (i32.const 0xe6fbb4d5)) -(assert_return (invoke "rotr" (i32.const 0x769abcdf) (i32.const 0x8000000d)) (i32.const 0xe6fbb4d5)) -(assert_return (invoke "rotr" (i32.const 1) (i32.const 31)) (i32.const 2)) -(assert_return (invoke "rotr" (i32.const 0x80000000) (i32.const 31)) (i32.const 1)) - -(assert_return (invoke "clz" (i32.const 0xffffffff)) (i32.const 0)) -(assert_return (invoke "clz" (i32.const 0)) (i32.const 32)) -(assert_return (invoke "clz" (i32.const 0x00008000)) (i32.const 16)) -(assert_return (invoke "clz" (i32.const 0xff)) (i32.const 24)) -(assert_return (invoke "clz" (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "clz" (i32.const 1)) (i32.const 31)) -(assert_return (invoke "clz" (i32.const 2)) (i32.const 30)) -(assert_return (invoke "clz" (i32.const 0x7fffffff)) (i32.const 1)) - -(assert_return (invoke "ctz" (i32.const -1)) (i32.const 0)) -(assert_return (invoke "ctz" (i32.const 0)) (i32.const 32)) -(assert_return (invoke "ctz" (i32.const 0x00008000)) (i32.const 15)) -(assert_return (invoke "ctz" (i32.const 0x00010000)) (i32.const 16)) -(assert_return (invoke "ctz" (i32.const 0x80000000)) (i32.const 31)) -(assert_return (invoke "ctz" (i32.const 0x7fffffff)) (i32.const 0)) - -(assert_return (invoke "popcnt" (i32.const -1)) (i32.const 32)) -(assert_return (invoke "popcnt" (i32.const 0)) (i32.const 0)) -(assert_return (invoke "popcnt" (i32.const 0x00008000)) (i32.const 1)) -(assert_return (invoke "popcnt" (i32.const 0x80008000)) (i32.const 2)) -(assert_return (invoke "popcnt" (i32.const 0x7fffffff)) (i32.const 31)) -(assert_return (invoke "popcnt" (i32.const 0xAAAAAAAA)) (i32.const 16)) -(assert_return (invoke "popcnt" (i32.const 0x55555555)) (i32.const 16)) -(assert_return (invoke "popcnt" (i32.const 0xDEADBEEF)) (i32.const 24)) - -;; (assert_return (invoke "extend8_s" (i32.const 0)) (i32.const 0)) -;; (assert_return (invoke "extend8_s" (i32.const 0x7f)) (i32.const 127)) -;; (assert_return (invoke "extend8_s" (i32.const 0x80)) (i32.const -128)) -;; (assert_return (invoke "extend8_s" (i32.const 0xff)) (i32.const -1)) -;; (assert_return (invoke "extend8_s" (i32.const 0x012345_00)) (i32.const 0)) -;; (assert_return (invoke "extend8_s" (i32.const 0xfedcba_80)) (i32.const -0x80)) -;; (assert_return (invoke "extend8_s" (i32.const -1)) (i32.const -1)) - -;; (assert_return (invoke "extend16_s" (i32.const 0)) (i32.const 0)) -;; (assert_return (invoke "extend16_s" (i32.const 0x7fff)) (i32.const 32767)) -;; (assert_return (invoke "extend16_s" (i32.const 0x8000)) (i32.const -32768)) -;; (assert_return (invoke "extend16_s" (i32.const 0xffff)) (i32.const -1)) -;; (assert_return (invoke "extend16_s" (i32.const 0x0123_0000)) (i32.const 0)) -;; (assert_return (invoke "extend16_s" (i32.const 0xfedc_8000)) (i32.const -0x8000)) -;; (assert_return (invoke "extend16_s" (i32.const -1)) (i32.const -1)) - -(assert_return (invoke "eqz" (i32.const 0)) (i32.const 1)) -(assert_return (invoke "eqz" (i32.const 1)) (i32.const 0)) -(assert_return (invoke "eqz" (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "eqz" (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "eqz" (i32.const 0xffffffff)) (i32.const 0)) - -(assert_return (invoke "eq" (i32.const 0) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "eq" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "eq" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "eq" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "eq" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "eq" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "eq" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) - -(assert_return (invoke "ne" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "ne" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "ne" (i32.const -1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "ne" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "ne" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "ne" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "ne" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) - -(assert_return (invoke "lt_s" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const -1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "lt_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "lt_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "lt_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "lt_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) - -(assert_return (invoke "lt_u" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "lt_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "lt_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) - -(assert_return (invoke "le_s" (i32.const 0) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const -1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "le_s" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "le_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "le_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) - -(assert_return (invoke "le_u" (i32.const 0) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const 1) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "le_u" (i32.const 0) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "le_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "le_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "le_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "le_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) - -(assert_return (invoke "gt_s" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "gt_s" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "gt_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "gt_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) - -(assert_return (invoke "gt_u" (i32.const 0) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const 1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const -1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const -1) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "gt_u" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "gt_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "gt_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "gt_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "gt_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) - -(assert_return (invoke "ge_s" (i32.const 0) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const -1) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0)) (i32.const 0)) -(assert_return (invoke "ge_s" (i32.const 0) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "ge_s" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ge_s" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 0)) -(assert_return (invoke "ge_s" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 1)) - -(assert_return (invoke "ge_u" (i32.const 0) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const -1) (i32.const 1)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0x7fffffff) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const -1) (i32.const -1)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 1) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0) (i32.const 1)) (i32.const 0)) -(assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0) (i32.const 0x80000000)) (i32.const 0)) -(assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const -1)) (i32.const 0)) -(assert_return (invoke "ge_u" (i32.const -1) (i32.const 0x80000000)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0x80000000) (i32.const 0x7fffffff)) (i32.const 1)) -(assert_return (invoke "ge_u" (i32.const 0x7fffffff) (i32.const 0x80000000)) (i32.const 0)) - - -(assert_invalid - (module - (func $type-unary-operand-empty - (i32.eqz) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-block - (i32.const 0) - (block (i32.eqz) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-loop - (i32.const 0) - (loop (i32.eqz) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-if - (i32.const 0) (i32.const 0) - (if (then (i32.eqz) (drop))) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-else - (i32.const 0) (i32.const 0) - (if (result i32) (then (i32.const 0)) (else (i32.eqz))) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-br - (i32.const 0) - (block (br 0 (i32.eqz)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-br_if - (i32.const 0) - (block (br_if 0 (i32.eqz) (i32.const 1)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-br_table - (i32.const 0) - (block (br_table 0 (i32.eqz)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-return - (return (i32.eqz)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-select - (select (i32.eqz) (i32.const 1) (i32.const 2)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-call - (call 1 (i32.eqz)) (drop) - ) - (func (param i32) (result i32) (local.get 0)) - ) - "type mismatch" -) -(assert_invalid - (module - (func $f (param i32) (result i32) (local.get 0)) - (type $sig (func (param i32) (result i32))) - (table funcref (elem $f)) - (func $type-unary-operand-empty-in-call_indirect - (block (result i32) - (call_indirect (type $sig) - (i32.eqz) (i32.const 0) - ) - (drop) - ) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-local.set - (local i32) - (local.set 0 (i32.eqz)) (local.get 0) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-unary-operand-empty-in-local.tee - (local i32) - (local.tee 0 (i32.eqz)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (global $x (mut i32) (i32.const 0)) - (func $type-unary-operand-empty-in-global.set - (global.set $x (i32.eqz)) (global.get $x) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-unary-operand-empty-in-memory.grow - (memory.grow (i32.eqz)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-unary-operand-empty-in-load - (i32.load (i32.eqz)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 1) - (func $type-unary-operand-empty-in-store - (i32.store (i32.eqz) (i32.const 1)) - ) - ) - "type mismatch" -) - -(assert_invalid - (module - (func $type-binary-1st-operand-empty - (i32.add) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty - (i32.const 0) (i32.add) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-block - (i32.const 0) (i32.const 0) - (block (i32.add) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-block - (i32.const 0) - (block (i32.const 0) (i32.add) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-loop - (i32.const 0) (i32.const 0) - (loop (i32.add) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-loop - (i32.const 0) - (loop (i32.const 0) (i32.add) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-if - (i32.const 0) (i32.const 0) (i32.const 0) - (if (i32.add) (then (drop))) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-if - (i32.const 0) (i32.const 0) - (if (i32.const 0) (then (i32.add)) (else (drop))) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-else - (i32.const 0) (i32.const 0) (i32.const 0) - (if (result i32) (then (i32.const 0)) (else (i32.add) (i32.const 0))) - (drop) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-else - (i32.const 0) (i32.const 0) - (if (result i32) (then (i32.const 0)) (else (i32.add))) - (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-br - (i32.const 0) (i32.const 0) - (block (br 0 (i32.add)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-br - (i32.const 0) - (block (br 0 (i32.const 0) (i32.add)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-br_if - (i32.const 0) (i32.const 0) - (block (br_if 0 (i32.add) (i32.const 1)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-br_if - (i32.const 0) - (block (br_if 0 (i32.const 0) (i32.add) (i32.const 1)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-br_table - (i32.const 0) (i32.const 0) - (block (br_table 0 (i32.add)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-br_table - (i32.const 0) - (block (br_table 0 (i32.const 0) (i32.add)) (drop)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-return - (return (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-return - (return (i32.const 0) (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-select - (select (i32.add) (i32.const 1) (i32.const 2)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-select - (select (i32.const 0) (i32.add) (i32.const 1) (i32.const 2)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-call - (call 1 (i32.add)) (drop) - ) - (func (param i32 i32) (result i32) (local.get 0)) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-call - (call 1 (i32.const 0) (i32.add)) (drop) - ) - (func (param i32 i32) (result i32) (local.get 0)) - ) - "type mismatch" -) -(assert_invalid - (module - (func $f (param i32) (result i32) (local.get 0)) - (type $sig (func (param i32) (result i32))) - (table funcref (elem $f)) - (func $type-binary-1st-operand-empty-in-call_indirect - (block (result i32) - (call_indirect (type $sig) - (i32.add) (i32.const 0) - ) - (drop) - ) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $f (param i32) (result i32) (local.get 0)) - (type $sig (func (param i32) (result i32))) - (table funcref (elem $f)) - (func $type-binary-2nd-operand-empty-in-call_indirect - (block (result i32) - (call_indirect (type $sig) - (i32.const 0) (i32.add) (i32.const 0) - ) - (drop) - ) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-local.set - (local i32) - (local.set 0 (i32.add)) (local.get 0) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-local.set - (local i32) - (local.set 0 (i32.const 0) (i32.add)) (local.get 0) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-1st-operand-empty-in-local.tee - (local i32) - (local.tee 0 (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (func $type-binary-2nd-operand-empty-in-local.tee - (local i32) - (local.tee 0 (i32.const 0) (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (global $x (mut i32) (i32.const 0)) - (func $type-binary-1st-operand-empty-in-global.set - (global.set $x (i32.add)) (global.get $x) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (global $x (mut i32) (i32.const 0)) - (func $type-binary-2nd-operand-empty-in-global.set - (global.set $x (i32.const 0) (i32.add)) (global.get $x) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-binary-1st-operand-empty-in-memory.grow - (memory.grow (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-binary-2nd-operand-empty-in-memory.grow - (memory.grow (i32.const 0) (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-binary-1st-operand-empty-in-load - (i32.load (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 0) - (func $type-binary-2nd-operand-empty-in-load - (i32.load (i32.const 0) (i32.add)) (drop) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 1) - (func $type-binary-1st-operand-empty-in-store - (i32.store (i32.add) (i32.const 1)) - ) - ) - "type mismatch" -) -(assert_invalid - (module - (memory 1) - (func $type-binary-2nd-operand-empty-in-store - (i32.store (i32.const 1) (i32.add) (i32.const 0)) - ) - ) - "type mismatch" -) - - -;; Type check - -(assert_invalid (module (func (result i32) (i32.add (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.and (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.div_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.div_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.mul (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.or (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.rem_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.rem_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.rotl (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.rotr (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.shl (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.shr_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.shr_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.sub (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.xor (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.eqz (i64.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.clz (i64.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.ctz (i64.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.popcnt (i64.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.eq (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.ge_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.ge_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.gt_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.gt_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.le_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.le_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.lt_s (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.lt_u (i64.const 0) (f32.const 0)))) "type mismatch") -(assert_invalid (module (func (result i32) (i32.ne (i64.const 0) (f32.const 0)))) "type mismatch") - -(assert_malformed - (module quote "(func (result i32) (i32.const nan:arithmetic))") - "unexpected token" -) -(assert_malformed - (module quote "(func (result i32) (i32.const nan:canonical))") - "unexpected token" -) diff --git a/examples/wast/i64.wast b/examples/wast/i64.wast new file mode 100644 index 0000000..b662f3d --- /dev/null +++ b/examples/wast/i64.wast @@ -0,0 +1,494 @@ +;; i64 operations + +(module + (func (export "add") (param $x i64) (param $y i64) (result i64) (i64.add (local.get $x) (local.get $y))) + (func (export "sub") (param $x i64) (param $y i64) (result i64) (i64.sub (local.get $x) (local.get $y))) + (func (export "mul") (param $x i64) (param $y i64) (result i64) (i64.mul (local.get $x) (local.get $y))) + (func (export "div_s") (param $x i64) (param $y i64) (result i64) (i64.div_s (local.get $x) (local.get $y))) + (func (export "div_u") (param $x i64) (param $y i64) (result i64) (i64.div_u (local.get $x) (local.get $y))) + (func (export "rem_s") (param $x i64) (param $y i64) (result i64) (i64.rem_s (local.get $x) (local.get $y))) + (func (export "rem_u") (param $x i64) (param $y i64) (result i64) (i64.rem_u (local.get $x) (local.get $y))) + (func (export "and") (param $x i64) (param $y i64) (result i64) (i64.and (local.get $x) (local.get $y))) + (func (export "or") (param $x i64) (param $y i64) (result i64) (i64.or (local.get $x) (local.get $y))) + (func (export "xor") (param $x i64) (param $y i64) (result i64) (i64.xor (local.get $x) (local.get $y))) + (func (export "shl") (param $x i64) (param $y i64) (result i64) (i64.shl (local.get $x) (local.get $y))) + (func (export "shr_s") (param $x i64) (param $y i64) (result i64) (i64.shr_s (local.get $x) (local.get $y))) + (func (export "shr_u") (param $x i64) (param $y i64) (result i64) (i64.shr_u (local.get $x) (local.get $y))) + (func (export "rotl") (param $x i64) (param $y i64) (result i64) (i64.rotl (local.get $x) (local.get $y))) + (func (export "rotr") (param $x i64) (param $y i64) (result i64) (i64.rotr (local.get $x) (local.get $y))) + (func (export "clz") (param $x i64) (result i64) (i64.clz (local.get $x))) + (func (export "ctz") (param $x i64) (result i64) (i64.ctz (local.get $x))) + (func (export "popcnt") (param $x i64) (result i64) (i64.popcnt (local.get $x))) + (func (export "extend8_s") (param $x i64) (result i64) (i64.extend8_s (local.get $x))) + (func (export "extend16_s") (param $x i64) (result i64) (i64.extend16_s (local.get $x))) + (func (export "extend32_s") (param $x i64) (result i64) (i64.extend32_s (local.get $x))) + (func (export "eqz") (param $x i64) (result i32) (i64.eqz (local.get $x))) + (func (export "eq") (param $x i64) (param $y i64) (result i32) (i64.eq (local.get $x) (local.get $y))) + (func (export "ne") (param $x i64) (param $y i64) (result i32) (i64.ne (local.get $x) (local.get $y))) + (func (export "lt_s") (param $x i64) (param $y i64) (result i32) (i64.lt_s (local.get $x) (local.get $y))) + (func (export "lt_u") (param $x i64) (param $y i64) (result i32) (i64.lt_u (local.get $x) (local.get $y))) + (func (export "le_s") (param $x i64) (param $y i64) (result i32) (i64.le_s (local.get $x) (local.get $y))) + (func (export "le_u") (param $x i64) (param $y i64) (result i32) (i64.le_u (local.get $x) (local.get $y))) + (func (export "gt_s") (param $x i64) (param $y i64) (result i32) (i64.gt_s (local.get $x) (local.get $y))) + (func (export "gt_u") (param $x i64) (param $y i64) (result i32) (i64.gt_u (local.get $x) (local.get $y))) + (func (export "ge_s") (param $x i64) (param $y i64) (result i32) (i64.ge_s (local.get $x) (local.get $y))) + (func (export "ge_u") (param $x i64) (param $y i64) (result i32) (i64.ge_u (local.get $x) (local.get $y))) +) + +(assert_return (invoke "add" (i64.const 1) (i64.const 1)) (i64.const 2)) +(assert_return (invoke "add" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "add" (i64.const -1) (i64.const -1)) (i64.const -2)) +(assert_return (invoke "add" (i64.const -1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "add" (i64.const 0x7fffffffffffffff) (i64.const 1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "add" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "add" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i64.const 0)) +(assert_return (invoke "add" (i64.const 0x3fffffff) (i64.const 1)) (i64.const 0x40000000)) + +(assert_return (invoke "sub" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "sub" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "sub" (i64.const -1) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "sub" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "sub" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "sub" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i64.const 0)) +(assert_return (invoke "sub" (i64.const 0x3fffffff) (i64.const -1)) (i64.const 0x40000000)) + +(assert_return (invoke "mul" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "mul" (i64.const 1) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "mul" (i64.const -1) (i64.const -1)) (i64.const 1)) +(assert_return (invoke "mul" (i64.const 0x1000000000000000) (i64.const 4096)) (i64.const 0)) +(assert_return (invoke "mul" (i64.const 0x8000000000000000) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "mul" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "mul" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0x8000000000000001)) +(assert_return (invoke "mul" (i64.const 0x0123456789abcdef) (i64.const 0xfedcba9876543210)) (i64.const 0x2236d88fe5618cf0)) +(assert_return (invoke "mul" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i64.const 1)) + +(assert_trap (invoke "div_s" (i64.const 1) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "div_s" (i64.const 0) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const -1)) "integer overflow") +(assert_trap (invoke "div_s" (i64.const 0x8000000000000000) (i64.const 0)) "integer divide by zero") +(assert_return (invoke "div_s" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "div_s" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "div_s" (i64.const 0) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "div_s" (i64.const -1) (i64.const -1)) (i64.const 1)) +(assert_return (invoke "div_s" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0xc000000000000000)) +(assert_return (invoke "div_s" (i64.const 0x8000000000000001) (i64.const 1000)) (i64.const 0xffdf3b645a1cac09)) +(assert_return (invoke "div_s" (i64.const 5) (i64.const 2)) (i64.const 2)) +(assert_return (invoke "div_s" (i64.const -5) (i64.const 2)) (i64.const -2)) +(assert_return (invoke "div_s" (i64.const 5) (i64.const -2)) (i64.const -2)) +(assert_return (invoke "div_s" (i64.const -5) (i64.const -2)) (i64.const 2)) +(assert_return (invoke "div_s" (i64.const 7) (i64.const 3)) (i64.const 2)) +(assert_return (invoke "div_s" (i64.const -7) (i64.const 3)) (i64.const -2)) +(assert_return (invoke "div_s" (i64.const 7) (i64.const -3)) (i64.const -2)) +(assert_return (invoke "div_s" (i64.const -7) (i64.const -3)) (i64.const 2)) +(assert_return (invoke "div_s" (i64.const 11) (i64.const 5)) (i64.const 2)) +(assert_return (invoke "div_s" (i64.const 17) (i64.const 7)) (i64.const 2)) + +(assert_trap (invoke "div_u" (i64.const 1) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "div_u" (i64.const 0) (i64.const 0)) "integer divide by zero") +(assert_return (invoke "div_u" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "div_u" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "div_u" (i64.const -1) (i64.const -1)) (i64.const 1)) +(assert_return (invoke "div_u" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "div_u" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0x4000000000000000)) +(assert_return (invoke "div_u" (i64.const 0x8ff00ff00ff00ff0) (i64.const 0x100000001)) (i64.const 0x8ff00fef)) +(assert_return (invoke "div_u" (i64.const 0x8000000000000001) (i64.const 1000)) (i64.const 0x20c49ba5e353f7)) +(assert_return (invoke "div_u" (i64.const 5) (i64.const 2)) (i64.const 2)) +(assert_return (invoke "div_u" (i64.const -5) (i64.const 2)) (i64.const 0x7ffffffffffffffd)) +(assert_return (invoke "div_u" (i64.const 5) (i64.const -2)) (i64.const 0)) +(assert_return (invoke "div_u" (i64.const -5) (i64.const -2)) (i64.const 0)) +(assert_return (invoke "div_u" (i64.const 7) (i64.const 3)) (i64.const 2)) +(assert_return (invoke "div_u" (i64.const 11) (i64.const 5)) (i64.const 2)) +(assert_return (invoke "div_u" (i64.const 17) (i64.const 7)) (i64.const 2)) + +(assert_trap (invoke "rem_s" (i64.const 1) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "rem_s" (i64.const 0) (i64.const 0)) "integer divide by zero") +(assert_return (invoke "rem_s" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const -1) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0)) +(assert_return (invoke "rem_s" (i64.const 0x8000000000000001) (i64.const 1000)) (i64.const -807)) +(assert_return (invoke "rem_s" (i64.const 5) (i64.const 2)) (i64.const 1)) +(assert_return (invoke "rem_s" (i64.const -5) (i64.const 2)) (i64.const -1)) +(assert_return (invoke "rem_s" (i64.const 5) (i64.const -2)) (i64.const 1)) +(assert_return (invoke "rem_s" (i64.const -5) (i64.const -2)) (i64.const -1)) +(assert_return (invoke "rem_s" (i64.const 7) (i64.const 3)) (i64.const 1)) +(assert_return (invoke "rem_s" (i64.const -7) (i64.const 3)) (i64.const -1)) +(assert_return (invoke "rem_s" (i64.const 7) (i64.const -3)) (i64.const 1)) +(assert_return (invoke "rem_s" (i64.const -7) (i64.const -3)) (i64.const -1)) +(assert_return (invoke "rem_s" (i64.const 11) (i64.const 5)) (i64.const 1)) +(assert_return (invoke "rem_s" (i64.const 17) (i64.const 7)) (i64.const 3)) + +(assert_trap (invoke "rem_u" (i64.const 1) (i64.const 0)) "integer divide by zero") +(assert_trap (invoke "rem_u" (i64.const 0) (i64.const 0)) "integer divide by zero") +(assert_return (invoke "rem_u" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "rem_u" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "rem_u" (i64.const -1) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "rem_u" (i64.const 0x8000000000000000) (i64.const -1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "rem_u" (i64.const 0x8000000000000000) (i64.const 2)) (i64.const 0)) +(assert_return (invoke "rem_u" (i64.const 0x8ff00ff00ff00ff0) (i64.const 0x100000001)) (i64.const 0x80000001)) +(assert_return (invoke "rem_u" (i64.const 0x8000000000000001) (i64.const 1000)) (i64.const 809)) +(assert_return (invoke "rem_u" (i64.const 5) (i64.const 2)) (i64.const 1)) +(assert_return (invoke "rem_u" (i64.const -5) (i64.const 2)) (i64.const 1)) +(assert_return (invoke "rem_u" (i64.const 5) (i64.const -2)) (i64.const 5)) +(assert_return (invoke "rem_u" (i64.const -5) (i64.const -2)) (i64.const -5)) +(assert_return (invoke "rem_u" (i64.const 7) (i64.const 3)) (i64.const 1)) +(assert_return (invoke "rem_u" (i64.const 11) (i64.const 5)) (i64.const 1)) +(assert_return (invoke "rem_u" (i64.const 17) (i64.const 7)) (i64.const 3)) + +(assert_return (invoke "and" (i64.const 1) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "and" (i64.const 0) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "and" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "and" (i64.const 0) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "and" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i64.const 0)) +(assert_return (invoke "and" (i64.const 0x7fffffffffffffff) (i64.const -1)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "and" (i64.const 0xf0f0ffff) (i64.const 0xfffff0f0)) (i64.const 0xf0f0f0f0)) +(assert_return (invoke "and" (i64.const 0xffffffffffffffff) (i64.const 0xffffffffffffffff)) (i64.const 0xffffffffffffffff)) + +(assert_return (invoke "or" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "or" (i64.const 0) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "or" (i64.const 1) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "or" (i64.const 0) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "or" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i64.const -1)) +(assert_return (invoke "or" (i64.const 0x8000000000000000) (i64.const 0)) (i64.const 0x8000000000000000)) +(assert_return (invoke "or" (i64.const 0xf0f0ffff) (i64.const 0xfffff0f0)) (i64.const 0xffffffff)) +(assert_return (invoke "or" (i64.const 0xffffffffffffffff) (i64.const 0xffffffffffffffff)) (i64.const 0xffffffffffffffff)) + +(assert_return (invoke "xor" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "xor" (i64.const 0) (i64.const 1)) (i64.const 1)) +(assert_return (invoke "xor" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "xor" (i64.const 0) (i64.const 0)) (i64.const 0)) +(assert_return (invoke "xor" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i64.const -1)) +(assert_return (invoke "xor" (i64.const 0x8000000000000000) (i64.const 0)) (i64.const 0x8000000000000000)) +(assert_return (invoke "xor" (i64.const -1) (i64.const 0x8000000000000000)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "xor" (i64.const -1) (i64.const 0x7fffffffffffffff)) (i64.const 0x8000000000000000)) +(assert_return (invoke "xor" (i64.const 0xf0f0ffff) (i64.const 0xfffff0f0)) (i64.const 0x0f0f0f0f)) +(assert_return (invoke "xor" (i64.const 0xffffffffffffffff) (i64.const 0xffffffffffffffff)) (i64.const 0)) + +(assert_return (invoke "shl" (i64.const 1) (i64.const 1)) (i64.const 2)) +(assert_return (invoke "shl" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "shl" (i64.const 0x7fffffffffffffff) (i64.const 1)) (i64.const 0xfffffffffffffffe)) +(assert_return (invoke "shl" (i64.const 0xffffffffffffffff) (i64.const 1)) (i64.const 0xfffffffffffffffe)) +(assert_return (invoke "shl" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "shl" (i64.const 0x4000000000000000) (i64.const 1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "shl" (i64.const 1) (i64.const 63)) (i64.const 0x8000000000000000)) +(assert_return (invoke "shl" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "shl" (i64.const 1) (i64.const 65)) (i64.const 2)) +(assert_return (invoke "shl" (i64.const 1) (i64.const -1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "shl" (i64.const 1) (i64.const 0x7fffffffffffffff)) (i64.const 0x8000000000000000)) + +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const 1)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const 0x7fffffffffffffff) (i64.const 1)) (i64.const 0x3fffffffffffffff)) +(assert_return (invoke "shr_s" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 0xc000000000000000)) +(assert_return (invoke "shr_s" (i64.const 0x4000000000000000) (i64.const 1)) (i64.const 0x2000000000000000)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 65)) (i64.const 0)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 0x7fffffffffffffff)) (i64.const 0)) +(assert_return (invoke "shr_s" (i64.const 1) (i64.const 0x8000000000000000)) (i64.const 1)) +(assert_return (invoke "shr_s" (i64.const 0x8000000000000000) (i64.const 63)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const 64)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const 65)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const -1)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const 0x7fffffffffffffff)) (i64.const -1)) +(assert_return (invoke "shr_s" (i64.const -1) (i64.const 0x8000000000000000)) (i64.const -1)) + +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 1)) (i64.const 0)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const 1)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "shr_u" (i64.const 0x7fffffffffffffff) (i64.const 1)) (i64.const 0x3fffffffffffffff)) +(assert_return (invoke "shr_u" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 0x4000000000000000)) +(assert_return (invoke "shr_u" (i64.const 0x4000000000000000) (i64.const 1)) (i64.const 0x2000000000000000)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 65)) (i64.const 0)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const -1)) (i64.const 0)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 0x7fffffffffffffff)) (i64.const 0)) +(assert_return (invoke "shr_u" (i64.const 1) (i64.const 0x8000000000000000)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const 0x8000000000000000) (i64.const 63)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const 64)) (i64.const -1)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const 65)) (i64.const 0x7fffffffffffffff)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const -1)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const 0x7fffffffffffffff)) (i64.const 1)) +(assert_return (invoke "shr_u" (i64.const -1) (i64.const 0x8000000000000000)) (i64.const -1)) + +(assert_return (invoke "rotl" (i64.const 1) (i64.const 1)) (i64.const 2)) +(assert_return (invoke "rotl" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "rotl" (i64.const -1) (i64.const 1)) (i64.const -1)) +(assert_return (invoke "rotl" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "rotl" (i64.const 0xabcd987602468ace) (i64.const 1)) (i64.const 0x579b30ec048d159d)) +(assert_return (invoke "rotl" (i64.const 0xfe000000dc000000) (i64.const 4)) (i64.const 0xe000000dc000000f)) +(assert_return (invoke "rotl" (i64.const 0xabcd1234ef567809) (i64.const 53)) (i64.const 0x013579a2469deacf)) +(assert_return (invoke "rotl" (i64.const 0xabd1234ef567809c) (i64.const 63)) (i64.const 0x55e891a77ab3c04e)) +(assert_return (invoke "rotl" (i64.const 0xabcd1234ef567809) (i64.const 0xf5)) (i64.const 0x013579a2469deacf)) +(assert_return (invoke "rotl" (i64.const 0xabcd7294ef567809) (i64.const 0xffffffffffffffed)) (i64.const 0xcf013579ae529dea)) +(assert_return (invoke "rotl" (i64.const 0xabd1234ef567809c) (i64.const 0x800000000000003f)) (i64.const 0x55e891a77ab3c04e)) +(assert_return (invoke "rotl" (i64.const 1) (i64.const 63)) (i64.const 0x8000000000000000)) +(assert_return (invoke "rotl" (i64.const 0x8000000000000000) (i64.const 1)) (i64.const 1)) + +(assert_return (invoke "rotr" (i64.const 1) (i64.const 1)) (i64.const 0x8000000000000000)) +(assert_return (invoke "rotr" (i64.const 1) (i64.const 0)) (i64.const 1)) +(assert_return (invoke "rotr" (i64.const -1) (i64.const 1)) (i64.const -1)) +(assert_return (invoke "rotr" (i64.const 1) (i64.const 64)) (i64.const 1)) +(assert_return (invoke "rotr" (i64.const 0xabcd987602468ace) (i64.const 1)) (i64.const 0x55e6cc3b01234567)) +(assert_return (invoke "rotr" (i64.const 0xfe000000dc000000) (i64.const 4)) (i64.const 0x0fe000000dc00000)) +(assert_return (invoke "rotr" (i64.const 0xabcd1234ef567809) (i64.const 53)) (i64.const 0x6891a77ab3c04d5e)) +(assert_return (invoke "rotr" (i64.const 0xabd1234ef567809c) (i64.const 63)) (i64.const 0x57a2469deacf0139)) +(assert_return (invoke "rotr" (i64.const 0xabcd1234ef567809) (i64.const 0xf5)) (i64.const 0x6891a77ab3c04d5e)) +(assert_return (invoke "rotr" (i64.const 0xabcd7294ef567809) (i64.const 0xffffffffffffffed)) (i64.const 0x94a77ab3c04d5e6b)) +(assert_return (invoke "rotr" (i64.const 0xabd1234ef567809c) (i64.const 0x800000000000003f)) (i64.const 0x57a2469deacf0139)) +(assert_return (invoke "rotr" (i64.const 1) (i64.const 63)) (i64.const 2)) +(assert_return (invoke "rotr" (i64.const 0x8000000000000000) (i64.const 63)) (i64.const 1)) + +(assert_return (invoke "clz" (i64.const 0xffffffffffffffff)) (i64.const 0)) +(assert_return (invoke "clz" (i64.const 0)) (i64.const 64)) +(assert_return (invoke "clz" (i64.const 0x00008000)) (i64.const 48)) +(assert_return (invoke "clz" (i64.const 0xff)) (i64.const 56)) +(assert_return (invoke "clz" (i64.const 0x8000000000000000)) (i64.const 0)) +(assert_return (invoke "clz" (i64.const 1)) (i64.const 63)) +(assert_return (invoke "clz" (i64.const 2)) (i64.const 62)) +(assert_return (invoke "clz" (i64.const 0x7fffffffffffffff)) (i64.const 1)) + +(assert_return (invoke "ctz" (i64.const -1)) (i64.const 0)) +(assert_return (invoke "ctz" (i64.const 0)) (i64.const 64)) +(assert_return (invoke "ctz" (i64.const 0x00008000)) (i64.const 15)) +(assert_return (invoke "ctz" (i64.const 0x00010000)) (i64.const 16)) +(assert_return (invoke "ctz" (i64.const 0x8000000000000000)) (i64.const 63)) +(assert_return (invoke "ctz" (i64.const 0x7fffffffffffffff)) (i64.const 0)) + +(assert_return (invoke "popcnt" (i64.const -1)) (i64.const 64)) +(assert_return (invoke "popcnt" (i64.const 0)) (i64.const 0)) +(assert_return (invoke "popcnt" (i64.const 0x00008000)) (i64.const 1)) +(assert_return (invoke "popcnt" (i64.const 0x8000800080008000)) (i64.const 4)) +(assert_return (invoke "popcnt" (i64.const 0x7fffffffffffffff)) (i64.const 63)) +(assert_return (invoke "popcnt" (i64.const 0xAAAAAAAA55555555)) (i64.const 32)) +(assert_return (invoke "popcnt" (i64.const 0x99999999AAAAAAAA)) (i64.const 32)) +(assert_return (invoke "popcnt" (i64.const 0xDEADBEEFDEADBEEF)) (i64.const 48)) + +(assert_return (invoke "extend8_s" (i64.const 0)) (i64.const 0)) +(assert_return (invoke "extend8_s" (i64.const 0x7f)) (i64.const 127)) +(assert_return (invoke "extend8_s" (i64.const 0x80)) (i64.const -128)) +(assert_return (invoke "extend8_s" (i64.const 0xff)) (i64.const -1)) +(assert_return (invoke "extend8_s" (i64.const 0x01234567_89abcd_00)) (i64.const 0)) +(assert_return (invoke "extend8_s" (i64.const 0xfedcba98_765432_80)) (i64.const -0x80)) +(assert_return (invoke "extend8_s" (i64.const -1)) (i64.const -1)) + +(assert_return (invoke "extend16_s" (i64.const 0)) (i64.const 0)) +(assert_return (invoke "extend16_s" (i64.const 0x7fff)) (i64.const 32767)) +(assert_return (invoke "extend16_s" (i64.const 0x8000)) (i64.const -32768)) +(assert_return (invoke "extend16_s" (i64.const 0xffff)) (i64.const -1)) +(assert_return (invoke "extend16_s" (i64.const 0x12345678_9abc_0000)) (i64.const 0)) +(assert_return (invoke "extend16_s" (i64.const 0xfedcba98_7654_8000)) (i64.const -0x8000)) +(assert_return (invoke "extend16_s" (i64.const -1)) (i64.const -1)) + +(assert_return (invoke "extend32_s" (i64.const 0)) (i64.const 0)) +(assert_return (invoke "extend32_s" (i64.const 0x7fff)) (i64.const 32767)) +(assert_return (invoke "extend32_s" (i64.const 0x8000)) (i64.const 32768)) +(assert_return (invoke "extend32_s" (i64.const 0xffff)) (i64.const 65535)) +(assert_return (invoke "extend32_s" (i64.const 0x7fffffff)) (i64.const 0x7fffffff)) +(assert_return (invoke "extend32_s" (i64.const 0x80000000)) (i64.const -0x80000000)) +(assert_return (invoke "extend32_s" (i64.const 0xffffffff)) (i64.const -1)) +(assert_return (invoke "extend32_s" (i64.const 0x01234567_00000000)) (i64.const 0)) +(assert_return (invoke "extend32_s" (i64.const 0xfedcba98_80000000)) (i64.const -0x80000000)) +(assert_return (invoke "extend32_s" (i64.const -1)) (i64.const -1)) + +(assert_return (invoke "eqz" (i64.const 0)) (i32.const 1)) +(assert_return (invoke "eqz" (i64.const 1)) (i32.const 0)) +(assert_return (invoke "eqz" (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "eqz" (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "eqz" (i64.const 0xffffffffffffffff)) (i32.const 0)) + +(assert_return (invoke "eq" (i64.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "eq" (i64.const 1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "eq" (i64.const -1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "eq" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "eq" (i64.const -1) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "eq" (i64.const 1) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "eq" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + +(assert_return (invoke "ne" (i64.const 0) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "ne" (i64.const 1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "ne" (i64.const -1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "ne" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "ne" (i64.const -1) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "ne" (i64.const 1) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "ne" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 1)) + +(assert_return (invoke "lt_s" (i64.const 0) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const -1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "lt_s" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const -1) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 1) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 0) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "lt_s" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "lt_s" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "lt_s" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "lt_s" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "lt_s" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + +(assert_return (invoke "lt_u" (i64.const 0) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const -1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const -1) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 1) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "lt_u" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "lt_u" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "lt_u" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "lt_u" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 1)) + +(assert_return (invoke "le_s" (i64.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const -1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const -1) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 1) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "le_s" (i64.const 0) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "le_s" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "le_s" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "le_s" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + +(assert_return (invoke "le_u" (i64.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const 1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const -1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "le_u" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const -1) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const 1) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "le_u" (i64.const 0) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "le_u" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "le_u" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "le_u" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "le_u" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 1)) + +(assert_return (invoke "gt_s" (i64.const 0) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const -1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const -1) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 1) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "gt_s" (i64.const 0) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "gt_s" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "gt_s" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "gt_s" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 1)) + +(assert_return (invoke "gt_u" (i64.const 0) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const 1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const -1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "gt_u" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const -1) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const 1) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "gt_u" (i64.const 0) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "gt_u" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "gt_u" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "gt_u" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "gt_u" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + +(assert_return (invoke "ge_s" (i64.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const -1) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "ge_s" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const -1) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 1) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 0) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "ge_s" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 0)) +(assert_return (invoke "ge_s" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "ge_s" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ge_s" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 0)) +(assert_return (invoke "ge_s" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 1)) + +(assert_return (invoke "ge_u" (i64.const 0) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const -1) (i64.const 1)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0x8000000000000000) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0x7fffffffffffffff) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const -1) (i64.const -1)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 1) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0) (i64.const 1)) (i32.const 0)) +(assert_return (invoke "ge_u" (i64.const 0x8000000000000000) (i64.const 0)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0) (i64.const 0x8000000000000000)) (i32.const 0)) +(assert_return (invoke "ge_u" (i64.const 0x8000000000000000) (i64.const -1)) (i32.const 0)) +(assert_return (invoke "ge_u" (i64.const -1) (i64.const 0x8000000000000000)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0x8000000000000000) (i64.const 0x7fffffffffffffff)) (i32.const 1)) +(assert_return (invoke "ge_u" (i64.const 0x7fffffffffffffff) (i64.const 0x8000000000000000)) (i32.const 0)) + + +;; Type check + +(assert_invalid (module (func (result i64) (i64.add (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.and (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.div_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.div_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.mul (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.or (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rem_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rem_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rotl (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.rotr (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shl (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shr_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.shr_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.sub (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.xor (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.eqz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.clz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ctz (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.popcnt (i32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.eq (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ge_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ge_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.gt_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.gt_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.le_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.le_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.lt_s (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.lt_u (i32.const 0) (f32.const 0)))) "type mismatch") +(assert_invalid (module (func (result i64) (i64.ne (i32.const 0) (f32.const 0)))) "type mismatch") + +(assert_malformed + (module quote "(func (result i64) (i64.const nan:arithmetic))") + "unexpected token" +) +(assert_malformed + (module quote "(func (result i64) (i64.const nan:canonical))") + "unexpected token" +)