diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 8 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 554 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 8 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 490 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt.txt | 40 | ||||
-rw-r--r-- | test/kitchen_sink.wast | 40 | ||||
-rw-r--r-- | test/kitchen_sink.wast.from-wast | 40 | ||||
-rw-r--r-- | test/kitchen_sink.wast.fromBinary | 40 | ||||
-rw-r--r-- | test/kitchen_sink.wast.fromBinary.noDebugInfo | 40 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz.txt | 1553 | ||||
-rw-r--r-- | test/spec/conversions.wast | 172 |
11 files changed, 1513 insertions, 1472 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index 4b78894d8..9fdaa0ad2 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -134,6 +134,14 @@ function test_core() { module.i64.trunc_s.f64(module.f64.const(-9005.841)), module.i32.trunc_u.f64(module.f64.const(-9005.841)), module.i64.trunc_u.f64(module.f64.const(-9005.841)), + module.i32.trunc_s_sat.f32(module.f32.const(-33.612)), + module.i64.trunc_s_sat.f32(module.f32.const(-33.612)), + module.i32.trunc_u_sat.f32(module.f32.const(-33.612)), + module.i64.trunc_u_sat.f32(module.f32.const(-33.612)), + module.i32.trunc_s_sat.f64(module.f64.const(-9005.841)), + module.i64.trunc_s_sat.f64(module.f64.const(-9005.841)), + module.i32.trunc_u_sat.f64(module.f64.const(-9005.841)), + module.i64.trunc_u_sat.f64(module.f64.const(-9005.841)), module.i32.reinterpret(module.f32.const(-33.612)), module.i64.reinterpret(module.f64.const(-9005.841)), module.f32.convert_s.i32(module.i32.const(-10)), diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index dc0961a8f..4a320bccc 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -172,6 +172,46 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop (i32.reinterpret/f32 (f32.const -33.61199951171875) ) @@ -1168,203 +1208,219 @@ int main() { expressions[65] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); expressions[66] = BinaryenUnary(the_module, 32, expressions[65]); expressions[67] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[68] = BinaryenUnary(the_module, 33, expressions[67]); - expressions[69] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[70] = BinaryenUnary(the_module, 34, expressions[69]); - expressions[71] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[72] = BinaryenUnary(the_module, 35, expressions[71]); - expressions[73] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[74] = BinaryenUnary(the_module, 36, expressions[73]); - expressions[75] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[76] = BinaryenUnary(the_module, 37, expressions[75]); - expressions[77] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[78] = BinaryenUnary(the_module, 38, expressions[77]); - expressions[79] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[80] = BinaryenUnary(the_module, 39, expressions[79]); - expressions[81] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[82] = BinaryenUnary(the_module, 40, expressions[81]); - expressions[83] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[84] = BinaryenUnary(the_module, 41, expressions[83]); - expressions[85] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[86] = BinaryenUnary(the_module, 42, expressions[85]); - expressions[87] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[88] = BinaryenUnary(the_module, 43, expressions[87]); - expressions[89] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[90] = BinaryenUnary(the_module, 44, expressions[89]); + expressions[68] = BinaryenUnary(the_module, 52, expressions[67]); + expressions[69] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[70] = BinaryenUnary(the_module, 56, expressions[69]); + expressions[71] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[72] = BinaryenUnary(the_module, 53, expressions[71]); + expressions[73] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[74] = BinaryenUnary(the_module, 57, expressions[73]); + expressions[75] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[76] = BinaryenUnary(the_module, 54, expressions[75]); + expressions[77] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[78] = BinaryenUnary(the_module, 58, expressions[77]); + expressions[79] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[80] = BinaryenUnary(the_module, 55, expressions[79]); + expressions[81] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[82] = BinaryenUnary(the_module, 59, expressions[81]); + expressions[83] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[84] = BinaryenUnary(the_module, 33, expressions[83]); + expressions[85] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[86] = BinaryenUnary(the_module, 34, expressions[85]); + expressions[87] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[88] = BinaryenUnary(the_module, 35, expressions[87]); + expressions[89] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[90] = BinaryenUnary(the_module, 36, expressions[89]); expressions[91] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[92] = BinaryenUnary(the_module, 45, expressions[91]); - expressions[93] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[94] = BinaryenUnary(the_module, 46, expressions[93]); - expressions[95] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[96] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[97] = BinaryenBinary(the_module, 0, expressions[95], expressions[96]); - expressions[98] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[99] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[100] = BinaryenBinary(the_module, 64, expressions[98], expressions[99]); - expressions[101] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[102] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[103] = BinaryenBinary(the_module, 3, expressions[101], expressions[102]); - expressions[104] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[105] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[106] = BinaryenBinary(the_module, 29, expressions[104], expressions[105]); - expressions[107] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[108] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[109] = BinaryenBinary(the_module, 30, expressions[107], expressions[108]); - expressions[110] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[111] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[112] = BinaryenBinary(the_module, 6, expressions[110], expressions[111]); - expressions[113] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[114] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[115] = BinaryenBinary(the_module, 7, expressions[113], expressions[114]); - expressions[116] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[118] = BinaryenBinary(the_module, 33, expressions[116], expressions[117]); - expressions[119] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[120] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[121] = BinaryenBinary(the_module, 9, expressions[119], expressions[120]); - expressions[122] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[123] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[124] = BinaryenBinary(the_module, 35, expressions[122], expressions[123]); - expressions[125] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[126] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[127] = BinaryenBinary(the_module, 36, expressions[125], expressions[126]); - expressions[128] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[129] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[130] = BinaryenBinary(the_module, 12, expressions[128], expressions[129]); - expressions[131] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[133] = BinaryenBinary(the_module, 13, expressions[131], expressions[132]); - expressions[134] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[135] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[136] = BinaryenBinary(the_module, 39, expressions[134], expressions[135]); - expressions[137] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[138] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[139] = BinaryenBinary(the_module, 53, expressions[137], expressions[138]); - expressions[140] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[141] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[142] = BinaryenBinary(the_module, 67, expressions[140], expressions[141]); - expressions[143] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[144] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[145] = BinaryenBinary(the_module, 55, expressions[143], expressions[144]); - expressions[146] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[147] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[148] = BinaryenBinary(the_module, 69, expressions[146], expressions[147]); - expressions[149] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[150] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[151] = BinaryenBinary(the_module, 15, expressions[149], expressions[150]); - expressions[152] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[153] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[154] = BinaryenBinary(the_module, 58, expressions[152], expressions[153]); - expressions[155] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[156] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[157] = BinaryenBinary(the_module, 17, expressions[155], expressions[156]); - expressions[158] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[159] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[160] = BinaryenBinary(the_module, 43, expressions[158], expressions[159]); - expressions[161] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[162] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[163] = BinaryenBinary(the_module, 44, expressions[161], expressions[162]); - expressions[164] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[165] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[166] = BinaryenBinary(the_module, 20, expressions[164], expressions[165]); - expressions[167] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[168] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[169] = BinaryenBinary(the_module, 46, expressions[167], expressions[168]); - expressions[170] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[171] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[172] = BinaryenBinary(the_module, 22, expressions[170], expressions[171]); - expressions[173] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[174] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[175] = BinaryenBinary(the_module, 23, expressions[173], expressions[174]); - expressions[176] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); - expressions[177] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); - expressions[178] = BinaryenBinary(the_module, 49, expressions[176], expressions[177]); - expressions[179] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[180] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[181] = BinaryenBinary(the_module, 59, expressions[179], expressions[180]); - expressions[182] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[183] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[184] = BinaryenBinary(the_module, 73, expressions[182], expressions[183]); - expressions[185] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[186] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[187] = BinaryenBinary(the_module, 74, expressions[185], expressions[186]); - expressions[188] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[189] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[190] = BinaryenBinary(the_module, 62, expressions[188], expressions[189]); + expressions[92] = BinaryenUnary(the_module, 37, expressions[91]); + expressions[93] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[94] = BinaryenUnary(the_module, 38, expressions[93]); + expressions[95] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[96] = BinaryenUnary(the_module, 39, expressions[95]); + expressions[97] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[98] = BinaryenUnary(the_module, 40, expressions[97]); + expressions[99] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[100] = BinaryenUnary(the_module, 41, expressions[99]); + expressions[101] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[102] = BinaryenUnary(the_module, 42, expressions[101]); + expressions[103] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[104] = BinaryenUnary(the_module, 43, expressions[103]); + expressions[105] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[106] = BinaryenUnary(the_module, 44, expressions[105]); + expressions[107] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[108] = BinaryenUnary(the_module, 45, expressions[107]); + expressions[109] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[110] = BinaryenUnary(the_module, 46, expressions[109]); + expressions[111] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[112] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[113] = BinaryenBinary(the_module, 0, expressions[111], expressions[112]); + expressions[114] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[115] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[116] = BinaryenBinary(the_module, 64, expressions[114], expressions[115]); + expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[118] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[119] = BinaryenBinary(the_module, 3, expressions[117], expressions[118]); + expressions[120] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[121] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[122] = BinaryenBinary(the_module, 29, expressions[120], expressions[121]); + expressions[123] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[124] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[125] = BinaryenBinary(the_module, 30, expressions[123], expressions[124]); + expressions[126] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[127] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[128] = BinaryenBinary(the_module, 6, expressions[126], expressions[127]); + expressions[129] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[131] = BinaryenBinary(the_module, 7, expressions[129], expressions[130]); + expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[133] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[134] = BinaryenBinary(the_module, 33, expressions[132], expressions[133]); + expressions[135] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[137] = BinaryenBinary(the_module, 9, expressions[135], expressions[136]); + expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[139] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[140] = BinaryenBinary(the_module, 35, expressions[138], expressions[139]); + expressions[141] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[142] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[143] = BinaryenBinary(the_module, 36, expressions[141], expressions[142]); + expressions[144] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[145] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[146] = BinaryenBinary(the_module, 12, expressions[144], expressions[145]); + expressions[147] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[148] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[149] = BinaryenBinary(the_module, 13, expressions[147], expressions[148]); + expressions[150] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[151] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[152] = BinaryenBinary(the_module, 39, expressions[150], expressions[151]); + expressions[153] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[154] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[155] = BinaryenBinary(the_module, 53, expressions[153], expressions[154]); + expressions[156] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[157] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[158] = BinaryenBinary(the_module, 67, expressions[156], expressions[157]); + expressions[159] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[160] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[161] = BinaryenBinary(the_module, 55, expressions[159], expressions[160]); + expressions[162] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[163] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[164] = BinaryenBinary(the_module, 69, expressions[162], expressions[163]); + expressions[165] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[166] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[167] = BinaryenBinary(the_module, 15, expressions[165], expressions[166]); + expressions[168] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[169] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[170] = BinaryenBinary(the_module, 58, expressions[168], expressions[169]); + expressions[171] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[172] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[173] = BinaryenBinary(the_module, 17, expressions[171], expressions[172]); + expressions[174] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[175] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[176] = BinaryenBinary(the_module, 43, expressions[174], expressions[175]); + expressions[177] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[178] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[179] = BinaryenBinary(the_module, 44, expressions[177], expressions[178]); + expressions[180] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[181] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[182] = BinaryenBinary(the_module, 20, expressions[180], expressions[181]); + expressions[183] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[184] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[185] = BinaryenBinary(the_module, 46, expressions[183], expressions[184]); + expressions[186] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[187] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[188] = BinaryenBinary(the_module, 22, expressions[186], expressions[187]); + expressions[189] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[190] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[191] = BinaryenBinary(the_module, 23, expressions[189], expressions[190]); + expressions[192] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967274)); + expressions[193] = BinaryenConst(the_module, BinaryenLiteralInt64(4294967273)); + expressions[194] = BinaryenBinary(the_module, 49, expressions[192], expressions[193]); + expressions[195] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[196] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[197] = BinaryenBinary(the_module, 59, expressions[195], expressions[196]); + expressions[198] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[199] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[200] = BinaryenBinary(the_module, 73, expressions[198], expressions[199]); + expressions[201] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[202] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[203] = BinaryenBinary(the_module, 74, expressions[201], expressions[202]); + expressions[204] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[205] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[206] = BinaryenBinary(the_module, 62, expressions[204], expressions[205]); { BinaryenExpressionRef children[] = { 0 }; - expressions[191] = BinaryenBlock(the_module, NULL, children, 0, 0); - } - expressions[192] = BinaryenIf(the_module, expressions[7], expressions[8], expressions[9]); - expressions[193] = BinaryenIf(the_module, expressions[10], expressions[11], expressions[0]); - expressions[194] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[195] = BinaryenLoop(the_module, "in", expressions[194]); - expressions[196] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[197] = BinaryenLoop(the_module, NULL, expressions[196]); - expressions[198] = BinaryenBreak(the_module, "the-value", expressions[12], expressions[13]); - expressions[199] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); - expressions[200] = BinaryenBreak(the_module, "the-nothing", expressions[199], expressions[0]); - expressions[201] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); - expressions[202] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[201]); - expressions[203] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); + expressions[207] = BinaryenBlock(the_module, NULL, children, 0, 0); + } + expressions[208] = BinaryenIf(the_module, expressions[7], expressions[8], expressions[9]); + expressions[209] = BinaryenIf(the_module, expressions[10], expressions[11], expressions[0]); + expressions[210] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[211] = BinaryenLoop(the_module, "in", expressions[210]); + expressions[212] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[213] = BinaryenLoop(the_module, NULL, expressions[212]); + expressions[214] = BinaryenBreak(the_module, "the-value", expressions[12], expressions[13]); + expressions[215] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[216] = BinaryenBreak(the_module, "the-nothing", expressions[215], expressions[0]); + expressions[217] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); + expressions[218] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[217]); + expressions[219] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); { const char* names[] = { "the-value" }; - expressions[204] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[14], expressions[15]); + expressions[220] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[14], expressions[15]); } - expressions[205] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[221] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { const char* names[] = { "the-nothing" }; - expressions[206] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[205], expressions[0]); - } - expressions[207] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); - expressions[208] = BinaryenConst(the_module, BinaryenLiteralInt64(37)); - expressions[209] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3)); - expressions[210] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); - { - BinaryenExpressionRef operands[] = { expressions[207], expressions[208], expressions[209], expressions[210] }; - expressions[211] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1); - } - expressions[212] = BinaryenUnary(the_module, 20, expressions[211]); - expressions[213] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); - expressions[214] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); - { - BinaryenExpressionRef operands[] = { expressions[213], expressions[214] }; - expressions[215] = BinaryenCall(the_module, "an-imported", operands, 2, 3); - } - expressions[216] = BinaryenUnary(the_module, 25, expressions[215]); - expressions[217] = BinaryenUnary(the_module, 20, expressions[216]); - expressions[218] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); - expressions[219] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); - expressions[220] = BinaryenConst(the_module, BinaryenLiteralInt64(37)); - expressions[221] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3)); - expressions[222] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); - { - BinaryenExpressionRef operands[] = { expressions[219], expressions[220], expressions[221], expressions[222] }; - expressions[223] = BinaryenCallIndirect(the_module, expressions[218], operands, 4, "iiIfF"); - } - expressions[224] = BinaryenUnary(the_module, 20, expressions[223]); - expressions[225] = BinaryenGetLocal(the_module, 0, 1); - expressions[226] = BinaryenDrop(the_module, expressions[225]); - expressions[227] = BinaryenConst(the_module, BinaryenLiteralInt32(101)); - expressions[228] = BinaryenSetLocal(the_module, 0, expressions[227]); - expressions[229] = BinaryenConst(the_module, BinaryenLiteralInt32(102)); - expressions[230] = BinaryenTeeLocal(the_module, 0, expressions[229]); - expressions[231] = BinaryenDrop(the_module, expressions[230]); - expressions[232] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[233] = BinaryenLoad(the_module, 4, 1, 0, 0, 1, expressions[232]); - expressions[234] = BinaryenConst(the_module, BinaryenLiteralInt32(8)); - expressions[235] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[234]); - expressions[236] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); - expressions[237] = BinaryenLoad(the_module, 4, 1, 0, 0, 3, expressions[236]); - expressions[238] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); - expressions[239] = BinaryenLoad(the_module, 8, 1, 2, 8, 4, expressions[238]); - expressions[240] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 1); - expressions[241] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 2); - expressions[242] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]); - expressions[243] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); - expressions[244] = BinaryenReturn(the_module, expressions[243]); - expressions[245] = BinaryenNop(the_module); - expressions[246] = BinaryenUnreachable(the_module); + expressions[222] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[221], expressions[0]); + } + expressions[223] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); + expressions[224] = BinaryenConst(the_module, BinaryenLiteralInt64(37)); + expressions[225] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3)); + expressions[226] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); + { + BinaryenExpressionRef operands[] = { expressions[223], expressions[224], expressions[225], expressions[226] }; + expressions[227] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1); + } + expressions[228] = BinaryenUnary(the_module, 20, expressions[227]); + expressions[229] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); + expressions[230] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); + { + BinaryenExpressionRef operands[] = { expressions[229], expressions[230] }; + expressions[231] = BinaryenCall(the_module, "an-imported", operands, 2, 3); + } + expressions[232] = BinaryenUnary(the_module, 25, expressions[231]); + expressions[233] = BinaryenUnary(the_module, 20, expressions[232]); + expressions[234] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); + expressions[235] = BinaryenConst(the_module, BinaryenLiteralInt32(13)); + expressions[236] = BinaryenConst(the_module, BinaryenLiteralInt64(37)); + expressions[237] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3)); + expressions[238] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7)); + { + BinaryenExpressionRef operands[] = { expressions[235], expressions[236], expressions[237], expressions[238] }; + expressions[239] = BinaryenCallIndirect(the_module, expressions[234], operands, 4, "iiIfF"); + } + expressions[240] = BinaryenUnary(the_module, 20, expressions[239]); + expressions[241] = BinaryenGetLocal(the_module, 0, 1); + expressions[242] = BinaryenDrop(the_module, expressions[241]); + expressions[243] = BinaryenConst(the_module, BinaryenLiteralInt32(101)); + expressions[244] = BinaryenSetLocal(the_module, 0, expressions[243]); + expressions[245] = BinaryenConst(the_module, BinaryenLiteralInt32(102)); + expressions[246] = BinaryenTeeLocal(the_module, 0, expressions[245]); + expressions[247] = BinaryenDrop(the_module, expressions[246]); + expressions[248] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[249] = BinaryenLoad(the_module, 4, 1, 0, 0, 1, expressions[248]); + expressions[250] = BinaryenConst(the_module, BinaryenLiteralInt32(8)); + expressions[251] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[250]); + expressions[252] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[253] = BinaryenLoad(the_module, 4, 1, 0, 0, 3, expressions[252]); + expressions[254] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); + expressions[255] = BinaryenLoad(the_module, 8, 1, 2, 8, 4, expressions[254]); + expressions[256] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 1); + expressions[257] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 2); + expressions[258] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]); + expressions[259] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); + expressions[260] = BinaryenReturn(the_module, expressions[259]); + expressions[261] = BinaryenNop(the_module); + expressions[262] = BinaryenUnreachable(the_module); BinaryenExpressionGetId(expressions[30]); BinaryenExpressionGetType(expressions[30]); BinaryenUnaryGetOp(expressions[30]); @@ -1375,26 +1431,26 @@ getExpressionInfo={"id":15,"type":3,"op":6} (f32.const -33.61199951171875) ) - expressions[247] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); - BinaryenExpressionGetId(expressions[247]); - BinaryenExpressionGetType(expressions[247]); - BinaryenConstGetValueI32(expressions[247]); + expressions[263] = BinaryenConst(the_module, BinaryenLiteralInt32(5)); + BinaryenExpressionGetId(expressions[263]); + BinaryenExpressionGetType(expressions[263]); + BinaryenConstGetValueI32(expressions[263]); getExpressionInfo(i32.const)={"id":14,"type":1,"value":5} - expressions[248] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078)); - BinaryenExpressionGetId(expressions[248]); - BinaryenExpressionGetType(expressions[248]); - BinaryenConstGetValueI64Low(expressions[248]); - BinaryenConstGetValueI64High(expressions[248]); + expressions[264] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078)); + BinaryenExpressionGetId(expressions[264]); + BinaryenExpressionGetType(expressions[264]); + BinaryenConstGetValueI64Low(expressions[264]); + BinaryenConstGetValueI64High(expressions[264]); getExpressionInfo(i64.const)={"id":14,"type":2,"value":{"low":6,"high":7}} - expressions[249] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5)); - BinaryenExpressionGetId(expressions[249]); - BinaryenExpressionGetType(expressions[249]); - BinaryenConstGetValueF32(expressions[249]); + expressions[265] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5)); + BinaryenExpressionGetId(expressions[265]); + BinaryenExpressionGetType(expressions[265]); + BinaryenConstGetValueF32(expressions[265]); getExpressionInfo(f32.const)={"id":14,"type":3,"value":8.5} - expressions[250] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5)); - BinaryenExpressionGetId(expressions[250]); - BinaryenExpressionGetType(expressions[250]); - BinaryenConstGetValueF64(expressions[250]); + expressions[266] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5)); + BinaryenExpressionGetId(expressions[266]); + BinaryenExpressionGetType(expressions[266]); + BinaryenConstGetValueF64(expressions[266]); getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} { BinaryenExpressionRef children[] = { expressions[24], expressions[26], expressions[28], expressions[30], expressions[32], @@ -1403,31 +1459,33 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} expressions[58], expressions[60], expressions[62], expressions[64], expressions[66], expressions[68], expressions[70], expressions[72], expressions[74], expressions[76], expressions[78], expressions[80], expressions[82], expressions[84], expressions[86], expressions[88], expressions[90], expressions[92], - expressions[94], expressions[97], expressions[100], expressions[103], expressions[106], expressions[109], - expressions[112], expressions[115], expressions[118], expressions[121], expressions[124], expressions[127], - expressions[130], expressions[133], expressions[136], expressions[139], expressions[142], expressions[145], - expressions[148], expressions[151], expressions[154], expressions[157], expressions[160], expressions[163], - expressions[166], expressions[169], expressions[172], expressions[175], expressions[178], expressions[181], - expressions[184], expressions[187], expressions[190], expressions[191], expressions[192], expressions[193], - expressions[195], expressions[197], expressions[198], expressions[200], expressions[202], expressions[203], - expressions[204], expressions[206], expressions[212], expressions[217], expressions[224], expressions[226], - expressions[228], expressions[231], expressions[233], expressions[235], expressions[237], expressions[239], - expressions[240], expressions[241], expressions[242], expressions[244], expressions[245], expressions[246] }; - expressions[251] = BinaryenBlock(the_module, "the-value", children, 95, 0); + expressions[94], expressions[96], expressions[98], expressions[100], expressions[102], expressions[104], + expressions[106], expressions[108], expressions[110], expressions[113], expressions[116], expressions[119], + expressions[122], expressions[125], expressions[128], expressions[131], expressions[134], expressions[137], + expressions[140], expressions[143], expressions[146], expressions[149], expressions[152], expressions[155], + expressions[158], expressions[161], expressions[164], expressions[167], expressions[170], expressions[173], + expressions[176], expressions[179], expressions[182], expressions[185], expressions[188], expressions[191], + expressions[194], expressions[197], expressions[200], expressions[203], expressions[206], expressions[207], + expressions[208], expressions[209], expressions[211], expressions[213], expressions[214], expressions[216], + expressions[218], expressions[219], expressions[220], expressions[222], expressions[228], expressions[233], + expressions[240], expressions[242], expressions[244], expressions[247], expressions[249], expressions[251], + expressions[253], expressions[255], expressions[256], expressions[257], expressions[258], expressions[260], + expressions[261], expressions[262] }; + expressions[267] = BinaryenBlock(the_module, "the-value", children, 103, 0); } - expressions[252] = BinaryenDrop(the_module, expressions[251]); + expressions[268] = BinaryenDrop(the_module, expressions[267]); { - BinaryenExpressionRef children[] = { expressions[252] }; - expressions[253] = BinaryenBlock(the_module, "the-nothing", children, 1, 0); + BinaryenExpressionRef children[] = { expressions[268] }; + expressions[269] = BinaryenBlock(the_module, "the-nothing", children, 1, 0); } - expressions[254] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[270] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { - BinaryenExpressionRef children[] = { expressions[253], expressions[254] }; - expressions[255] = BinaryenBlock(the_module, "the-body", children, 2, 0); + BinaryenExpressionRef children[] = { expressions[269], expressions[270] }; + expressions[271] = BinaryenBlock(the_module, "the-body", children, 2, 0); } { BinaryenType varTypes[] = { 1 }; - functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 1, expressions[255]); + functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 1, expressions[271]); } { BinaryenType paramTypes[] = { 1, 4 }; @@ -1452,11 +1510,11 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} const char* funcNames[] = { "kitchen()sinker" }; BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1); } - expressions[256] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); + expressions[272] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); { const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 }; const char* segments[] = { segment0 }; - BinaryenExpressionRef segmentOffsets[] = { expressions[256] }; + BinaryenExpressionRef segmentOffsets[] = { expressions[272] }; BinaryenIndex segmentSizes[] = { 12 }; BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1, 0); } @@ -1464,10 +1522,10 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} BinaryenType paramTypes[] = { 0 }; functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); } - expressions[257] = BinaryenNop(the_module); + expressions[273] = BinaryenNop(the_module); { BinaryenType varTypes[] = { 0 }; - functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[257]); + functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[273]); } BinaryenSetStart(the_module, functions[1]); { @@ -1607,6 +1665,46 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5} ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop (i32.reinterpret/f32 (f32.const -33.61199951171875) ) diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c index 9271e3371..d056d0e75 100644 --- a/test/example/c-api-kitchen-sink.c +++ b/test/example/c-api-kitchen-sink.c @@ -138,6 +138,14 @@ void test_core() { makeUnary(module, BinaryenTruncSFloat64ToInt64(), 4), makeUnary(module, BinaryenTruncUFloat64ToInt32(), 4), makeUnary(module, BinaryenTruncUFloat64ToInt64(), 4), + makeUnary(module, BinaryenTruncSatSFloat32ToInt32(), 3), + makeUnary(module, BinaryenTruncSatSFloat32ToInt64(), 3), + makeUnary(module, BinaryenTruncSatUFloat32ToInt32(), 3), + makeUnary(module, BinaryenTruncSatUFloat32ToInt64(), 3), + makeUnary(module, BinaryenTruncSatSFloat64ToInt32(), 4), + makeUnary(module, BinaryenTruncSatSFloat64ToInt64(), 4), + makeUnary(module, BinaryenTruncSatUFloat64ToInt32(), 4), + makeUnary(module, BinaryenTruncSatUFloat64ToInt64(), 4), makeUnary(module, BinaryenReinterpretFloat32(), 3), makeUnary(module, BinaryenReinterpretFloat64(), 4), makeUnary(module, BinaryenConvertSInt32ToFloat32(), 1), diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt index faf3c336b..786cf5243 100644 --- a/test/example/c-api-kitchen-sink.txt +++ b/test/example/c-api-kitchen-sink.txt @@ -141,6 +141,46 @@ BinaryenTypeAuto: -1 ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop (i32.reinterpret/f32 (f32.const -33.61199951171875) ) @@ -1146,193 +1186,209 @@ int main() { expressions[75] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); expressions[76] = BinaryenUnary(the_module, 32, expressions[75]); expressions[77] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[78] = BinaryenUnary(the_module, 33, expressions[77]); - expressions[79] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[80] = BinaryenUnary(the_module, 34, expressions[79]); - expressions[81] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[82] = BinaryenUnary(the_module, 35, expressions[81]); - expressions[83] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[84] = BinaryenUnary(the_module, 36, expressions[83]); - expressions[85] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[86] = BinaryenUnary(the_module, 37, expressions[85]); - expressions[87] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[88] = BinaryenUnary(the_module, 38, expressions[87]); - expressions[89] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[90] = BinaryenUnary(the_module, 39, expressions[89]); - expressions[91] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[92] = BinaryenUnary(the_module, 40, expressions[91]); - expressions[93] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[94] = BinaryenUnary(the_module, 41, expressions[93]); - expressions[95] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[96] = BinaryenUnary(the_module, 42, expressions[95]); - expressions[97] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[98] = BinaryenUnary(the_module, 43, expressions[97]); - expressions[99] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[100] = BinaryenUnary(the_module, 44, expressions[99]); + expressions[78] = BinaryenUnary(the_module, 52, expressions[77]); + expressions[79] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[80] = BinaryenUnary(the_module, 56, expressions[79]); + expressions[81] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[82] = BinaryenUnary(the_module, 53, expressions[81]); + expressions[83] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[84] = BinaryenUnary(the_module, 57, expressions[83]); + expressions[85] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[86] = BinaryenUnary(the_module, 54, expressions[85]); + expressions[87] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[88] = BinaryenUnary(the_module, 58, expressions[87]); + expressions[89] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[90] = BinaryenUnary(the_module, 55, expressions[89]); + expressions[91] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[92] = BinaryenUnary(the_module, 59, expressions[91]); + expressions[93] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[94] = BinaryenUnary(the_module, 33, expressions[93]); + expressions[95] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[96] = BinaryenUnary(the_module, 34, expressions[95]); + expressions[97] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[98] = BinaryenUnary(the_module, 35, expressions[97]); + expressions[99] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[100] = BinaryenUnary(the_module, 36, expressions[99]); expressions[101] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[102] = BinaryenUnary(the_module, 45, expressions[101]); - expressions[103] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[104] = BinaryenUnary(the_module, 46, expressions[103]); - expressions[105] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[106] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[107] = BinaryenBinary(the_module, 0, expressions[106], expressions[105]); - expressions[108] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[109] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[110] = BinaryenBinary(the_module, 64, expressions[109], expressions[108]); - expressions[111] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[112] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[113] = BinaryenBinary(the_module, 3, expressions[112], expressions[111]); - expressions[114] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[115] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[116] = BinaryenBinary(the_module, 29, expressions[115], expressions[114]); - expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[118] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[119] = BinaryenBinary(the_module, 30, expressions[118], expressions[117]); - expressions[120] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[121] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[122] = BinaryenBinary(the_module, 6, expressions[121], expressions[120]); - expressions[123] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[124] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[125] = BinaryenBinary(the_module, 7, expressions[124], expressions[123]); - expressions[126] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[127] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[128] = BinaryenBinary(the_module, 33, expressions[127], expressions[126]); - expressions[129] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[131] = BinaryenBinary(the_module, 9, expressions[130], expressions[129]); - expressions[132] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[133] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[134] = BinaryenBinary(the_module, 35, expressions[133], expressions[132]); - expressions[135] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[137] = BinaryenBinary(the_module, 36, expressions[136], expressions[135]); - expressions[138] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[139] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[140] = BinaryenBinary(the_module, 12, expressions[139], expressions[138]); - expressions[141] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[142] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[143] = BinaryenBinary(the_module, 13, expressions[142], expressions[141]); - expressions[144] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[145] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[146] = BinaryenBinary(the_module, 39, expressions[145], expressions[144]); - expressions[147] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[148] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[149] = BinaryenBinary(the_module, 53, expressions[148], expressions[147]); - expressions[150] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[151] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[152] = BinaryenBinary(the_module, 67, expressions[151], expressions[150]); - expressions[153] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[154] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[155] = BinaryenBinary(the_module, 55, expressions[154], expressions[153]); - expressions[156] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[157] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[158] = BinaryenBinary(the_module, 69, expressions[157], expressions[156]); - expressions[159] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[160] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[161] = BinaryenBinary(the_module, 15, expressions[160], expressions[159]); - expressions[162] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[163] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[164] = BinaryenBinary(the_module, 58, expressions[163], expressions[162]); - expressions[165] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[166] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[167] = BinaryenBinary(the_module, 17, expressions[166], expressions[165]); - expressions[168] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[169] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[170] = BinaryenBinary(the_module, 43, expressions[169], expressions[168]); - expressions[171] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[172] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[173] = BinaryenBinary(the_module, 44, expressions[172], expressions[171]); - expressions[174] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[175] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[176] = BinaryenBinary(the_module, 20, expressions[175], expressions[174]); - expressions[177] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[178] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[179] = BinaryenBinary(the_module, 46, expressions[178], expressions[177]); - expressions[180] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[181] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[182] = BinaryenBinary(the_module, 22, expressions[181], expressions[180]); - expressions[183] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); - expressions[184] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); - expressions[185] = BinaryenBinary(the_module, 23, expressions[184], expressions[183]); - expressions[186] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); - expressions[187] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); - expressions[188] = BinaryenBinary(the_module, 49, expressions[187], expressions[186]); - expressions[189] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[190] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[191] = BinaryenBinary(the_module, 59, expressions[190], expressions[189]); - expressions[192] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[193] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[194] = BinaryenBinary(the_module, 73, expressions[193], expressions[192]); - expressions[195] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); - expressions[196] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); - expressions[197] = BinaryenBinary(the_module, 74, expressions[196], expressions[195]); - expressions[198] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); - expressions[199] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); - expressions[200] = BinaryenBinary(the_module, 62, expressions[199], expressions[198]); + expressions[102] = BinaryenUnary(the_module, 37, expressions[101]); + expressions[103] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[104] = BinaryenUnary(the_module, 38, expressions[103]); + expressions[105] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[106] = BinaryenUnary(the_module, 39, expressions[105]); + expressions[107] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[108] = BinaryenUnary(the_module, 40, expressions[107]); + expressions[109] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[110] = BinaryenUnary(the_module, 41, expressions[109]); + expressions[111] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[112] = BinaryenUnary(the_module, 42, expressions[111]); + expressions[113] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[114] = BinaryenUnary(the_module, 43, expressions[113]); + expressions[115] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[116] = BinaryenUnary(the_module, 44, expressions[115]); + expressions[117] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[118] = BinaryenUnary(the_module, 45, expressions[117]); + expressions[119] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[120] = BinaryenUnary(the_module, 46, expressions[119]); + expressions[121] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[122] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[123] = BinaryenBinary(the_module, 0, expressions[122], expressions[121]); + expressions[124] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[125] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[126] = BinaryenBinary(the_module, 64, expressions[125], expressions[124]); + expressions[127] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[128] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[129] = BinaryenBinary(the_module, 3, expressions[128], expressions[127]); + expressions[130] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[131] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[132] = BinaryenBinary(the_module, 29, expressions[131], expressions[130]); + expressions[133] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[134] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[135] = BinaryenBinary(the_module, 30, expressions[134], expressions[133]); + expressions[136] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[137] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[138] = BinaryenBinary(the_module, 6, expressions[137], expressions[136]); + expressions[139] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[140] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[141] = BinaryenBinary(the_module, 7, expressions[140], expressions[139]); + expressions[142] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[143] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[144] = BinaryenBinary(the_module, 33, expressions[143], expressions[142]); + expressions[145] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[146] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[147] = BinaryenBinary(the_module, 9, expressions[146], expressions[145]); + expressions[148] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[149] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[150] = BinaryenBinary(the_module, 35, expressions[149], expressions[148]); + expressions[151] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[152] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[153] = BinaryenBinary(the_module, 36, expressions[152], expressions[151]); + expressions[154] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[155] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[156] = BinaryenBinary(the_module, 12, expressions[155], expressions[154]); + expressions[157] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[158] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[159] = BinaryenBinary(the_module, 13, expressions[158], expressions[157]); + expressions[160] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[161] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[162] = BinaryenBinary(the_module, 39, expressions[161], expressions[160]); + expressions[163] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[164] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[165] = BinaryenBinary(the_module, 53, expressions[164], expressions[163]); + expressions[166] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[167] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[168] = BinaryenBinary(the_module, 67, expressions[167], expressions[166]); + expressions[169] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[170] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[171] = BinaryenBinary(the_module, 55, expressions[170], expressions[169]); + expressions[172] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[173] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[174] = BinaryenBinary(the_module, 69, expressions[173], expressions[172]); + expressions[175] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[176] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[177] = BinaryenBinary(the_module, 15, expressions[176], expressions[175]); + expressions[178] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[179] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[180] = BinaryenBinary(the_module, 58, expressions[179], expressions[178]); + expressions[181] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[182] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[183] = BinaryenBinary(the_module, 17, expressions[182], expressions[181]); + expressions[184] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[185] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[186] = BinaryenBinary(the_module, 43, expressions[185], expressions[184]); + expressions[187] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[188] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[189] = BinaryenBinary(the_module, 44, expressions[188], expressions[187]); + expressions[190] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[191] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[192] = BinaryenBinary(the_module, 20, expressions[191], expressions[190]); + expressions[193] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[194] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[195] = BinaryenBinary(the_module, 46, expressions[194], expressions[193]); + expressions[196] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[197] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[198] = BinaryenBinary(the_module, 22, expressions[197], expressions[196]); + expressions[199] = BinaryenConst(the_module, BinaryenLiteralInt32(-11)); + expressions[200] = BinaryenConst(the_module, BinaryenLiteralInt32(-10)); + expressions[201] = BinaryenBinary(the_module, 23, expressions[200], expressions[199]); + expressions[202] = BinaryenConst(the_module, BinaryenLiteralInt64(-23)); + expressions[203] = BinaryenConst(the_module, BinaryenLiteralInt64(-22)); + expressions[204] = BinaryenBinary(the_module, 49, expressions[203], expressions[202]); + expressions[205] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[206] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[207] = BinaryenBinary(the_module, 59, expressions[206], expressions[205]); + expressions[208] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[209] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[210] = BinaryenBinary(the_module, 73, expressions[209], expressions[208]); + expressions[211] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9007.33)); + expressions[212] = BinaryenConst(the_module, BinaryenLiteralFloat64(-9005.84)); + expressions[213] = BinaryenBinary(the_module, 74, expressions[212], expressions[211]); + expressions[214] = BinaryenConst(the_module, BinaryenLiteralFloat32(-62.5)); + expressions[215] = BinaryenConst(the_module, BinaryenLiteralFloat32(-33.612)); + expressions[216] = BinaryenBinary(the_module, 62, expressions[215], expressions[214]); { BinaryenExpressionRef children[] = { 0 }; - expressions[201] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto()); - } - expressions[202] = BinaryenIf(the_module, expressions[17], expressions[18], expressions[19]); - expressions[203] = BinaryenIf(the_module, expressions[20], expressions[21], expressions[0]); - expressions[204] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[205] = BinaryenLoop(the_module, "in", expressions[204]); - expressions[206] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); - expressions[207] = BinaryenLoop(the_module, NULL, expressions[206]); - expressions[208] = BinaryenBreak(the_module, "the-value", expressions[22], expressions[23]); - expressions[209] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); - expressions[210] = BinaryenBreak(the_module, "the-nothing", expressions[209], expressions[0]); - expressions[211] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); - expressions[212] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[211]); - expressions[213] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); + expressions[217] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto()); + } + expressions[218] = BinaryenIf(the_module, expressions[17], expressions[18], expressions[19]); + expressions[219] = BinaryenIf(the_module, expressions[20], expressions[21], expressions[0]); + expressions[220] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[221] = BinaryenLoop(the_module, "in", expressions[220]); + expressions[222] = BinaryenConst(the_module, BinaryenLiteralInt32(0)); + expressions[223] = BinaryenLoop(the_module, NULL, expressions[222]); + expressions[224] = BinaryenBreak(the_module, "the-value", expressions[22], expressions[23]); + expressions[225] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[226] = BinaryenBreak(the_module, "the-nothing", expressions[225], expressions[0]); + expressions[227] = BinaryenConst(the_module, BinaryenLiteralInt32(3)); + expressions[228] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[227]); + expressions[229] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]); { const char* names[] = { "the-value" }; - expressions[214] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[24], expressions[25]); + expressions[230] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[24], expressions[25]); } - expressions[215] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[231] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); { const char* names[] = { "the-nothing" }; - expressions[216] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[215], expressions[0]); + expressions[232] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[231], expressions[0]); } { BinaryenExpressionRef operands[] = { expressions[9], expressions[10], expressions[11], expressions[12] }; - expressions[217] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1); + expressions[233] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1); } - expressions[218] = BinaryenUnary(the_module, 20, expressions[217]); + expressions[234] = BinaryenUnary(the_module, 20, expressions[233]); { BinaryenExpressionRef operands[] = { expressions[7], expressions[8] }; - expressions[219] = BinaryenCall(the_module, "an-imported", operands, 2, 3); + expressions[235] = BinaryenCall(the_module, "an-imported", operands, 2, 3); } - expressions[220] = BinaryenUnary(the_module, 25, expressions[219]); - expressions[221] = BinaryenUnary(the_module, 20, expressions[220]); - expressions[222] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); + expressions[236] = BinaryenUnary(the_module, 25, expressions[235]); + expressions[237] = BinaryenUnary(the_module, 20, expressions[236]); + expressions[238] = BinaryenConst(the_module, BinaryenLiteralInt32(2449)); { BinaryenExpressionRef operands[] = { expressions[13], expressions[14], expressions[15], expressions[16] }; - expressions[223] = BinaryenCallIndirect(the_module, expressions[222], operands, 4, "iiIfF"); - } - expressions[224] = BinaryenUnary(the_module, 20, expressions[223]); - expressions[225] = BinaryenGetLocal(the_module, 0, 1); - expressions[226] = BinaryenDrop(the_module, expressions[225]); - expressions[227] = BinaryenConst(the_module, BinaryenLiteralInt32(101)); - expressions[228] = BinaryenSetLocal(the_module, 0, expressions[227]); - expressions[229] = BinaryenConst(the_module, BinaryenLiteralInt32(102)); - expressions[230] = BinaryenTeeLocal(the_module, 0, expressions[229]); - expressions[231] = BinaryenDrop(the_module, expressions[230]); - expressions[232] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); - expressions[233] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[232]); - expressions[234] = BinaryenConst(the_module, BinaryenLiteralInt32(8)); - expressions[235] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[234]); - expressions[236] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); - expressions[237] = BinaryenLoad(the_module, 4, 0, 0, 0, 3, expressions[236]); - expressions[238] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); - expressions[239] = BinaryenLoad(the_module, 8, 0, 2, 8, 4, expressions[238]); - expressions[240] = BinaryenStore(the_module, 4, 0, 0, expressions[29], expressions[30], 1); - expressions[241] = BinaryenStore(the_module, 8, 2, 4, expressions[31], expressions[32], 2); - expressions[242] = BinaryenSelect(the_module, expressions[26], expressions[27], expressions[28]); - expressions[243] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); - expressions[244] = BinaryenReturn(the_module, expressions[243]); - expressions[245] = BinaryenNop(the_module); - expressions[246] = BinaryenUnreachable(the_module); + expressions[239] = BinaryenCallIndirect(the_module, expressions[238], operands, 4, "iiIfF"); + } + expressions[240] = BinaryenUnary(the_module, 20, expressions[239]); + expressions[241] = BinaryenGetLocal(the_module, 0, 1); + expressions[242] = BinaryenDrop(the_module, expressions[241]); + expressions[243] = BinaryenConst(the_module, BinaryenLiteralInt32(101)); + expressions[244] = BinaryenSetLocal(the_module, 0, expressions[243]); + expressions[245] = BinaryenConst(the_module, BinaryenLiteralInt32(102)); + expressions[246] = BinaryenTeeLocal(the_module, 0, expressions[245]); + expressions[247] = BinaryenDrop(the_module, expressions[246]); + expressions[248] = BinaryenConst(the_module, BinaryenLiteralInt32(1)); + expressions[249] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[248]); + expressions[250] = BinaryenConst(the_module, BinaryenLiteralInt32(8)); + expressions[251] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[250]); + expressions[252] = BinaryenConst(the_module, BinaryenLiteralInt32(2)); + expressions[253] = BinaryenLoad(the_module, 4, 0, 0, 0, 3, expressions[252]); + expressions[254] = BinaryenConst(the_module, BinaryenLiteralInt32(9)); + expressions[255] = BinaryenLoad(the_module, 8, 0, 2, 8, 4, expressions[254]); + expressions[256] = BinaryenStore(the_module, 4, 0, 0, expressions[29], expressions[30], 1); + expressions[257] = BinaryenStore(the_module, 8, 2, 4, expressions[31], expressions[32], 2); + expressions[258] = BinaryenSelect(the_module, expressions[26], expressions[27], expressions[28]); + expressions[259] = BinaryenConst(the_module, BinaryenLiteralInt32(1337)); + expressions[260] = BinaryenReturn(the_module, expressions[259]); + expressions[261] = BinaryenNop(the_module); + expressions[262] = BinaryenUnreachable(the_module); BinaryenExpressionPrint(expressions[40]); (f32.neg (f32.const -33.61199951171875) @@ -1344,36 +1400,38 @@ int main() { expressions[68], expressions[70], expressions[72], expressions[74], expressions[76], expressions[78], expressions[80], expressions[82], expressions[84], expressions[86], expressions[88], expressions[90], expressions[92], expressions[94], expressions[96], expressions[98], expressions[100], expressions[102], - expressions[104], expressions[107], expressions[110], expressions[113], expressions[116], expressions[119], - expressions[122], expressions[125], expressions[128], expressions[131], expressions[134], expressions[137], - expressions[140], expressions[143], expressions[146], expressions[149], expressions[152], expressions[155], - expressions[158], expressions[161], expressions[164], expressions[167], expressions[170], expressions[173], - expressions[176], expressions[179], expressions[182], expressions[185], expressions[188], expressions[191], - expressions[194], expressions[197], expressions[200], expressions[201], expressions[202], expressions[203], - expressions[205], expressions[207], expressions[208], expressions[210], expressions[212], expressions[213], - expressions[214], expressions[216], expressions[218], expressions[221], expressions[224], expressions[226], - expressions[228], expressions[231], expressions[233], expressions[235], expressions[237], expressions[239], - expressions[240], expressions[241], expressions[242], expressions[244], expressions[245], expressions[246] }; - expressions[247] = BinaryenBlock(the_module, "the-value", children, 95, BinaryenTypeAuto()); + expressions[104], expressions[106], expressions[108], expressions[110], expressions[112], expressions[114], + expressions[116], expressions[118], expressions[120], expressions[123], expressions[126], expressions[129], + expressions[132], expressions[135], expressions[138], expressions[141], expressions[144], expressions[147], + expressions[150], expressions[153], expressions[156], expressions[159], expressions[162], expressions[165], + expressions[168], expressions[171], expressions[174], expressions[177], expressions[180], expressions[183], + expressions[186], expressions[189], expressions[192], expressions[195], expressions[198], expressions[201], + expressions[204], expressions[207], expressions[210], expressions[213], expressions[216], expressions[217], + expressions[218], expressions[219], expressions[221], expressions[223], expressions[224], expressions[226], + expressions[228], expressions[229], expressions[230], expressions[232], expressions[234], expressions[237], + expressions[240], expressions[242], expressions[244], expressions[247], expressions[249], expressions[251], + expressions[253], expressions[255], expressions[256], expressions[257], expressions[258], expressions[260], + expressions[261], expressions[262] }; + expressions[263] = BinaryenBlock(the_module, "the-value", children, 103, BinaryenTypeAuto()); } - expressions[248] = BinaryenDrop(the_module, expressions[247]); + expressions[264] = BinaryenDrop(the_module, expressions[263]); { - BinaryenExpressionRef children[] = { expressions[248] }; - expressions[249] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto()); + BinaryenExpressionRef children[] = { expressions[264] }; + expressions[265] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto()); } - expressions[250] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); + expressions[266] = BinaryenConst(the_module, BinaryenLiteralInt32(42)); { - BinaryenExpressionRef children[] = { expressions[249], expressions[250] }; - expressions[251] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto()); + BinaryenExpressionRef children[] = { expressions[265], expressions[266] }; + expressions[267] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto()); } { BinaryenType varTypes[] = { 1 }; - functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 1, expressions[251]); + functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 1, expressions[267]); } - expressions[252] = BinaryenConst(the_module, BinaryenLiteralInt32(7)); - BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[252]); - expressions[253] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5)); - BinaryenAddGlobal(the_module, "a-mutable-global", 3, 1, expressions[253]); + expressions[268] = BinaryenConst(the_module, BinaryenLiteralInt32(7)); + BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[268]); + expressions[269] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5)); + BinaryenAddGlobal(the_module, "a-mutable-global", 3, 1, expressions[269]); { BinaryenType paramTypes[] = { 1, 4 }; functionTypes[1] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2); @@ -1385,11 +1443,11 @@ int main() { const char* funcNames[] = { "kitchen()sinker" }; BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1); } - expressions[254] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); + expressions[270] = BinaryenConst(the_module, BinaryenLiteralInt32(10)); { const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 }; const char* segments[] = { segment0 }; - BinaryenExpressionRef segmentOffsets[] = { expressions[254] }; + BinaryenExpressionRef segmentOffsets[] = { expressions[270] }; BinaryenIndex segmentSizes[] = { 12 }; BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentOffsets, segmentSizes, 1, 0); } @@ -1397,10 +1455,10 @@ int main() { BinaryenType paramTypes[] = { 0 }; functionTypes[2] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0); } - expressions[255] = BinaryenNop(the_module); + expressions[271] = BinaryenNop(the_module); { BinaryenType varTypes[] = { 0 }; - functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[255]); + functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[2], varTypes, 0, expressions[271]); } BinaryenSetStart(the_module, functions[1]); { @@ -1542,6 +1600,46 @@ int main() { ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const -9005.841) + ) + ) + (drop (i32.reinterpret/f32 (f32.const -33.61199951171875) ) diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt index d23e109b5..4cf98c329 100644 --- a/test/example/c-api-kitchen-sink.txt.txt +++ b/test/example/c-api-kitchen-sink.txt.txt @@ -133,6 +133,46 @@ ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_s:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const -33.61199951171875) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const -9005.84) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const -9005.84) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const -9005.84) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const -9005.84) + ) + ) + (drop (i32.reinterpret/f32 (f32.const -33.61199951171875) ) diff --git a/test/kitchen_sink.wast b/test/kitchen_sink.wast index dc1583811..19c1aec12 100644 --- a/test/kitchen_sink.wast +++ b/test/kitchen_sink.wast @@ -557,6 +557,26 @@ ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i32.wrap/i64 (i64.const 100) ) @@ -582,6 +602,26 @@ ) ) (drop + (i64.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i64.extend_s/i32 (i32.const 10) ) diff --git a/test/kitchen_sink.wast.from-wast b/test/kitchen_sink.wast.from-wast index 621b02a56..e8376a9c2 100644 --- a/test/kitchen_sink.wast.from-wast +++ b/test/kitchen_sink.wast.from-wast @@ -557,6 +557,26 @@ ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i32.wrap/i64 (i64.const 100) ) @@ -582,6 +602,26 @@ ) ) (drop + (i64.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i64.extend_s/i32 (i32.const 10) ) diff --git a/test/kitchen_sink.wast.fromBinary b/test/kitchen_sink.wast.fromBinary index dee6984f8..ee22ef0d5 100644 --- a/test/kitchen_sink.wast.fromBinary +++ b/test/kitchen_sink.wast.fromBinary @@ -556,6 +556,26 @@ ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i32.wrap/i64 (i64.const 100) ) @@ -581,6 +601,26 @@ ) ) (drop + (i64.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i64.extend_s/i32 (i32.const 10) ) diff --git a/test/kitchen_sink.wast.fromBinary.noDebugInfo b/test/kitchen_sink.wast.fromBinary.noDebugInfo index 162c1fa96..9578cc41b 100644 --- a/test/kitchen_sink.wast.fromBinary.noDebugInfo +++ b/test/kitchen_sink.wast.fromBinary.noDebugInfo @@ -556,6 +556,26 @@ ) ) (drop + (i32.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i32.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i32.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i32.wrap/i64 (i64.const 100) ) @@ -581,6 +601,26 @@ ) ) (drop + (i64.trunc_s:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f32 + (f32.const 10) + ) + ) + (drop + (i64.trunc_s:sat/f64 + (f64.const 10) + ) + ) + (drop + (i64.trunc_u:sat/f64 + (f64.const 10) + ) + ) + (drop (i64.extend_s/i32 (i32.const 10) ) diff --git a/test/passes/translate-to-fuzz.txt b/test/passes/translate-to-fuzz.txt index 3bd65e51d..50f5486cf 100644 --- a/test/passes/translate-to-fuzz.txt +++ b/test/passes/translate-to-fuzz.txt @@ -1,15 +1,13 @@ (module (type $FUNCSIG$v (func)) - (type $FUNCSIG$ijdfd (func (param i64 f64 f32 f64) (result i32))) - (type $FUNCSIG$j (func (result i64))) (import "fuzzing-support" "log-i32" (func $log-i32 (param i32))) (import "fuzzing-support" "log-i64" (func $log-i64 (param i64))) (import "fuzzing-support" "log-f32" (func $log-f32 (param f32))) (import "fuzzing-support" "log-f64" (func $log-f64 (param f64))) (memory $0 (shared 1 1)) (data (i32.const 0) "n\00\05E\00\00\00\00") - (table $0 4 anyfunc) - (elem (i32.const 0) $func_7 $func_14 $func_14 $func_14) + (table $0 2 2 anyfunc) + (elem (i32.const 0) $func_7 $func_11) (global $global$0 (mut f32) (f32.const 536870912)) (global $global$1 (mut f32) (f32.const 2147483648)) (global $global$2 (mut f64) (f64.const -1048576)) @@ -17,9 +15,6 @@ (global $hangLimit (mut i32) (i32.const 10)) (export "func_5_invoker" (func $func_5_invoker)) (export "func_9_invoker" (func $func_9_invoker)) - (export "func_11" (func $func_11)) - (export "func_12" (func $func_12)) - (export "func_12_invoker" (func $func_12_invoker)) (export "hangLimitInitializer" (func $hangLimitInitializer)) (func $func_4 (; 4 ;) (param $0 f32) (param $1 i64) (param $2 i32) (param $3 f32) (param $4 f64) (result f32) (local $5 f32) @@ -154,7 +149,7 @@ ) ) ) - (func $func_11 (; 11 ;) (type $FUNCSIG$ijdfd) (param $0 i64) (param $1 f64) (param $2 f32) (param $3 f64) (result i32) + (func $func_11 (; 11 ;) (param $0 i64) (param $1 f64) (param $2 f32) (param $3 f64) (result i32) (local $4 f32) (local $5 i64) (local $6 f32) @@ -167,7 +162,7 @@ (get_global $hangLimit) ) (return - (get_local $9) + (i32.const -72) ) ) (set_global $hangLimit @@ -184,7 +179,7 @@ (get_global $hangLimit) ) (return - (i32.const -4) + (get_local $9) ) ) (set_global $hangLimit @@ -196,64 +191,109 @@ ) (block $label$1 (result i32) (if - (i32.eqz - (loop $label$2 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -536870912) - ) + (loop $label$2 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) + (return + (i32.const 1499158319) ) ) - (block (result i32) - (block $label$3 - (set_local $4 - (if (result f32) - (loop $label$4 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $8) - ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block (result i32) + (block $label$3 + (set_local $6 + (if (result f32) + (loop $label$4 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) + (return + (get_local $9) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) ) ) - (get_local $9) ) - (block $label$11 (result f32) - (block $label$20 - (nop) - (if - (i32.const 69016851) - (set_local $0 - (get_local $5) + (block (result i32) + (block $label$5 + (set_local $3 + (get_local $1) + ) + (set_local $6 + (get_local $2) + ) + ) + (br_if $label$4 + (tee_local $8 + (tee_local $9 + (tee_local $8 + (tee_local $8 + (tee_local $9 + (get_local $9) + ) + ) + ) ) - (set_local $7 - (loop $label$21 (result i64) + ) + ) + (loop $label$9 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -42) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (i32.trunc_u:sat/f64 + (loop $label$10 (result f64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -127) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (loop $label$11 (result f64) (block (if (i32.eqz (get_global $hangLimit) ) (return - (i32.const 128) + (get_local $8) ) ) (set_global $hangLimit @@ -263,384 +303,179 @@ ) ) ) - (block (result i64) - (set_local $6 - (block $label$22 (result f32) - (set_local $0 - (i64.const 32768) - ) - (f32.const 512) + (block (result f64) + (set_local $5 + (tee_local $0 + (i64.const 281474976710656) ) ) - (br_if $label$21 - (block $label$23 (result i32) - (nop) - (get_local $9) + (br_if $label$11 + (i32.const 16) + ) + (loop $label$12 (result f64) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -65536) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) ) + (get_local $1) ) - (i64.const 35325213) ) ) ) ) ) - (f32.const -4294967296) - ) - (block $label$12 - (set_local $1 - (tee_local $3 - (tee_local $1 - (tee_local $3 - (tee_local $3 - (get_local $3) - ) - ) - ) - ) - ) - (br $label$3) ) ) - ) - (set_local $6 - (f32.const -4294967296) - ) - ) - (br_if $label$2 - (i32.eqz - (i32.const -2147483648) - ) - ) - (get_local $9) - ) - ) - ) - (block $label$13 - (set_local $4 - (tee_local $2 - (if (result f32) - (tee_local $8 - (tee_local $9 - (i32.const 487671376) - ) - ) - (loop $label$14 (result f32) - (block - (if + (tee_local $2 + (if (result f32) (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 374370334) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (tee_local $4 - (tee_local $4 - (tee_local $4 - (tee_local $2 - (tee_local $6 - (f32.const 125437032) - ) - ) - ) - ) - ) - ) - (block $label$24 - (set_local $4 - (get_local $2) - ) - (br $label$13) - ) - ) - ) - ) - (set_local $7 - (i64.const -2147483646) - ) - ) - (block $label$25 - (loop $label$26 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 21) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$27 - (set_local $1 - (tee_local $1 - (tee_local $1 - (tee_local $3 - (tee_local $3 - (tee_local $1 - (tee_local $3 - (tee_local $3 - (get_local $3) + (loop $label$13 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -65536) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) ) ) - ) - ) - ) - ) - ) - ) - (loop $label$28 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -32768) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block - (set_local $8 - (get_local $9) - ) - (br_if $label$28 - (get_local $8) - ) - (call $log-i32 - (loop $label$29 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 1048576) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (tee_local $0 - (if - (i32.eqz - (loop $label$30 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $9) - ) + (block (result i32) + (block $label$14 + (if + (i32.const 0) + (block $label$15 + (call $log-f64 + (f64.const -2) ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) + (set_local $4 + (get_local $2) ) ) - (block $label$31 - (set_local $4 - (tee_local $2 - (tee_local $2 - (tee_local $4 - (tee_local $4 - (tee_local $2 - (tee_local $6 - (f32.const 125437032) - ) - ) - ) - ) + (set_local $0 + (i64.const 65510) + ) + ) + (call $log-i32 + (loop $label$16 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (get_local $9) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) ) ) ) - (br $label$27) + (block (result i32) + (nop) + (br_if $label$16 + (i32.eqz + (get_local $8) + ) + ) + (i32.const -71) + ) ) ) ) - (block $label$33 - (set_local $7 - (tee_local $0 - (tee_local $7 - (get_local $5) + (br_if $label$13 + (get_local $9) + ) + (br_if $label$1 + (if (result i32) + (i32.eqz + (tee_local $8 + (i32.const -65536) ) ) - ) - (br $label$27) - ) - (block $label$34 - (block $label$18 - (set_local $2 - (tee_local $4 - (get_local $4) + (block $label$24 (result i32) + (set_local $0 + (i64.const -127) + ) + (call $func_11 + (get_local $7) + (f64.const 3402823466385288598117041e14) + (f32.const 2305843009213693952) + (get_local $3) ) ) - (set_local $9 - (tee_local $9 - (get_local $9) + (tee_local $9 + (i32.const 1162292275) + ) + ) + (i32.eqz + (if (result i32) + (get_local $8) + (i32.const 1024) + (block $label$22 (result i32) + (set_local $0 + (i64.const 36028797018963968) + ) + (loop $label$23 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -65536) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (get_local $8) + ) ) ) ) - (br $label$28) - ) - ) - ) - (br_if $label$29 - (i32.const -83) - ) - (br_if $label$1 - (i32.const -65535) - (i32.eqz - (tee_local $9 - (i32.const 512) ) ) ) ) + (get_local $4) + (get_local $2) ) ) - ) - ) - ) - ) - (br_if $label$25 - (i32.eqz - (br_if $label$1 - (i32.const -8388608) - (i32.eqz - (i32.const 1798) - ) - ) - ) - ) - ) - ) - (br $label$0) - ) - ) - ) - (func $func_12 (; 12 ;) (type $FUNCSIG$j) (result i64) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i64.const 6779903213212753417) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result i64) - (nop) - (i64.const -81) - ) - ) - (func $func_12_invoker (; 13 ;) (type $FUNCSIG$v) - (drop - (call $func_12) - ) - (drop - (call $func_12) - ) - (drop - (call $func_12) - ) - (drop - (call $func_12) - ) - (drop - (call $func_12) - ) - ) - (func $func_14 (; 14 ;) (param $0 f64) (param $1 f32) (param $2 f32) (param $3 i64) (param $4 i32) (result i32) - (local $5 i64) - (local $6 i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$0 (result i32) - (set_local $6 - (loop $label$1 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -78) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (block $label$2 - (set_local $3 - (i64.const 22) - ) - (set_local $2 - (tee_local $1 - (tee_local $1 - (if (result f32) - (get_local $6) - (loop $label$3 (result f32) + (block $label$25 (result f32) + (loop $label$26 (block (if (i32.eqz (get_global $hangLimit) ) (return - (get_local $6) + (i32.const 1465597219) ) ) (set_global $hangLimit @@ -650,492 +485,237 @@ ) ) ) - (block $label$4 (result f32) + (block + (set_local $5 + (i64.const 1877285765241048336) + ) + (br_if $label$26 + (i32.const -127) + ) (set_local $6 - (tee_local $6 - (loop $label$5 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -32767) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (block $label$6 - (set_local $0 - (f64.const 18446744073709551615) - ) - (set_local $2 - (f32.const 1.2250390128955172e-22) - ) - ) - (br_if $label$5 - (i32.eqz - (tee_local $4 - (i32.const 656421170) - ) - ) - ) - (i32.const 1598490719) - ) - ) - ) + (get_local $2) ) - (f32.const -144115188075855872) ) ) - (block $label$7 (result f32) - (drop - (get_local $3) - ) - (loop $label$8 (result f32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) + (br_if $label$25 + (br_if $label$25 + (tee_local $4 + (f32.const 4294967296) + ) + (loop $label$29 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -88) + ) ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) ) ) - ) - (block (result f32) - (tee_local $6 - (block $label$9 - (set_local $4 - (tee_local $4 - (loop $label$10 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (set_local $6 - (get_local $6) - ) - (br_if $label$10 - (get_local $4) - ) - (get_local $6) + (block (result i32) + (block $label$30 + (set_local $3 + (if (result f64) + (i32.const 32767) + (block $label$31 + (set_local $9 + (get_local $8) ) + (br $label$29) ) + (f64.const 4) ) ) - (return - (get_local $4) + (set_local $3 + (get_local $1) ) ) - ) - (br_if $label$8 - (br_if $label$0 - (br_if $label$0 - (i32.const -2147483648) - (i32.eqz - (get_local $4) + (br_if $label$29 + (tee_local $9 + (tee_local $9 + (tee_local $8 + (get_local $8) + ) ) ) - (i32.eqz - (br_if $label$0 - (if (result i32) - (block $label$11 (result i32) - (nop) - (i32.const 67108864) - ) - (block $label$12 - (set_local $5 - (i64.const 86) + ) + (if (result i32) + (block $label$32 (result i32) + (call $log-f32 + (get_local $2) + ) + (i32.const -32768) + ) + (block $label$33 (result i32) + (loop $label$34 + (block + (if + (i32.eqz + (get_global $hangLimit) ) (return - (i32.const 319952130) + (get_local $8) ) ) - (block $label$13 (result i32) - (set_local $1 - (tee_local $1 - (get_local $1) - ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) ) - (loop $label$14 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $4) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) + ) + ) + (block + (block $label$35 + (nop) + (if + (tee_local $9 + (i32.const -32768) + ) + (nop) + (set_local $9 + (get_local $8) ) - (get_local $4) ) ) - ) - (i32.eqz - (br_if $label$0 - (i32.const 0) + (br_if $label$34 (i32.eqz - (br_if $label$0 - (i32.const 0) - (i32.eqz - (i32.const -131072) - ) - ) + (i32.const -69) ) ) + (call $log-i32 + (i32.const 5) + ) + ) + ) + (tee_local $8 + (tee_local $9 + (i32.const -128) ) ) ) + (get_local $9) ) ) - (get_local $2) ) ) + (i32.eqz + (get_local $8) + ) + ) + ) + ) + ) + (nop) + ) + (br_if $label$2 + (tee_local $9 + (tee_local $9 + (tee_local $9 + (tee_local $9 + (get_local $9) ) ) ) ) ) + (i32.const 7) ) - (br_if $label$1 - (i32.eqz - (if (result i32) - (i32.eqz - (get_local $6) + ) + (block $label$45 + (set_local $5 + (get_local $5) + ) + ) + (block $label$46 + (nop) + (if + (loop $label$47 (result i32) + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (i32.const -32768) + ) ) - (loop $label$15 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) ) - (block (result i32) - (block $label$16 - (loop $label$17 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (call $log-i64 - (loop $label$18 (result i64) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 5379960) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i64) - (block $label$19 - (if - (i32.const -65535) - (block $label$20 - (set_local $6 - (loop $label$21 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 8388608) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (call $log-f64 - (get_local $0) - ) - (br_if $label$21 - (loop $label$22 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -18) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (i32.const -536870912) - ) - ) - (tee_local $6 - (tee_local $6 - (i32.const 7937) - ) - ) - ) - ) - ) - (call $log-f64 - (block $label$23 (result f64) - (set_local $3 - (get_local $5) - ) - (br_if $label$23 - (get_local $0) - (i32.eqz - (i32.load offset=4 align=1 - (i32.and - (i32.const 2071622516) - (i32.const 15) - ) - ) - ) - ) - ) - ) - ) - (set_local $2 - (f32.const 2097152) - ) - ) - (br_if $label$17 - (i32.eqz - (block $label$24 - (set_local $3 - (get_local $3) - ) - (br $label$16) - ) - ) - ) - ) - (br_if $label$18 - (i32.eqz - (loop $label$25 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 678827100) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$26 (result i32) - (loop $label$27 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const 421033554) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$28 - (block $label$29 - (nop) - (nop) - ) - (set_local $0 - (get_local $0) - ) - ) - ) - (if (result i32) - (unreachable.atomic.rmw?.xor - (i32.and - (loop $label$30 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (set_local $1 - (f32.const 724134784) - ) - (br_if $label$30 - (i32.const 32768) - ) - (if (result i32) - (i32.eqz - (if (result i32) - (i32.eqz - (i32.const -2147483648) - ) - (tee_local $4 - (i32.const -16384) - ) - (tee_local $6 - (i32.const -4) - ) - ) - ) - (get_local $4) - (i32.const 7633019) - ) - ) - ) - (i32.const 15) - ) - (block $label$31 - (set_local $0 - (f64.const 1.4014461213526112e-292) - ) - (br $label$1) - ) - ) - (block $label$32 (result i32) - (call $log-i32 - (loop $label$33 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -54) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (i32.const -16777216) - ) - ) - (get_local $6) - ) - (block $label$34 (result i32) - (set_local $0 - (f64.const 2305843009213693952) - ) - (i32.const 90) - ) - ) - ) - ) - ) + ) + ) + (block (result i32) + (block $label$48 + (set_local $8 + (tee_local $8 + (tee_local $8 + (tee_local $8 + (tee_local $9 + (tee_local $9 + (tee_local $8 + (get_local $9) ) - (get_local $3) ) ) ) ) + ) + ) + (if + (get_local $8) + (block $label$49 + (set_global $global$3 + (get_local $3) + ) (set_local $3 - (i64.const 17592186044416) + (f64.const 274877906944) + ) + ) + (block $label$64 + (set_local $5 + (i64.const -32) + ) + (set_local $1 + (get_local $1) ) ) - (br_if $label$15 - (tee_local $6 - (loop $label$35 (result i32) + ) + ) + (br_if $label$47 + (get_local $9) + ) + (block $label$66 (result i32) + (set_local $6 + (get_local $4) + ) + (if (result i32) + (i32.eqz + (get_local $8) + ) + (block $label$67 (result i32) + (br_if $label$46 + (i32.eqz + (get_local $8) + ) + ) + (tee_local $8 + (loop $label$68 (result i32) (block (if (i32.eqz (get_global $hangLimit) ) (return - (i32.const -4) + (get_local $8) ) ) (set_global $hangLimit @@ -1146,269 +726,146 @@ ) ) (block (result i32) - (block $label$36 - (set_local $6 - (br_if $label$0 - (tee_local $4 - (loop $label$39 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -2048) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) + (set_local $8 + (tee_local $9 + (tee_local $9 + (i32.const 32767) + ) + ) + ) + (br_if $label$68 + (i32.eqz + (call $func_11 + (i64.const 8245) + (get_local $3) + (block $label$69 (result f32) + (if + (i32.const 1001235) + (set_local $7 + (if (result i64) + (get_local $9) + (get_local $0) + (i64.const 32768) ) ) - (tee_local $6 - (tee_local $6 - (i32.const -32768) - ) + (set_local $7 + (get_local $0) ) ) + (f32.const 23316) ) - (i32.eqz - (br_if $label$0 - (loop $label$37 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $6) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) + (loop $label$70 (result f64) + (block + (if + (i32.eqz + (get_global $hangLimit) ) - (block $label$38 (result i32) - (set_local $4 - (i32.const -128) - ) - (tee_local $6 - (br_if $label$0 - (i32.const -12) - (i32.eqz - (get_local $4) - ) - ) - ) + (return + (i32.const -8388608) ) ) - (get_local $4) - ) - ) - ) - ) - (set_local $1 - (f32.const -2147483648) - ) - ) - (br_if $label$35 - (if (result i32) - (i32.eqz - (block $label$40 (result i32) - (tee_local $3 - (loop $label$41 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $4) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block $label$42 - (loop $label$43 - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -76) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block - (set_local $6 - (loop $label$44 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (get_local $4) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (get_local $6) - ) - ) - (br_if $label$43 - (i32.eqz - (i32.const 33554432) - ) - ) - (block $label$45 - (block $label$46 - (set_local $5 - (i64.const 262144) - ) - ) - (set_local $3 - (get_local $5) - ) - ) - ) - ) - (br $label$35) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) ) ) ) - (tee_local $6 - (tee_local $4 - (i32.const -33554432) - ) - ) - ) - ) - (block $label$47 (result i32) - (set_local $2 - (get_local $1) - ) - (tee_local $4 - (tee_local $6 - (tee_local $6 - (i32.const -2147483648) - ) - ) - ) - ) - (block $label$48 (result i32) - (br_if $label$35 - (i32.eqz - (select - (loop $label$50 (result i32) - (block - (if - (i32.eqz - (get_global $hangLimit) - ) - (return - (i32.const -74) - ) - ) - (set_global $hangLimit - (i32.sub - (get_global $hangLimit) - (i32.const 1) - ) - ) - ) - (block (result i32) - (if - (tee_local $6 - (i32.const 12081) - ) - (set_local $6 - (get_local $6) - ) - (set_local $4 - (i32.const 8) - ) - ) - (br_if $label$50 - (i32.eqz - (if (result i32) - (i32.eqz - (br_if $label$48 - (i32.const 85) - (i32.const 289932813) - ) - ) - (get_local $6) - (get_local $4) - ) - ) - ) - (get_local $6) - ) - ) - (i32.const -2147483647) - (block $label$49 - (set_local $0 - (get_local $0) - ) - (br $label$1) + (block (result f64) + (nop) + (br_if $label$70 + (tee_local $9 + (i32.const 134217728) ) ) + (get_local $3) ) ) - (get_local $4) ) ) ) - (get_local $6) + (tee_local $8 + (tee_local $8 + (tee_local $8 + (i32.const 167) + ) + ) + ) ) ) ) ) - (i32.const -65535) + (block $label$72 + (set_local $6 + (get_local $2) + ) + (br $label$46) + ) + ) + ) + ) + ) + (block $label$73 + (set_local $1 + (block $label$74 (result f64) + (call $log-i64 + (i64.const 108) + ) + (tee_local $3 + (f64.const 9223372036854775808) ) ) - (block $label$51 (result i32) - (i32.const 504305950) + ) + (call $log-i64 + (tee_local $0 + (loop $label$75 + (block + (if + (i32.eqz + (get_global $hangLimit) + ) + (return + (get_local $8) + ) + ) + (set_global $hangLimit + (i32.sub + (get_global $hangLimit) + (i32.const 1) + ) + ) + ) + (block $label$76 + (set_local $9 + (tee_local $8 + (i32.const 80) + ) + ) + (br $label$46) + ) + ) ) ) ) + (set_local $9 + (i32.const -1024) + ) ) - (get_local $6) ) ) + (br_if $label$1 + (get_local $9) + (get_local $9) + ) ) - (get_local $4) ) ) - (func $hangLimitInitializer (; 15 ;) + (func $hangLimitInitializer (; 12 ;) (set_global $hangLimit (i32.const 10) ) ) - (func $deNan32 (; 16 ;) (param $0 f32) (result f32) + (func $deNan32 (; 13 ;) (param $0 f32) (result f32) (if (result f32) (f32.eq (get_local $0) @@ -1418,7 +875,7 @@ (f32.const 0) ) ) - (func $deNan64 (; 17 ;) (param $0 f64) (result f64) + (func $deNan64 (; 14 ;) (param $0 f64) (result f64) (if (result f64) (f64.eq (get_local $0) diff --git a/test/spec/conversions.wast b/test/spec/conversions.wast index 17036a75f..21f058897 100644 --- a/test/spec/conversions.wast +++ b/test/spec/conversions.wast @@ -10,6 +10,14 @@ (func (export "i64.trunc_u_f32") (param $x f32) (result i64) (i64.trunc_u/f32 (get_local $x))) (func (export "i64.trunc_s_f64") (param $x f64) (result i64) (i64.trunc_s/f64 (get_local $x))) (func (export "i64.trunc_u_f64") (param $x f64) (result i64) (i64.trunc_u/f64 (get_local $x))) + (func (export "i32.trunc_s_sat_f32") (param $x f32) (result i32) (i32.trunc_s:sat/f32 (get_local $x))) + (func (export "i32.trunc_u_sat_f32") (param $x f32) (result i32) (i32.trunc_u:sat/f32 (get_local $x))) + (func (export "i32.trunc_s_sat_f64") (param $x f64) (result i32) (i32.trunc_s:sat/f64 (get_local $x))) + (func (export "i32.trunc_u_sat_f64") (param $x f64) (result i32) (i32.trunc_u:sat/f64 (get_local $x))) + (func (export "i64.trunc_s_sat_f32") (param $x f32) (result i64) (i64.trunc_s:sat/f32 (get_local $x))) + (func (export "i64.trunc_u_sat_f32") (param $x f32) (result i64) (i64.trunc_u:sat/f32 (get_local $x))) + (func (export "i64.trunc_s_sat_f64") (param $x f64) (result i64) (i64.trunc_s:sat/f64 (get_local $x))) + (func (export "i64.trunc_u_sat_f64") (param $x f64) (result i64) (i64.trunc_u:sat/f64 (get_local $x))) (func (export "f32.convert_s_i32") (param $x i32) (result f32) (f32.convert_s/i32 (get_local $x))) (func (export "f32.convert_s_i64") (param $x i64) (result f32) (f32.convert_s/i64 (get_local $x))) (func (export "f64.convert_s_i32") (param $x i32) (result f64) (f64.convert_s/i32 (get_local $x))) @@ -217,6 +225,170 @@ (assert_trap (invoke "i64.trunc_u_f64" (f64.const -infinity)) "integer overflow") (assert_trap (invoke "i64.trunc_u_f64" (f64.const nan)) "invalid conversion to integer") +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -0x1.19999ap+0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.5)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -1.9)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2.0)) (i32.const -2)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 2147483520.0)) (i32.const 2147483520)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2147483648.0)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const 2147483648.0)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -2147483904.0)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const infinity)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const -infinity)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f32" (f32.const nan)) (i32.const 0)) + +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1p-149)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 0x1.19999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 1.9)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 2.0)) (i32.const 2)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 4294967040.0)) (i32.const -256)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1.ccccccp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -0x1.fffffep-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const 4294967296.0)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -1.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const infinity)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const -infinity)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f32" (f32.const nan)) (i32.const 0)) + +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -0x1.199999999999ap+0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.5)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -1.9)) (i32.const -1)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2.0)) (i32.const -2)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 2147483647.0)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2147483648.0)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const 2147483648.0)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -2147483649.0)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const infinity)) (i32.const 2147483647)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const -infinity)) (i32.const -2147483648)) +(assert_return (invoke "i32.trunc_s_sat_f64" (f64.const nan)) (i32.const 0)) + +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 0x1.199999999999ap+0)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.5)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1.9)) (i32.const 1)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 2.0)) (i32.const 2)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 2147483648)) (i32.const -2147483648)) ;; 0x1.00000p+31 -> 8000 0000 +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 4294967295.0)) (i32.const -1)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e8)) (i32.const 100000000)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 4294967296.0)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -1.0)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e16)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 1e30)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const 9223372036854775808)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const infinity)) (i32.const 4294967295)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const -infinity)) (i32.const 0)) +(assert_return (invoke "i32.trunc_u_sat_f64" (f64.const nan)) (i32.const 0)) + +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -0x1.19999ap+0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.5)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -1.9)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -2.0)) (i64.const -2)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 9223371487098961920.0)) (i64.const 9223371487098961920)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -9223372036854775808.0)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const 9223372036854775808.0)) (i64.const 9223372036854775807)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -9223373136366403584.0)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const infinity)) (i64.const 9223372036854775807)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const -infinity)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f32" (f32.const nan)) (i64.const 0)) + +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1p-149)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 0x1.19999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 4294967296)) (i64.const 4294967296)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 18446742974197923840.0)) (i64.const -1099511627776)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1.ccccccp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -0x1.fffffep-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const 18446744073709551616.0)) (i64.const 18446744073709551615)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -1.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const infinity)) (i64.const 18446744073709551615)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const -infinity)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f32" (f32.const nan)) (i64.const 0)) + +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -0x1.199999999999ap+0)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.5)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -1.9)) (i64.const -1)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -2.0)) (i64.const -2)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 4294967296)) (i64.const 4294967296)) ;; 0x1.00000p+32 -> 1 0000 0000 +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -4294967296)) (i64.const -4294967296)) ;; -0x1.00000p+32 -> ffff ffff 0000 0000 +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 9223372036854774784.0)) (i64.const 9223372036854774784)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -9223372036854775808.0)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const 9223372036854775808.0)) (i64.const 9223372036854775807)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -9223372036854777856.0)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const infinity)) (i64.const 9223372036854775807)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const -infinity)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_s_sat_f64" (f64.const nan)) (i64.const 0)) + +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x0.0000000000001p-1022)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1.0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 0x1.199999999999ap+0)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1.5)) (i64.const 1)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 4294967295)) (i64.const 0xffffffff)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 4294967296)) (i64.const 0x100000000)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 18446744073709549568.0)) (i64.const -2048)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x1.ccccccccccccdp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -0x1.fffffffffffffp-1)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1e8)) (i64.const 100000000)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 1e16)) (i64.const 10000000000000000)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 9223372036854775808)) (i64.const -9223372036854775808)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const 18446744073709551616.0)) (i64.const 18446744073709551615)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -1.0)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const infinity)) (i64.const 18446744073709551615)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const -infinity)) (i64.const 0)) +(assert_return (invoke "i64.trunc_u_sat_f64" (f64.const nan)) (i64.const 0)) + (assert_return (invoke "f32.convert_s_i32" (i32.const 1)) (f32.const 1.0)) (assert_return (invoke "f32.convert_s_i32" (i32.const -1)) (f32.const -1.0)) (assert_return (invoke "f32.convert_s_i32" (i32.const 0)) (f32.const 0.0)) |