-
Notifications
You must be signed in to change notification settings - Fork 42
[test] Integrate tests for 64x2 arithmetic ops from WAVM #135
Conversation
This PR also centralizes the processing of float-point ops in one file named simd_float_op.py, see WAVM PR: WAVM/WAVM#209
| 'i64x2.add': [ | ||
| [['0x7fffffffffffffff', ['0', '0', '0', '0', '0', '0', '0', '0x80'] * 4], '-1', | ||
| ['i64x2', 'i8x16', 'i64x2']], | ||
| [['1', '255'], '0', ['i64x2', 'i8x16', 'i64x2']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there documentation anywhere on how these structures are interpreted? As it is they seem very magical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interpreted in https://github.com/WebAssembly/simd/blob/master/test/core/simd/meta/simd.py#L26.
The first element ['1', '255'] presents the arguments of the assertion, the second element '0' presents the test expected result. the last element ['i64x2', 'i8x16', 'i64x2'] presents v128 interpretations of previous elements with one-one correspondence. If the value of each lane are the same, the script will splat the argument to a v128 with corresponding interpretations.
i.e. this code will be interpreted as [[(v128.const i64x2 1 1), (v128 i8x16 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255)], (v128.const i64x2 0 0)]
This looks magical, but simplifies the script a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks. It would be good to add a comment in the code pointing to where they are interpreted to make it easier for readers to find out where they need to look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree! Done.
tlively
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with extra comments pointing to test data interpretation.
| 'i64x2.add': [ | ||
| [['0x7fffffffffffffff', ['0', '0', '0', '0', '0', '0', '0', '0x80'] * 4], '-1', | ||
| ['i64x2', 'i8x16', 'i64x2']], | ||
| [['1', '255'], '0', ['i64x2', 'i8x16', 'i64x2']] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks. It would be good to add a comment in the code pointing to where they are interpreted to make it easier for readers to find out where they need to look.
The file has been polished per comments from WebAssembly/simd#135
The file has been polished per comments from WebAssembly/simd#135
The file has been polished per comments from WebAssembly/simd#135
This PR also centralizes the processing of float-point ops in one file named simd_float_op.py,
see WAVM PR: WAVM/WAVM#209