This repository was archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
[interpreter] Implement i16x8.qmulr_sat_s #463
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
'simd_load_lane', | ||
'simd_ext_mul', | ||
'simd_int_to_int_widen', | ||
'simd_i16x8_q15mulr_sat_s', | ||
) | ||
|
||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from simd_arithmetic import SimdArithmeticCase | ||
|
||
|
||
"""Generate test cases for i16x8.mulr_sat_s | ||
""" | ||
class SimdI16x8Q15MulRSatS(SimdArithmeticCase): | ||
LANE_TYPE = 'i16x8' | ||
UNARY_OPS = () | ||
BINARY_OPS = ('q15mulr_sat_s',) | ||
|
||
@property | ||
def full_bin_test_data(self): | ||
return [] | ||
|
||
@property | ||
def hex_binary_op_test_data(self): | ||
return [] | ||
|
||
def get_combine_cases(self): | ||
return '' | ||
|
||
def gen_test_cases(self): | ||
wast_filename = '../simd_i16x8_q15mulr_sat_s.wast' | ||
with open(wast_filename, 'w') as fp: | ||
fp.write(self.get_all_cases()) | ||
|
||
|
||
def gen_test_cases(): | ||
simd_i16x8_q16mulr_sat_s = SimdI16x8Q15MulRSatS() | ||
simd_i16x8_q16mulr_sat_s.gen_test_cases() | ||
|
||
|
||
if __name__ == '__main__': | ||
gen_test_cases() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
;; Tests for i16x8 arithmetic operations on major boundary values and all special values. | ||
|
||
|
||
(module | ||
(func (export "i16x8.q15mulr_sat_s") (param v128 v128) (result v128) (i16x8.q15mulr_sat_s (local.get 0) (local.get 1))) | ||
) | ||
|
||
|
||
;; i16x8.q15mulr_sat_s | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 0 0 0 0 0 0 0 0) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 0 0 0 0 0 0 0 0) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 1 1 1 1 1 1 1 1) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 0 0 0 0 0 0 0 0) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 1 1 1 1 1 1 1 1) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 16383 16383 16383 16383 16383 16383 16383 16383) | ||
(v128.const i16x8 16384 16384 16384 16384 16384 16384 16384 16384)) | ||
(v128.const i16x8 8192 8192 8192 8192 8192 8192 8192 8192)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 16384 16384 16384 16384 16384 16384 16384 16384) | ||
(v128.const i16x8 16384 16384 16384 16384 16384 16384 16384 16384)) | ||
(v128.const i16x8 8192 8192 8192 8192 8192 8192 8192 8192)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -16383 -16383 -16383 -16383 -16383 -16383 -16383 -16383) | ||
(v128.const i16x8 -16384 -16384 -16384 -16384 -16384 -16384 -16384 -16384)) | ||
(v128.const i16x8 8192 8192 8192 8192 8192 8192 8192 8192)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -16384 -16384 -16384 -16384 -16384 -16384 -16384 -16384) | ||
(v128.const i16x8 -16384 -16384 -16384 -16384 -16384 -16384 -16384 -16384)) | ||
(v128.const i16x8 8192 8192 8192 8192 8192 8192 8192 8192)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -16385 -16385 -16385 -16385 -16385 -16385 -16385 -16385) | ||
(v128.const i16x8 -16384 -16384 -16384 -16384 -16384 -16384 -16384 -16384)) | ||
(v128.const i16x8 8193 8193 8193 8193 8193 8193 8193 8193)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 32765 32765 32765 32765 32765 32765 32765 32765) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 32766 32766 32766 32766 32766 32766 32766 32766) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 32768 32768 32768 32768 32768 32768 32768 32768) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -32766 -32766 -32766 -32766 -32766 -32766 -32766 -32766) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -32767 -32767 -32767 -32767 -32767 -32767 -32767 -32767) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 32767 32767 32767 32767 32767 32767 32767 32767) | ||
(v128.const i16x8 32767 32767 32767 32767 32767 32767 32767 32767)) | ||
(v128.const i16x8 32766 32766 32766 32766 32766 32766 32766 32766)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768) | ||
(v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768)) | ||
(v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768) | ||
(v128.const i16x8 -32767 -32767 -32767 -32767 -32767 -32767 -32767 -32767)) | ||
(v128.const i16x8 32767 32767 32767 32767 32767 32767 32767 32767)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 32767 32767 32767 32767 32767 32767 32767 32767)) | ||
(v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 -32768 -32768 -32768 -32768 -32768 -32768 -32768 -32768)) | ||
(v128.const i16x8 1 1 1 1 1 1 1 1)) | ||
(assert_return (invoke "i16x8.q15mulr_sat_s" (v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535) | ||
(v128.const i16x8 65535 65535 65535 65535 65535 65535 65535 65535)) | ||
(v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
|
||
;; type check | ||
(assert_invalid (module (func (result v128) (i16x8.q15mulr_sat_s (i32.const 0) (f32.const 0.0)))) "type mismatch") | ||
|
||
;; Test operation with empty argument | ||
|
||
(assert_invalid | ||
(module | ||
(func $i16x8.q15mulr_sat_s-1st-arg-empty (result v128) | ||
(i16x8.q15mulr_sat_s (v128.const i16x8 0 0 0 0 0 0 0 0)) | ||
) | ||
) | ||
"type mismatch" | ||
) | ||
(assert_invalid | ||
(module | ||
(func $i16x8.q15mulr_sat_s-arg-empty (result v128) | ||
(i16x8.q15mulr_sat_s) | ||
) | ||
) | ||
"type mismatch" | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.