WebAssembly / simd

Branch of the spec repo scoped to discussion of SIMD in WebAssembly
Other
527 stars 43 forks source link

Improve simd_i64x2_cmp.wast #487

Closed abrown closed 3 years ago

abrown commented 3 years ago

@ngzhian, I believe the simd_i64x2_cmp.wast tests could be improved if we varied the expected results of the ge_s and le_s tests. Most of those tests expect [-1, -1] so when I made a mistake re: flipped operands the tests did not fail for me. When I added tests like the following then I observed the expected failure (note the expected result is not all 1s):

(assert_return (invoke "ge_s" (v128.const i64x2 -1 -1)
                              (v128.const i64x2 0 -1))
                              (v128.const i64x2 0 -1))

Should we add a few of these types of tests (for implementor sanity)? And have you been adding these by hand or using some test generator (I think there was a Python one somewhere)?

ngzhian commented 3 years ago

Good idea, i64x2_cmp tests are generated by https://github.com/WebAssembly/simd/blob/master/test/core/simd/meta/simd_i64x2_cmp.py. Can you please add your test cases there and re-generate the test case?