Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@Honry
Copy link
Contributor

@Honry Honry commented Nov 4, 2019

This PR also centralizes the processing of float-point ops in one file named simd_float_op.py,
see WAVM PR: WAVM/WAVM#209

This PR also centralizes the processing of float-point ops
in one file named simd_float_op.py,
see WAVM PR: WAVM/WAVM#209
@Honry Honry mentioned this pull request Nov 4, 2019
'i64x2.add': [
[['0x7fffffffffffffff', ['0', '0', '0', '0', '0', '0', '0', '0x80'] * 4], '-1',
['i64x2', 'i8x16', 'i64x2']],
[['1', '255'], '0', ['i64x2', 'i8x16', 'i64x2']]
Copy link
Member

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.

Copy link
Contributor Author

@Honry Honry Nov 5, 2019

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree! Done.

Copy link
Member

@tlively tlively left a 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']]
Copy link
Member

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.

@tlively tlively merged commit 07a4fe6 into WebAssembly:master Nov 7, 2019
Honry added a commit to Honry/WAVM that referenced this pull request Nov 8, 2019
The file has been polished per comments from
WebAssembly/simd#135
AndrewScheidecker pushed a commit to WAVM/WAVM that referenced this pull request Nov 10, 2019
The file has been polished per comments from
WebAssembly/simd#135
kenohassler pushed a commit to fgsect/WAFL that referenced this pull request Oct 18, 2021
The file has been polished per comments from
WebAssembly/simd#135
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants