wabt
1f397a3c - Update testsuite (for SIMD) (#1373)

Commit
5 years ago
Update testsuite (for SIMD) (#1373) Lots of changes necessary to make this work, as well as some bug fixes. The main change is allowing `nan:canonical` and `nan:arithmetic` as a possible value for each lane of a `v128`. This needs to propogate through the parser, IR, the JSON format, and the spec interpreter. This also changes the format of the spec JSON file, where a SIMD value is now stored as a list of values instead of a single u128: ``` {"type": "v128", "lane_type": "i32", "value": ["0", "0", "0", "0"]} ``` Since the lane type can be `i8` and `i16`, these types can now be used in more places (not just the decompiler). They'll be used for the GC proposal too (for packed values), so I've updated them to use the binary value specified for that proposal. Here are the actual SIMD fixes: * SIMD lanes are malformed if they don't match the binary format, but invalid if they are smaller than the lane width. For example, `i8x16.extract_lane_s` is malformed if the lane is >= 256, because the lane is stored as a byte. But it is invalid if the lane is >= 16. * The `i8x16.narrow_i16x8_u`, `i16x8.narrow_i32x4_u` and `i64x2.load_32x2_u` instructions were not handling sign-extension propoerly. TODO: This code is pretty clumsy now; it would be better to have a universal `Value` and `ExpectedValue` that can be used everywhere, so the logic doesn't need to be duplicated.
Author
Parents
Loading