summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/translate-to-fuzz.h27
-rw-r--r--test/passes/translate-to-fuzz.txt1421
2 files changed, 666 insertions, 782 deletions
diff --git a/src/tools/translate-to-fuzz.h b/src/tools/translate-to-fuzz.h
index e84ffd364..0d2eb47f3 100644
--- a/src/tools/translate-to-fuzz.h
+++ b/src/tools/translate-to-fuzz.h
@@ -27,6 +27,7 @@ high chance for set at start of loop
*/
#include <wasm-builder.h>
+#include <ast/literal-utils.h>
namespace wasm {
@@ -833,7 +834,7 @@ private:
Expression* makeConst(WasmType type) {
Literal value;
- switch (upTo(3)) {
+ switch (upTo(4)) {
case 0: {
// totally random, entire range
switch (type) {
@@ -847,12 +848,14 @@ private:
}
case 1: {
// small range
- int32_t small;
- switch (upTo(4)) {
+ int64_t small;
+ switch (upTo(6)) {
case 0: small = int8_t(get()); break;
case 1: small = uint8_t(get()); break;
case 2: small = int16_t(get16()); break;
case 3: small = uint16_t(get16()); break;
+ case 4: small = int32_t(get32()); break;
+ case 5: small = uint32_t(get32()); break;
default: WASM_UNREACHABLE();
}
switch (type) {
@@ -898,8 +901,26 @@ private:
std::numeric_limits<uint64_t>::max())); break;
default: WASM_UNREACHABLE();
}
+ // tweak around special values
+ if (oneIn(3)) {
+ value = value.add(LiteralUtils::makeLiteralFromInt32(upTo(3) - 1, type));
+ }
break;
}
+ case 3: {
+ // powers of 2
+ switch (type) {
+ case i32: value = Literal(int32_t(1) << upTo(32)); break;
+ case i64: value = Literal(int64_t(1) << upTo(64)); break;
+ case f32: value = Literal(float(int64_t(1) << upTo(64))); break;
+ case f64: value = Literal(double(int64_t(1) << upTo(64))); break;
+ default: WASM_UNREACHABLE();
+ }
+ // maybe negative
+ if (oneIn(2)) {
+ value = value.mul(LiteralUtils::makeLiteralFromInt32(-1, type));
+ }
+ }
}
auto* ret = wasm.allocator.alloc<Const>();
ret->value = value;
diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt
index 172441cc3..21053fd2e 100644
--- a/test/passes/translate-to-fuzz.txt
+++ b/test/passes/translate-to-fuzz.txt
@@ -1,31 +1,21 @@
(module
(type $FUNCSIG$i (func (result i32)))
- (type $FUNCSIG$ifd (func (param f32 f64) (result i32)))
- (type $FUNCSIG$j (func (result i64)))
- (type $FUNCSIG$d (func (result f64)))
- (type $FUNCSIG$fdd (func (param f64 f64) (result f32)))
- (type $FUNCSIG$ji (func (param i32) (result i64)))
- (type $FUNCSIG$dd (func (param f64) (result f64)))
- (type $FUNCSIG$df (func (param f32) (result f64)))
+ (type $FUNCSIG$ffdj (func (param f32 f64 i64) (result f32)))
+ (type $FUNCSIG$ffj (func (param f32 i64) (result f32)))
(type $FUNCSIG$v (func))
- (type $FUNCSIG$djf (func (param i64 f32) (result f64)))
+ (type $FUNCSIG$j (func (result i64)))
+ (type $FUNCSIG$fd (func (param f64) (result f32)))
(global $hangLimit (mut i32) (i32.const 100))
- (table 10 anyfunc)
- (elem (i32.const 0) $func_0 $func_0 $func_1 $func_4 $func_5 $func_5 $func_8 $func_11 $func_15 $func_17)
+ (table 8 8 anyfunc)
+ (elem (i32.const 0) $func_0 $func_0 $func_2 $func_3 $func_3 $func_8 $func_9 $func_9)
(memory $0 1 1)
(export "func_0" (func $func_0))
- (export "func_1" (func $func_1))
- (export "func_2" (func $func_2))
(export "func_3" (func $func_3))
(export "func_4" (func $func_4))
- (export "func_6" (func $func_6))
+ (export "func_5" (func $func_5))
+ (export "func_7" (func $func_7))
+ (export "func_8" (func $func_8))
(export "func_9" (func $func_9))
- (export "func_13" (func $func_13))
- (export "func_15" (func $func_15))
- (export "func_17" (func $func_17))
- (export "func_18" (func $func_18))
- (export "func_19" (func $func_19))
- (export "func_21" (func $func_21))
(export "hangLimitInitializer" (func $hangLimitInitializer))
(func $func_0 (type $FUNCSIG$i) (result i32)
(local $0 f32)
@@ -37,7 +27,7 @@
(get_global $hangLimit)
)
(return
- (i32.const -11)
+ (i32.const 9014)
)
)
(set_global $hangLimit
@@ -54,7 +44,7 @@
(get_global $hangLimit)
)
(return
- (i32.const 26963)
+ (i32.const 2321)
)
)
(set_global $hangLimit
@@ -66,39 +56,19 @@
)
(i64.trunc_u/f64
(drop
- (loop $label$3
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i32.const 32767)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (return
- (i32.const -73)
- )
- )
+ (unreachable)
)
)
)
)
- (func $func_1 (type $FUNCSIG$ifd) (param $0 f32) (param $1 f64) (result i32)
+ (func $func_1 (param $0 i32) (param $1 i64) (result f32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i32.const -34)
+ (f32.const 28)
)
)
(set_global $hangLimit
@@ -108,20 +78,23 @@
)
)
)
- (block $label$0 (result i32)
+ (block $label$0 (result f32)
(return
- (i32.const 66)
+ (f32.const 291395360)
)
)
)
- (func $func_2 (type $FUNCSIG$j) (result i64)
+ (func $func_2 (type $FUNCSIG$fd) (param $0 f64) (result f32)
+ (local $1 i32)
+ (local $2 i32)
+ (local $3 f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -6)
+ (f32.const -1)
)
)
(set_global $hangLimit
@@ -131,128 +104,22 @@
)
)
)
- (block $label$0 (result i64)
+ (block $label$0 (result f32)
+ (nop)
+ (nop)
(return
- (i64.const 6174)
- )
- )
- )
- (func $func_3 (type $FUNCSIG$d) (result f64)
- (local $0 i64)
- (local $1 i64)
- (local $2 f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (get_local $2)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (call $deNan64
- (f64.max
- (f64.const -nan:0xfffffffffffb3)
- (tee_local $2
- (call $deNan64
- (select
- (call $deNan64
- (f64.div
- (block $label$1 (result f64)
- (return
- (f64.const 2147483647)
- )
- )
- (call $deNan64
- (f64.mul
- (call $deNan64
- (select
- (loop $label$2 (result f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f64.const 18446744073709551615)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (f64.const -nan:0xffffffffffff4)
- )
- (get_local $2)
- (i32.load8_s offset=3
- (i32.and
- (i32.load16_s offset=4
- (i32.and
- (i32.const 12602)
- (i32.const 31)
- )
- )
- (i32.const 31)
- )
- )
- )
- )
- (get_local $2)
- )
- )
- )
- )
- (call $deNan64
- (select
- (f64.load offset=22
- (i32.and
- (i32.load16_u offset=22 align=1
- (i32.and
- (i32.const 32767)
- (i32.const 31)
- )
- )
- (i32.const 31)
- )
- )
- (call $deNan64
- (f64.convert_s/i32
- (i32.const 176)
- )
- )
- (i32.const 1)
- )
- )
- (block $label$0 (result i32)
- (return
- (f64.const 110)
- )
- )
- )
- )
- )
+ (f32.const -nan:0x7fffad)
)
)
)
- (func $func_4 (type $FUNCSIG$fdd) (param $0 f64) (param $1 f64) (result f32)
- (local $2 i64)
+ (func $func_3 (type $FUNCSIG$ffdj) (param $0 f32) (param $1 f64) (param $2 i64) (result f32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 4.136946824350359e-25)
+ (f32.const 2010888862731133267687117e5)
)
)
(set_global $hangLimit
@@ -263,88 +130,19 @@
)
)
(block $label$0 (result f32)
- (block $label$1 (result f32)
- (loop $label$2 (result f32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const -2147483648)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (f32.const 1.5518369315425492e-36)
- )
- )
- )
- )
- (func $func_5 (type $FUNCSIG$dd) (param $0 f64) (result f64)
- (local $1 f64)
- (local $2 i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (get_local $1)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$0 (result f64)
(return
- (f64.const -nan:0xfffffffffffeb)
- )
- )
- )
- (func $func_6 (type $FUNCSIG$ji) (param $0 i32) (result i64)
- (local $1 f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 9223372036854775807)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$0 (result i64)
- (block $label$1 (result i64)
- (return
- (i64.const -94)
- )
+ (f32.const -2147483648)
)
)
)
- (func $func_7 (result f64)
+ (func $func_4 (type $FUNCSIG$ffj) (param $0 f32) (param $1 i64) (result f32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f64.const 246)
+ (f32.const 0)
)
)
(set_global $hangLimit
@@ -354,53 +152,26 @@
)
)
)
- (block $label$0 (result f64)
+ (block $label$0 (result f32)
(return
- (f64.const 2)
+ (f32.const 4035018963812352)
)
)
)
- (func $func_8 (type $FUNCSIG$v)
- (local $0 f32)
- (local $1 i64)
- (local $2 f64)
- (local $3 i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i64.store8 offset=4
- (i32.and
- (i32.const 48)
- (i32.const 31)
- )
- (call $func_2)
- )
- )
- (func $func_9 (type $FUNCSIG$d) (result f64)
+ (func $func_5 (type $FUNCSIG$v)
(local $0 i64)
- (local $1 i64)
+ (local $1 i32)
(local $2 f32)
(local $3 i64)
- (local $4 f32)
+ (local $4 i32)
+ (local $5 f32)
+ (local $6 i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
- (return
- (f64.const 18446744073709551615)
- )
+ (return)
)
(set_global $hangLimit
(i32.sub
@@ -409,54 +180,36 @@
)
)
)
- (f64.load offset=4
- (i32.and
- (block $label$0 (result i32)
- (block $label$1 (result i32)
- (return
- (f64.const -99)
- )
+ (loop $label$0
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
)
+ (return)
)
- (i32.const 31)
- )
- )
- )
- (func $func_10 (result f32)
- (local $0 i64)
- (local $1 f32)
- (local $2 f32)
- (local $3 f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (get_local $1)
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
)
)
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (block $label$1
+ (br_if $label$0
+ (i32.const 13609)
)
)
)
- (block $label$0
- (return
- (get_local $2)
- )
- )
)
- (func $func_11 (type $FUNCSIG$i) (result i32)
+ (func $func_6 (result f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i32.const 1954248050)
+ (f64.const 512)
)
)
(set_global $hangLimit
@@ -466,27 +219,22 @@
)
)
)
- (i32.popcnt
- (block $label$0 (result i32)
- (call_indirect $FUNCSIG$i
- (i32.const 0)
- )
+ (block $label$0 (result f64)
+ (return
+ (f64.const 25444)
)
)
)
- (func $func_12 (result f64)
- (local $0 i32)
- (local $1 i32)
- (local $2 i32)
- (local $3 f64)
- (local $4 i64)
+ (func $func_7 (type $FUNCSIG$j) (result i64)
+ (local $0 f64)
+ (local $1 f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f64.const -88)
+ (i64.const 268435456)
)
)
(set_global $hangLimit
@@ -496,87 +244,131 @@
)
)
)
- (block $label$0 (result f64)
- (call_indirect $FUNCSIG$dd
- (call_indirect $FUNCSIG$dd
- (call_indirect $FUNCSIG$dd
- (f64.load offset=4 align=1
- (i32.and
- (tee_local $0
- (i32.rem_s
- (call $func_1
- (f32.const 20)
- (tee_local $3
- (if (result f64)
- (select
- (i32.wrap/i64
- (i64.const 0)
- )
- (i32.load offset=4 align=2
- (i32.and
- (get_local $1)
- (i32.const 31)
- )
- )
- (i32.trunc_s/f64
- (f64.const 4294967295)
- )
- )
- (block $label$1 (result f64)
- (return
- (get_local $3)
- )
- )
- (block $label$2 (result f64)
- (return
- (get_local $3)
- )
- )
- )
- )
- )
- (if (result i32)
- (i32.eqz
- (i64.le_s
- (if (result i64)
- (i32.eqz
+ (i64.rem_s
+ (i64.shr_u
+ (select
+ (loop $label$0 (result i64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 65535)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i64.const -72057594037927936)
+ )
+ (if (result i64)
+ (call $func_0)
+ (select
+ (i64.const 576460752303423488)
+ (if (result i64)
+ (i32.eqz
+ (i32.reinterpret/f32
+ (call $deNan32
+ (f32.demote/f64
+ (call $deNan64
+ (f64.promote/f32
+ (call $deNan32
(select
- (i32.div_u
- (i32.const 4)
- (i32.const 65533)
- )
- (i32.load offset=22 align=2
- (i32.and
- (get_local $1)
- (i32.const 31)
+ (f32.const -nan:0x7fffe4)
+ (call $deNan32
+ (select
+ (f32.const -2147483648)
+ (f32.const 29298)
+ (i32.const 2105480203)
)
)
- (tee_local $1
- (tee_local $0
- (i32.const 10282)
- )
- )
- )
- )
- (block $label$3 (result i64)
- (return
- (f64.const 14675337377663989850308608)
- )
- )
- (block $label$4 (result i64)
- (return
- (f64.const 2147483647)
+ (i32.const 1)
)
)
)
- (loop $label$5 (result i64)
+ )
+ )
+ )
+ )
+ )
+ (select
+ (i64.const 2147483647)
+ (if (result i64)
+ (call $func_0)
+ (block $label$1 (result i64)
+ (return
+ (i64.const -77)
+ )
+ )
+ (block $label$2 (result i64)
+ (return
+ (i64.const 9223372036854775807)
+ )
+ )
+ )
+ (i32.reinterpret/f32
+ (f32.const -nan:0x7fffa1)
+ )
+ )
+ (block $label$3 (result i64)
+ (return
+ (i64.const -26)
+ )
+ )
+ )
+ (select
+ (i32.const 1212760647)
+ (call $func_0)
+ (i32.const 4625)
+ )
+ )
+ (block $label$4 (result i64)
+ (if (result i64)
+ (i32.eqz
+ (i64.lt_u
+ (i64.const 13856)
+ (i64.const 274075651)
+ )
+ )
+ (block $label$5 (result i64)
+ (i64.const 32767)
+ )
+ (block $label$6 (result i64)
+ (loop $label$7
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 3840)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$8
+ (drop
+ (call_indirect $FUNCSIG$ffdj
+ (f32.const 225300085833990144)
+ (get_local $1)
+ (loop $label$9 (result i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (get_local $3)
+ (i64.const -22)
)
)
(set_global $hangLimit
@@ -586,29 +378,196 @@
)
)
)
- (block $label$6 (result i64)
- (return
- (get_local $3)
+ (block $label$10 (result i64)
+ (br $label$8)
+ )
+ )
+ (i32.const 3)
+ )
+ )
+ )
+ )
+ (i64.const 539369059)
+ )
+ )
+ )
+ )
+ (call $func_0)
+ )
+ (i64.trunc_s/f32
+ (call $func_2
+ (f64.const 106)
+ )
+ )
+ )
+ (if (result i64)
+ (i32.load16_s offset=2 align=1
+ (i32.and
+ (if (result i32)
+ (loop $label$11 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -262144)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.reinterpret/f32
+ (call_indirect $FUNCSIG$ffdj
+ (block $label$12 (result f32)
+ (call $deNan32
+ (f32.div
+ (call $func_4
+ (f32.const -8589934592)
+ (i64.const -1)
+ )
+ (block $label$13 (result f32)
+ (return
+ (i64.const 16220)
+ )
+ )
+ )
+ )
+ )
+ (tee_local $1
+ (f64.const 65536)
+ )
+ (block $label$14 (result i64)
+ (return
+ (i64.const 13366)
+ )
+ )
+ (i32.const 4)
+ )
+ )
+ )
+ (block $label$15 (result i32)
+ (nop)
+ (drop
+ (f64.const -nan:0xfffffffffffb4)
+ )
+ (br_if $label$15
+ (block $label$19 (result i32)
+ (return
+ (i64.const 1152921504606846976)
+ )
+ )
+ (i32.eqz
+ (i32.const -2147483648)
+ )
+ )
+ )
+ (block $label$20 (result i32)
+ (nop)
+ (i32.const 8388608)
+ )
+ )
+ (i32.const 31)
+ )
+ )
+ (block $label$21 (result i64)
+ (i64.const -128)
+ )
+ (select
+ (i64.const 3684262436118999851)
+ (i64.const 3830371123687603251)
+ (loop $label$22 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 1603)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$23 (result i32)
+ (nop)
+ (f32.lt
+ (call $deNan32
+ (f32.add
+ (if (result f32)
+ (i32.eqz
+ (i32.trunc_s/f32
+ (f32.load offset=3 align=2
+ (i32.and
+ (loop $label$24 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 117769221)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 16777216)
)
+ (i32.const 31)
)
)
)
)
- (block $label$7 (result i32)
- (return
- (get_local $3)
+ (block $label$25 (result f32)
+ (loop $label$26 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -32768)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$27 (result f32)
+ (return
+ (i64.const 4096)
+ )
+ )
)
)
- (i32.trunc_u/f32
- (call $func_4
- (loop $label$8 (result f64)
+ (block $label$28 (result f32)
+ (call $func_3
+ (f32.const -16384)
+ (f64.const -nan:0xfffffffffffea)
+ (loop $label$29 (result i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (get_local $3)
+ (i64.const 7451608453167213680)
)
)
(set_global $hangLimit
@@ -618,185 +577,77 @@
)
)
)
- (if (result f64)
- (get_local $2)
- (f64.const 18446744073709551615)
- (get_local $3)
- )
- )
- (br_if $label$0
- (br_if $label$0
- (f64.const 0)
- (i32.const 110)
- )
- (if (result i32)
- (i32.eqz
- (get_local $1)
- )
- (i32.const 255)
- (i32.const -128)
- )
+ (i64.const 795183340788647946)
)
)
)
)
- )
- )
- (i32.const 31)
- )
- )
- (i32.const 4)
- )
- (i32.const 4)
- )
- (i32.const 4)
- )
- )
- )
- (func $func_13 (type $FUNCSIG$i) (result i32)
- (local $0 f32)
- (local $1 i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i32.const -45)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$0 (result i32)
- (return
- (get_local $1)
- )
- )
- )
- (func $func_14 (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 255)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (i64.rotr
- (if (result i64)
- (f64.le
- (f64.const 9223372036854775808)
- (f64.const -nan:0xfffffffffffca)
- )
- (block $label$0 (result i64)
- (i64.const -75)
- )
- (block $label$1 (result i64)
- (nop)
- (nop)
- (select
- (block $label$8 (result i64)
- (i64.load16_s offset=4
- (i32.and
- (i32.load8_u offset=2
- (i32.and
- (loop $label$9 (result i32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const -1)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (call $func_2
+ (if (result f64)
+ (i32.eqz
+ (i32.trunc_s/f32
+ (call $deNan32
+ (f32.reinterpret/i32
+ (br_if $label$23
+ (loop $label$30 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 0)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (i32.const 10558)
+ )
+ (i32.eqz
+ (select
+ (i32.const -83)
+ (i32.const 2)
+ (i32.const 2147483647)
+ )
+ )
+ )
+ )
)
)
)
- (block $label$10 (result i32)
- (i32.const 0)
+ (get_local $1)
+ (block $label$31 (result f64)
+ (return
+ (i64.const 87)
+ )
)
)
- (i32.const 31)
)
)
- (i32.const 31)
- )
- )
- )
- (if (result i64)
- (i32.eqz
- (i32.const 0)
- )
- (block $label$12 (result i64)
- (return
- (i64.const 796316177068464396)
)
- )
- (block $label$13 (result i64)
- (i64.const -106)
+ (f32.const 24415)
)
)
- (i32.const 1259697983)
)
)
)
- (select
- (call $func_2)
- (i64.extend_u/i32
- (i32.const 256)
- )
- (i32.const 169)
- )
- )
- )
- (func $func_15 (type $FUNCSIG$j) (result i64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (i64.const 255)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
)
- (i64.const 2821)
)
- (func $func_16 (result i32)
- (local $0 i32)
- (local $1 i64)
- (local $2 f64)
+ (func $func_8 (type $FUNCSIG$i) (result i32)
+ (local $0 f64)
+ (local $1 i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (get_local $0)
+ (get_local $1)
)
)
(set_global $hangLimit
@@ -808,41 +659,19 @@
)
(block $label$0 (result i32)
(return
- (i32.const -1)
- )
- )
- )
- (func $func_17 (type $FUNCSIG$df) (param $0 f32) (result f64)
- (local $1 f64)
- (local $2 f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f64.const 1.1754943508222875e-38)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
+ (i32.const 745163300)
)
)
- (call $func_7)
)
- (func $func_18 (type $FUNCSIG$j) (result i64)
- (local $0 f32)
- (local $1 i32)
+ (func $func_9 (type $FUNCSIG$j) (result i64)
+ (local $0 f64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -82)
+ (i64.const -16384)
)
)
(set_global $hangLimit
@@ -853,40 +682,23 @@
)
)
(block $label$0 (result i64)
- (return
- (i64.const -70)
- )
- )
- )
- (func $func_19 (type $FUNCSIG$v)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return)
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
+ (i64.popcnt
+ (block $label$1 (result i64)
+ (return
+ (i64.const 1)
+ )
)
)
)
- (nop)
)
- (func $func_20 (result i64)
- (local $0 i32)
- (local $1 f64)
- (local $2 f32)
- (local $3 f64)
+ (func $func_10 (result i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (i64.const -9223372036854775808)
+ (i64.const 33)
)
)
(set_global $hangLimit
@@ -898,19 +710,19 @@
)
(block $label$0 (result i64)
(return
- (i64.const 168)
+ (i64.const -20)
)
)
)
- (func $func_21 (type $FUNCSIG$djf) (param $0 i64) (param $1 f32) (result f64)
- (local $2 i64)
+ (func $func_11 (param $0 f64) (param $1 i64) (param $2 i64) (result i64)
+ (local $3 i64)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f64.const -nan:0xfffffffffffdc)
+ (get_local $2)
)
)
(set_global $hangLimit
@@ -920,166 +732,24 @@
)
)
)
- (call $deNan64
- (select
- (if (result f64)
- (i32.eqz
- (select
- (i32.reinterpret/f32
- (call $func_4
- (if (result f64)
- (i32.const 241)
- (call_indirect $FUNCSIG$dd
- (call $deNan64
- (f64.neg
- (f64.const 0)
- )
- )
- (i32.const 4)
- )
- (loop $label$5 (result f64)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f64.const 21)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$6 (result f64)
- (return
- (f64.const -1)
- )
- )
- )
- )
- (call $deNan64
- (select
- (f64.const 1.1754943508222875e-38)
- (f64.const 0)
- (select
- (i32.const 117834755)
- (block $label$7 (result i32)
- (return
- (f64.const -37)
- )
- )
- (call_indirect $FUNCSIG$i
- (i32.const 0)
- )
- )
- )
- )
- )
- )
- (block $label$8 (result i32)
- (return
- (f64.const -9223372036854775808)
- )
- )
- (i32.const 101346317)
- )
- )
- (call_indirect $FUNCSIG$df
- (f32.const 1.3078619610967781e-22)
- (i32.const 9)
- )
- (block $label$9 (result f64)
- (return
- (f64.const -82)
- )
- )
- )
- (f64.const -112)
- (if (result i32)
- (if (result i32)
- (i32.const 22)
- (block $label$0 (result i32)
- (return
- (f64.const 9223372036854775808)
- )
- )
- (block $label$1 (result i32)
- (i32.store offset=3
- (i32.and
- (call $func_13)
- (i32.const 31)
- )
- (call $func_1
- (tee_local $1
- (tee_local $1
- (get_local $1)
- )
- )
- (block $label$2 (result f64)
- (call_indirect $FUNCSIG$v
- (i32.const 6)
- )
- (return
- (f64.const -nan:0xfffffffffffe8)
- )
- )
- )
- )
- (call_indirect $FUNCSIG$v
- (i32.const 6)
- )
- (return
- (f64.const -94)
+ (block $label$0 (result i64)
+ (i64.load32_u offset=22 align=2
+ (i32.and
+ (select
+ (i32.const -1)
+ (i32.le_s
+ (call_indirect $FUNCSIG$i
+ (i32.const 1)
)
- )
- )
- (block $label$3 (result i32)
- (return
- (f64.const -nan:0xfffffffffffa0)
- )
- )
- (block $label$4 (result i32)
- (i32.const -20)
- )
- )
- )
- )
- )
- (func $func_22 (result f32)
- (block
- (if
- (i32.eqz
- (get_global $hangLimit)
- )
- (return
- (f32.const 0)
- )
- )
- (set_global $hangLimit
- (i32.sub
- (get_global $hangLimit)
- (i32.const 1)
- )
- )
- )
- (block $label$0 (result f32)
- (call_indirect $FUNCSIG$v
- (if (result i32)
- (i32.eqz
- (if (result i32)
- (i32.eqz
- (loop $label$1 (result i32)
+ (block $label$11 (result i32)
+ (loop $label$12
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 515)
+ (i64.const -2)
)
)
(set_global $hangLimit
@@ -1089,22 +759,34 @@
)
)
)
- (block $label$2 (result i32)
- (return
- (f32.const 2315)
+ (loop $label$13
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $1)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
)
+ (nop)
)
)
- )
- (block $label$3 (result i32)
- (loop $label$4 (result i32)
+ (loop $label$14
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const 18446744073709551615)
+ (i64.const 14657)
)
)
(set_global $hangLimit
@@ -1114,16 +796,26 @@
)
)
)
- (block $label$5 (result i32)
- (drop
- (loop $label$6 (result i64)
+ (nop)
+ )
+ (if (result i32)
+ (if (result i32)
+ (i32.eqz
+ (block $label$15 (result i32)
+ (return
+ (i64.const 520)
+ )
+ )
+ )
+ (i32.ctz
+ (loop $label$16 (result i32)
(block
(if
(i32.eqz
(get_global $hangLimit)
)
(return
- (f32.const -1)
+ (get_local $1)
)
)
(set_global $hangLimit
@@ -1133,39 +825,210 @@
)
)
)
- (block $label$7 (result i64)
- (return
- (f32.const 1)
+ (loop $label$17 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -4294967296)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call_indirect $FUNCSIG$i
+ (i32.trunc_u/f32
+ (block $label$18 (result f32)
+ (return
+ (i64.const -2147483648)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (i32.const -2147483648)
+ )
+ (block $label$19 (result i32)
+ (drop
+ (loop $label$20 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (get_local $3)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
)
)
+ (i32.const 190322462)
)
)
- (i32.load8_s offset=22
+ (i32.load8_u offset=22
(i32.and
- (i32.const 65505)
+ (f32.eq
+ (call $deNan32
+ (f32.sub
+ (loop $label$21 (result f32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const -8)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (block $label$22 (result f32)
+ (return
+ (get_local $3)
+ )
+ )
+ )
+ (f32.load offset=22 align=2
+ (i32.and
+ (br_if $label$19
+ (call_indirect $FUNCSIG$i
+ (i32.const 0)
+ )
+ (loop $label$23 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (i64.const 2147483646)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (if (result i32)
+ (i32.eqz
+ (i32.const 65535)
+ )
+ (i32.const -2147483648)
+ (i32.const 14)
+ )
+ )
+ )
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (block $label$24 (result f32)
+ (return
+ (i64.const -32768)
+ )
+ )
+ )
(i32.const 31)
)
)
)
+ (block $label$25 (result i32)
+ (return
+ (get_local $3)
+ )
+ )
)
)
- (block $label$8 (result i32)
- (return
- (f32.const 252)
- )
+ )
+ (i32.const -32768)
+ )
+ (i32.const 31)
+ )
+ )
+ )
+ )
+ (func $func_12 (result f64)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const 112)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
+ )
+ (call $deNan64
+ (select
+ (call $deNan64
+ (f64.promote/f32
+ (if (result f32)
+ (i32.eqz
+ (i32.const -74)
+ )
+ (block $label$2 (result f32)
+ (nop)
+ (nop)
+ (f32.const 103176e4)
+ )
+ (block $label$3 (result f32)
+ (f32.const 4)
)
)
)
- (block $label$9 (result i32)
- (nop)
- (i32.const 65535)
+ )
+ (f64.const 2199023255552)
+ (loop $label$0 (result i32)
+ (block
+ (if
+ (i32.eqz
+ (get_global $hangLimit)
+ )
+ (return
+ (f64.const -562949953421312)
+ )
+ )
+ (set_global $hangLimit
+ (i32.sub
+ (get_global $hangLimit)
+ (i32.const 1)
+ )
+ )
)
- (block $label$19 (result i32)
- (i32.const -115)
+ (block $label$1 (result i32)
+ (return
+ (f64.const 3402823466385288598117041e14)
+ )
)
)
)
- (f32.const -nan:0x7fff82)
)
)
(func $hangLimitInitializer