-
Notifications
You must be signed in to change notification settings - Fork 42
[test] Integrate tests for f64x2 min/max/abs ops from WAVM #136
Conversation
test/core/simd/meta/simd_f64x2.py
Outdated
| ] | ||
|
|
||
| # Assert data | ||
| lst_oprt_with_const_assert = {} |
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.
What does the lst_oprt here mean?
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 means 'list of operator'. A data list specific for "const vs const" and "param vs const" tests. I will add more annotate here.
| template = Simdf32x4ArithmeticCase.gen_test_fn_template(self) | ||
|
|
||
| # Function template | ||
| tpl_func = ' (func (export "{}"){} (result v128) ({} {}{}))' |
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.
What does the tpl here mean? It also might be good to use names in the string interpolation so its clear what each part is supposed to be.
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.
tpl means 'template'.
It also might be good to use names in the string interpolation so its clear what each part is supposed to be.
Good point! I'd like to address this in a separate PR as it is a unified improvement.
| 'max-abs': [ | ||
| ['-1.125'] * 2, ['0.125'] * 2, ['1.125'] * 2 | ||
| ] | ||
| } |
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'm not sure how these structures are used either. They seem different from the previous structures.
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.
These structures inherit from simd_arithmetic.py, specific for combination tests. Here should have annotate to explain this.
| cases.append(str(AssertReturn(case_data[0], | ||
| [self.v128_const(case_data[3][0], case_data[1][0]), | ||
| self.v128_const(case_data[3][1], case_data[1][1])], | ||
| self.v128_const(case_data[3][2], case_data[2][0])))) |
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.
This looks like it's missing a space of indentation.
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.
No, the previous data is an array, that's why it looks like unaligned.
test/core/simd/simd_f64x2.wast
Outdated
| (func (export "f64x2.max_with_const_24") (result v128) (f64x2.max (v128.const f64x2 0x00 0x01) (v128.const f64x2 0x00 0x01))) | ||
| (func (export "f64x2.max_with_const_25") (result v128) (f64x2.max (v128.const f64x2 0x02 0x80000000) (v128.const f64x2 0x02 0x80000000))) | ||
| ;; f64x2.max param vs const | ||
| (func (export "f64x2.max_with_const_27")(param v128) (result v128) (f64x2.max (local.get 0) (v128.const f64x2 0 1))) |
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.
Looks like there should be another space before the param here.
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.
Good catch, I will fix it.
Honry
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.
@tlively, thanks for review, I will address the comments soon.
| template = Simdf32x4ArithmeticCase.gen_test_fn_template(self) | ||
|
|
||
| # Function template | ||
| tpl_func = ' (func (export "{}"){} (result v128) ({} {}{}))' |
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.
tpl means 'template'.
It also might be good to use names in the string interpolation so its clear what each part is supposed to be.
Good point! I'd like to address this in a separate PR as it is a unified improvement.
| cases.append(str(AssertReturn(case_data[0], | ||
| [self.v128_const(case_data[3][0], case_data[1][0]), | ||
| self.v128_const(case_data[3][1], case_data[1][1])], | ||
| self.v128_const(case_data[3][2], case_data[2][0])))) |
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.
No, the previous data is an array, that's why it looks like unaligned.
test/core/simd/simd_f64x2.wast
Outdated
| (func (export "f64x2.max_with_const_24") (result v128) (f64x2.max (v128.const f64x2 0x00 0x01) (v128.const f64x2 0x00 0x01))) | ||
| (func (export "f64x2.max_with_const_25") (result v128) (f64x2.max (v128.const f64x2 0x02 0x80000000) (v128.const f64x2 0x02 0x80000000))) | ||
| ;; f64x2.max param vs const | ||
| (func (export "f64x2.max_with_const_27")(param v128) (result v128) (f64x2.max (local.get 0) (v128.const f64x2 0 1))) |
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.
Good catch, I will fix it.
test/core/simd/meta/simd_f64x2.py
Outdated
| ] | ||
|
|
||
| # Assert data | ||
| lst_oprt_with_const_assert = {} |
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 means 'list of operator'. A data list specific for "const vs const" and "param vs const" tests. I will add more annotate here.
| 'max-abs': [ | ||
| ['-1.125'] * 2, ['0.125'] * 2, ['1.125'] * 2 | ||
| ] | ||
| } |
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.
These structures inherit from simd_arithmetic.py, specific for combination tests. Here should have annotate to explain this.
No description provided.