From bc0e8f592aee05599d7343640b5fff0684327d73 Mon Sep 17 00:00:00 2001 From: Wanming Lin Date: Thu, 12 Dec 2019 03:12:50 +0800 Subject: [PATCH] [test] Add more literal tests for rest ops (#155) This PR covers tests for some float literal introduced in https://github.com/WebAssembly/spec/pull/1069, specific for following ops: Bit shifts Bitwise operations Boolean horizontal reductions Conversions Integer comparisons Store These tests are pulled from https://github.com/WAVM/WAVM/pull/236/ --- test/core/simd/meta/simd_bitwise.py | 14 +++++ test/core/simd/meta/simd_i16x8_cmp.py | 22 ++++++- test/core/simd/meta/simd_i32x4_cmp.py | 32 +++++++++- test/core/simd/simd_bit_shift.wast | 62 +++++++++++++++++++ test/core/simd/simd_bitwise.wast | 38 +++++++++++- test/core/simd/simd_boolean.wast | 18 +++++- test/core/simd/simd_conversions.wast | 85 +++++++++++++++++++++++---- test/core/simd/simd_i16x8_cmp.wast | 61 ++++++++++++++++++- test/core/simd/simd_i32x4_cmp.wast | 61 ++++++++++++++++++- test/core/simd/simd_store.wast | 23 +++++++- 10 files changed, 395 insertions(+), 21 deletions(-) diff --git a/test/core/simd/meta/simd_bitwise.py b/test/core/simd/meta/simd_bitwise.py index 864e197cd..5e8eb33a9 100644 --- a/test/core/simd/meta/simd_bitwise.py +++ b/test/core/simd/meta/simd_bitwise.py @@ -269,6 +269,8 @@ def get_case_data(self): ["not", [['0', '-1', '0', '-1']], [['-1', '0', '-1', '0']], ['i32x4', 'i32x4']], ["not", ['0x55555555'], ['0xAAAAAAAA'], ['i32x4', 'i32x4']], ["not", ['3435973836'], ['858993459'], ['i32x4', 'i32x4']], + ['not', ['01_234_567_890'], ['3060399405'], ['i32x4', 'i32x4']], + ['not', ['0x0_1234_5678'], ['0xedcba987'], ['i32x4', 'i32x4']], ["and", [['0', '-1'], ['0', '-1', '0', '-1']], [['0', '0', '0', '-1']], ['i32x4', 'i32x4', 'i32x4']], ["and", ['0', '0'], ['0'], ['i32x4', 'i32x4', 'i32x4']], ["and", ['0', '-1'], ['0'], ['i32x4', 'i32x4', 'i32x4']], @@ -283,6 +285,8 @@ def get_case_data(self): ["and", ['0xFFFFFFFF', '0x0'], ['0x0'], ['i32x4', 'i32x4', 'i32x4']], ["and", ['0x55555555', ['0x5555', '0xFFFF', '0x55FF', '0x5FFF']], ['0x5555'], ['i32x4', 'i32x4', 'i32x4']], + ['and', ['01_234_567_890', '01_234_567_890'], ['1234567890'], ['i32x4', 'i32x4', 'i32x4']], + ['and', ['0x0_1234_5678', '0x0_90AB_cdef'], ['0x10204468'], ['i32x4', 'i32x4', 'i32x4']], ["or", [['0', '0', '-1', '-1'], ['0', '-1', '0', '-1']], [['0', '-1', '-1', '-1']], ['i32x4', 'i32x4', 'i32x4']], ["or", ['0', '0'], ['0'], ['i32x4', 'i32x4', 'i32x4']], @@ -299,6 +303,8 @@ def get_case_data(self): ["or", ['0x55555555', ['0x5555', '0xFFFF', '0x55FF', '0x5FFF']], [['0x55555555', '0x5555ffff', '0x555555ff', '0x55555fff']], ['i32x4', 'i32x4', 'i32x4']], + ['or', ['01_234_567_890', '01_234_567_890'], ['1234567890'], ['i32x4', 'i32x4', 'i32x4']], + ['or', ['0x0_1234_5678', '0x0_90AB_cdef'], ['0x92bfdfff'], ['i32x4', 'i32x4', 'i32x4']], ["xor", [['0', '0', '-1', '-1'], ['0', '-1', '0', '-1']], [['0', '-1', '-1', '0']], ['i32x4', 'i32x4', 'i32x4']], ["xor", ['0', '0'], ['0'], ['i32x4', 'i32x4', 'i32x4']], @@ -316,6 +322,8 @@ def get_case_data(self): ["xor", ['0x55555555', ['0x5555', '0xFFFF', '0x55FF', '0x5FFF']], [['0x55550000', '0x5555AAAA', '0x555500AA', '0x55550AAA']], ['i32x4', 'i32x4', 'i32x4']], + ['xor', ['01_234_567_890', '01_234_567_890'], ['0'], ['i32x4', 'i32x4', 'i32x4']], + ['xor', ['0x0_1234_5678', '0x0_90AB_cdef'], ['0x829f9b97'], ['i32x4', 'i32x4', 'i32x4']], ["bitselect", ['0xAAAAAAAA', '0xBBBBBBBB', ['0x00112345', '0xF00FFFFF', '0x10112021', '0xBBAABBAA']], [['0xBBAABABA', '0xABBAAAAA', '0xABAABBBA', '0xAABBAABB']], @@ -336,6 +344,10 @@ def get_case_data(self): ['0x55555555', '0xAAAAAAAA', '0x00000000', '0xFFFFFFFF']], [['0x00000000', '0xFFFFFFFF', '0x55555555', '0xAAAAAAAA']], ['i32x4', 'i32x4', 'i32x4', 'i32x4']], + ['bitselect', ['01_234_567_890', '03_060_399_406', '0xcdefcdef'], ['2072391874'], + ['i32x4', 'i32x4', 'i32x4', 'i32x4']], + ['bitselect', ['0x0_1234_5678', '0x0_90AB_cdef', '0xcdefcdef'], ['0x10244468'], + ['i32x4', 'i32x4', 'i32x4', 'i32x4']], ["andnot", [['0', '-1'], ['0', '-1', '0', '-1']], [['0', '0', '-1', '0']], ['i32x4', 'i32x4', 'i32x4']], ["andnot", ['0', '0'], ['0'], ['i32x4', 'i32x4', 'i32x4']], ["andnot", ['0', '-1'], ['0'], ['i32x4', 'i32x4', 'i32x4']], @@ -350,6 +362,8 @@ def get_case_data(self): ["andnot", ['0xFFFFFFFF', '0x0'], ['0xFFFFFFFF'], ['i32x4', 'i32x4', 'i32x4']], ["andnot", ['0x55555555', ['0x5555', '0xFFFF', '0x55FF', '0x5FFF']], ['0x55550000'], ['i32x4', 'i32x4', 'i32x4']], + ['andnot', ['01_234_567_890', '01_234_567_890'], ['0'], ['i32x4', 'i32x4', 'i32x4']], + ['andnot', ['0x0_1234_5678', '0x0_90AB_cdef'], ['0x02141210'], ['i32x4', 'i32x4', 'i32x4']], ['#', 'for float special data [e.g. -nan nan -inf inf]'], ["not", ['-nan'], ['5.87747e-39'], ['f32x4', 'f32x4']], diff --git a/test/core/simd/meta/simd_i16x8_cmp.py b/test/core/simd/meta/simd_i16x8_cmp.py index d4f55abea..836cd88c7 100644 --- a/test/core/simd/meta/simd_i16x8_cmp.py +++ b/test/core/simd/meta/simd_i16x8_cmp.py @@ -97,6 +97,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['eq', [['65535', '0', '1', '32768'], ['65535', '0', '1', '32768']], ['-1', '0', '-1', '-1', '-1', '0', '-1', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['eq', ['0x5555', '0xAAAAAAAA'], '0', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['eq', ['012_345', '12345'], '-1', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['eq', ['0x0_1234', '0x1234'], '-1', ['i16x8', 'i16x8', 'i16x8']]) # ne # i16x8.ne (i16x8) (i16x8) @@ -176,6 +178,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '0', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ne', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '-1', '0', '0', '0', '-1', '0', '-1'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ne', ['0x5555', '0xAAAAAAAA'], '-1', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['ne', ['012_345', '12345'], '0', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['ne', ['0x0_1234', '0x1234'], '0', ['i16x8', 'i16x8', 'i16x8']]) # lt_s # i16x8.lt_s (i16x8) (i16x8) @@ -245,6 +249,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '0', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['lt_s', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '-1', '0', '0', '0', '0', '0', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['lt_s', ['0x5555', '0xAAAAAAAA'], '0', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['lt_s', ['012_345', '12345'], '0', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['lt_s', ['0x0_1234', '0x1234'], '0', ['i16x8', 'i16x8', 'i16x8']]) # lt_u # i16x8.lt_u (i16x8) (i16x8) @@ -324,6 +330,8 @@ def get_case_data(self): case_data.append(['lt_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '-1', '0', '0', '0', '0', '0', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['lt_u', ['0x5555', '0xAAAAAAAA'], '-1', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['lt_u', ['012_345', '12345'], '0', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['lt_u', ['0x0_1234', '0x1234'], '0', ['i16x8', 'i16x8', 'i16x8']]) # le_s # i16x8.le_s (i16x8) (i16x8) @@ -403,6 +411,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['le_s', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['-1', '-1', '-1', '-1', '-1', '0', '-1', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['le_s', ['0x5555', '0xAAAAAAAA'], '0', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['le_s', ['012_345', '12345'], '-1', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['le_s', ['0x0_1234', '0x1234'], '-1', ['i16x8', 'i16x8', 'i16x8']]) # le_u # i16x8.le_u (i16x8) (i16x8) @@ -480,6 +490,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['le_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['-1', '-1', '-1', '-1', '-1', '0', '-1', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['le_u', ['0x5555', '0xAAAAAAAA'], '-1', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['le_u', ['012_345', '12345'], '-1', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['le_u', ['0x0_edcb', '-0x1234'], '-1', ['i16x8', 'i16x8', 'i16x8']]) # gt_s # i16x8.gt_s (i16x8) (i16x8) @@ -557,6 +569,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '0', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['gt_s', [['65535', '0', '1', '32768'], ['65535', '0', '1', '32768']], ['0', '0', '0', '0', '0', '-1', '0', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['gt_s', ['0x5555', '0xAAAAAAAA'], '-1', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['gt_s', ['012_345', '12345'], '0', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['gt_s', ['0x0_1234', '0x1234'], '0', ['i16x8', 'i16x8', 'i16x8']]) # gt_u # i16x8.gt_u (i16x8) (i16x8) @@ -635,6 +649,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '0', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['gt_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '0', '0', '0', '0', '-1', '0', '-1'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['gt_u', ['0x5555', '0xAAAAAAAA'], '0', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['gt_u', ['012_345', '12345'], '0', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['gt_u', ['0x0_1234', '0x1234'], '0', ['i16x8', 'i16x8', 'i16x8']]) # ge_s # i16x8.ge_s (i16x8) (i16x8) @@ -712,6 +728,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ge_s', [['65535', '0', '1', '32768'], ['65535', '0', '1', '32768']], ['-1', '0', '-1', '-1', '-1', '-1', '-1', '0'], ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ge_s', ['0x5555', '0xAAAAAAAA'], '-1', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['ge_s', ['012_345', '12345'], '-1', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['ge_s', ['0x0_1234', '0x1234'], '-1', ['i16x8', 'i16x8', 'i16x8']]) # ge_u # i16x8.ge_u (i16x8) (i16x8) @@ -789,6 +807,8 @@ def get_case_data(self): ['2206368128', '16776957', '2130837760', '4294901120']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ge_u', [['65535', '0', '1', '32768'], ['-128', '0', '1', '255']], '-1', ['i16x8', 'i32x4', 'i16x8']]) case_data.append(['ge_u', ['0x5555', '0xAAAAAAAA'], '0', ['i16x8', 'i32x4', 'i16x8']]) + case_data.append(['ge_u', ['012_345', '12345'], '-1', ['i16x8', 'i16x8', 'i16x8']]) + case_data.append(['ge_u', ['0x0_1234', '0x1234'], '-1', ['i16x8', 'i16x8', 'i16x8']]) return case_data @@ -800,4 +820,4 @@ def gen_test_cases(): if __name__ == '__main__': i16x8 = Simdi16x8CmpCase() - i16x8.gen_test_cases() + i16x8.gen_test_cases() \ No newline at end of file diff --git a/test/core/simd/meta/simd_i32x4_cmp.py b/test/core/simd/meta/simd_i32x4_cmp.py index 09b789e56..c6c70a9d9 100644 --- a/test/core/simd/meta/simd_i32x4_cmp.py +++ b/test/core/simd/meta/simd_i32x4_cmp.py @@ -93,6 +93,9 @@ def get_case_data(self): case_data.append(['eq', [['4294967295', '0', '1', '65535'], ['65535', '65535', '0', '0', '1', '0', '65535', '65535']], ['-1', '-1', '-1', '0'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['eq', ['0x55555555', '0xAAAA'], '0', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['eq', ['0_123_456_789', '123456789'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['eq', ['0x0_1234_5678', '0x12345678'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # ne # i32x4.ne (i32x4) (i32x4) case_data.append(['#', 'ne']) @@ -169,6 +172,9 @@ def get_case_data(self): case_data.append(['ne', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['-1', '0', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['ne', ['0xAAAAAAAA', '0x5555'], ['-1', '-1', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['ne', ['0_123_456_789', '123456789'], '0', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['ne', ['0x0_1234_5678', '0x12345678'], '0', ['i32x4', 'i32x4', 'i32x4']]) + # lt_s # i32x4.lt_s (i32x4) (i32x4) case_data.append(['#', 'lt_s']) @@ -246,6 +252,9 @@ def get_case_data(self): case_data.append(['lt_s', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '0', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['lt_s', ['0xAAAAAAAA', '0x5555'], '-1', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['lt_s', ['0_123_456_789', '123456789'], '0', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['lt_s', ['0x0_90AB_cdef', '-0x6f543210'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # lt_u # i32x4.lt_u (i32x4) (i32x4) case_data.append(['#', 'lt_u']) @@ -320,6 +329,9 @@ def get_case_data(self): case_data.append(['lt_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '0', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['lt_u', ['0xAAAAAAAA', '0x5555'], '0', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['lt_u', ['0_123_456_789', '123456789'], '0', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['lt_u', ['0x0_90AB_cdef', '-0x6f543210'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # le_s # i32x4.le_s (i32x4) (i32x4) case_data.append(['#', 'le_s']) @@ -396,6 +408,9 @@ def get_case_data(self): case_data.append(['le_s', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '-1', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['le_s', ['0xAAAAAAAA', '0x5555'], '-1', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['le_s', ['0_123_456_789', '123456789'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['le_s', ['0x0_1234_5678', '0x12345678'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # le_u # i32x4.le_u (i32x4) (i32x4) case_data.append(['#', 'le_u']) @@ -471,6 +486,9 @@ def get_case_data(self): case_data.append(['le_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['0', '-1', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['le_u', ['0xAAAAAAAA', '0x5555'], '0', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['le_u', ['0_123_456_789', '123456789'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['le_u', ['0x0_90AB_cdef', '0x90ABcdef'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # gt_s # i32x4.gt_s (i32x4) (i32x4) case_data.append(['#', 'gt_s']) @@ -546,6 +564,9 @@ def get_case_data(self): case_data.append(['gt_s', [['65535', '0', '1', '32768'], ['65535', '65535', '0', '0', '1', '1', '32768', '32768']], ['-1', '0', '0', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['gt_s', ['0xAAAAAAAA', '0x5555'], '0', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['gt_s', ['0_123_456_789', '123456789'], '0', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['gt_s', ['0x0_90AB_cdef', '-0x6f543211'], '0', ['i32x4', 'i32x4', 'i32x4']]) + # gt_u # i32x4.gt_u (i32x4) (i32x4) case_data.append(['#', 'gt_u']) @@ -621,6 +642,9 @@ def get_case_data(self): case_data.append(['gt_u', [['-128', '0', '1', '255'], ['-128', '0', '1', '255']], ['-1', '0', '0', '0'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['gt_u', ['0xAAAAAAAA', '0x5555'], '-1', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['gt_u', ['0_123_456_789', '123456789'], '0', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['gt_u', ['0x0_1234_5678', '0x12345678'], '0', ['i32x4', 'i32x4', 'i32x4']]) + # ge_s # i32x4.ge_s (i32x4) (i32x4) case_data.append(['#', 'ge_s']) @@ -696,6 +720,9 @@ def get_case_data(self): case_data.append(['ge_s', [['65535', '0', '1', '32768'], ['65535', '65535', '0', '0', '1', '1', '32768', '32768']], ['-1', '-1', '0', '-1'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['ge_s', ['0xAAAAAAAA', '0x5555'], '0', ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['ge_s', ['0_123_456_789', '123456789'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['ge_s', ['0x0_1234_5678', '0x12345678'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + # ge_u # i32x4.ge_u (i32x4) (i32x4) case_data.append(['#', 'ge_u']) @@ -772,6 +799,9 @@ def get_case_data(self): case_data.append(['ge_u', [['-128', '0', '1', '255'], ['65535', '65535', '0', '0', '1', '1', '32768', '32768']], ['0', '-1', '0', '0'], ['i32x4', 'i16x8', 'i32x4']]) case_data.append(['ge_u', ['0xAAAAAAAA', '0x5555'], ['-1', '-1', '-1', '-1'], ['i32x4', 'i16x8', 'i32x4']]) + case_data.append(['ge_u', ['0_123_456_789', '123456789'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + case_data.append(['ge_u', ['0x0_1234_5678', '0x12345678'], '-1', ['i32x4', 'i32x4', 'i32x4']]) + return case_data # generate all test cases @@ -802,4 +832,4 @@ def gen_test_cases(): if __name__ == '__main__': i32x4 = Simdi32x4CmpCase() - i32x4.gen_test_cases() + i32x4.gen_test_cases() \ No newline at end of file diff --git a/test/core/simd/simd_bit_shift.wast b/test/core/simd/simd_bit_shift.wast index 95b8140e4..a49b8032e 100644 --- a/test/core/simd/simd_bit_shift.wast +++ b/test/core/simd/simd_bit_shift.wast @@ -190,6 +190,12 @@ (assert_return (invoke "i16x8.shl" (v128.const i16x8 -128 -64 0 1 2 3 4 5) (i32.const 1)) (v128.const i16x8 65280 65408 0 2 4 6 8 10)) +(assert_return (invoke "i16x8.shl" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (i32.const 2)) + (v128.const i16x8 49380 49380 49380 49380 49380 49380 49380 49380)) +(assert_return (invoke "i16x8.shl" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (i32.const 2)) + (v128.const i16x8 0x48d0 0x48d0 0x48d0 0x48d0 0x48d0 0x48d0 0x48d0 0x48d0)) (assert_return (invoke "i16x8.shl" (v128.const i16x8 0xAABB 0xCCDD 0xEEFF 0xA0B0 0xC0D0 0xE0F0 0x0A0B 0x0C0D) (i32.const 4)) (v128.const i16x8 0xABB0 0xCDD0 0xEFF0 0xB00 0xD00 0xF00 0xA0B0 0xC0D0)) @@ -228,11 +234,18 @@ (assert_return (invoke "i16x8.shl" (v128.const i16x8 0 1 2 3 4 5 6 7) (i32.const 514)) (v128.const i16x8 0 4 8 12 16 20 24 28)) + ;; i16x8 shr_u ;; amount less than lane width (assert_return (invoke "i16x8.shr_u" (v128.const i16x8 -128 -64 0 1 2 3 4 5) (i32.const 1)) (v128.const i16x8 32704 32736 0 0 1 1 2 2)) +(assert_return (invoke "i16x8.shr_u" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (i32.const 2)) + (v128.const i16x8 3086 3086 3086 3086 3086 3086 3086 3086)) +(assert_return (invoke "i16x8.shr_u" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB) + (i32.const 2)) + (v128.const i16x8 0x242a 0x242a 0x242a 0x242a 0x242a 0x242a 0x242a 0x242a)) (assert_return (invoke "i16x8.shr_u" (v128.const i16x8 0xAABB 0xCCDD 0xEEFF 0xA0B0 0xC0D0 0xE0F0 0x0A0B 0x0C0D) (i32.const 4)) (v128.const i16x8 0xAAB 0xCCD 0xEEF 0xA0B 0xC0D 0xE0F 0x0A0 0x0C0)) @@ -271,11 +284,18 @@ (assert_return (invoke "i16x8.shr_u" (v128.const i16x8 0 1 2 3 4 5 6 7) (i32.const 514)) (v128.const i16x8 0 0 0 0 1 1 1 1)) + ;; i16x8 shr_s ;; amount less than lane width (assert_return (invoke "i16x8.shr_s" (v128.const i16x8 -128 -64 0 1 2 3 4 5) (i32.const 1)) (v128.const i16x8 65472 65504 0 0 1 1 2 2)) +(assert_return (invoke "i16x8.shr_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (i32.const 2)) + (v128.const i16x8 3086 3086 3086 3086 3086 3086 3086 3086)) +(assert_return (invoke "i16x8.shr_s" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB) + (i32.const 2)) + (v128.const i16x8 0xe42a 0xe42a 0xe42a 0xe42a 0xe42a 0xe42a 0xe42a 0xe42a)) (assert_return (invoke "i16x8.shr_s" (v128.const i16x8 0xAABB 0xCCDD 0xEEFF 0xA0B0 0xC0D0 0xE0F0 0x0A0B 0x0C0D) (i32.const 4)) (v128.const i16x8 0xFAAB 0xFCCD 0xFEEF 0xFA0B 0xFC0D 0xFE0F 0x00A0 0x00C0)) @@ -314,6 +334,7 @@ (assert_return (invoke "i16x8.shr_s" (v128.const i16x8 0 1 2 3 4 5 6 7) (i32.const 514)) (v128.const i16x8 0 0 0 0 1 1 1 1)) + ;; shifting by a constant amount (assert_return (invoke "i16x8.shl_1" (v128.const i16x8 0 1 2 3 4 5 6 7)) (v128.const i16x8 0 2 4 6 8 10 12 14)) @@ -327,6 +348,12 @@ (assert_return (invoke "i32x4.shl" (v128.const i32x4 -2147483648 -32768 0 0x0A0B0C0D) (i32.const 1)) (v128.const i32x4 0 4294901760 0 0x1416181A)) +(assert_return (invoke "i32x4.shl" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (i32.const 2)) + (v128.const i32x4 643304264 643304264 643304264 643304264)) +(assert_return (invoke "i32x4.shl" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (i32.const 2)) + (v128.const i32x4 0x48d159e0 0x48d159e0 0x48d159e0 0x48d159e0)) (assert_return (invoke "i32x4.shl" (v128.const i32x4 0xAABBCCDD 0xEEFFA0B0 0xC0D0E0F0 0x0A0B0C0D) (i32.const 4)) (v128.const i32x4 0xABBCCDD0 0xEFFA0B00 0x0D0E0F00 0xA0B0C0D0)) @@ -365,11 +392,18 @@ (assert_return (invoke "i32x4.shl" (v128.const i32x4 0 1 0x0E 0x0F) (i32.const 514)) (v128.const i32x4 0 4 0x38 0x3C)) + ;; i32x4 shr_u ;; amount less than lane width (assert_return (invoke "i32x4.shr_u" (v128.const i32x4 -2147483648 -32768 0x0000000C 0x0000000D) (i32.const 1)) (v128.const i32x4 1073741824 2147467264 0x00000006 0x00000006)) +(assert_return (invoke "i32x4.shr_u" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (i32.const 2)) + (v128.const i32x4 308641972 308641972 308641972 308641972)) +(assert_return (invoke "i32x4.shr_u" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (i32.const 2)) + (v128.const i32x4 0x242af37b 0x242af37b 0x242af37b 0x242af37b)) (assert_return (invoke "i32x4.shr_u" (v128.const i32x4 0xAABBCCDD 0xEEFFA0B0 0xC0D0E0F0 0x0A0B0C0D) (i32.const 4)) (v128.const i32x4 0x0AABBCCD 0x0EEFFA0B 0x0C0D0E0F 0x00A0B0C0)) @@ -408,11 +442,18 @@ (assert_return (invoke "i32x4.shr_u" (v128.const i32x4 0 1 0x0E 0x0F) (i32.const 514)) (v128.const i32x4 0 0 0x03 0x03)) + ;; i32x4 shr_s ;; amount less than lane width (assert_return (invoke "i32x4.shr_s" (v128.const i32x4 -2147483648 -32768 0x0C 0x0D) (i32.const 1)) (v128.const i32x4 3221225472 4294950912 0x06 0x06)) +(assert_return (invoke "i32x4.shr_s" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (i32.const 2)) + (v128.const i32x4 308641972 308641972 308641972 308641972)) +(assert_return (invoke "i32x4.shr_s" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (i32.const 2)) + (v128.const i32x4 0xe42af37b 0xe42af37b 0xe42af37b 0xe42af37b)) (assert_return (invoke "i32x4.shr_s" (v128.const i32x4 0xAABBCCDD 0xEEFFA0B0 0xC0D0E0F0 0x0A0B0C0D) (i32.const 4)) (v128.const i32x4 0xfaabbccd 0xFEEFFA0B 0xFC0D0E0F 0x00A0B0C0)) @@ -465,6 +506,12 @@ (assert_return (invoke "i64x2.shl" (v128.const i64x2 -9223372036854775808 -2147483648) (i32.const 1)) (v128.const i64x2 0 18446744069414584320)) +(assert_return (invoke "i64x2.shl" (v128.const i64x2 01_234_567_890_123_456_789 01_234_567_890_123_456_789) + (i32.const 2)) + (v128.const i64x2 4938271560493827156 4938271560493827156)) +(assert_return (invoke "i64x2.shl" (v128.const i64x2 0x0_1234_5678_90AB_cdef 0x0_1234_5678_90AB_cdef) + (i32.const 2)) + (v128.const i64x2 0x48d159e242af37bc 0x48d159e242af37bc)) (assert_return (invoke "i64x2.shl" (v128.const i64x2 0xAABBCCDDEEFFA0B0 0xC0D0E0F00A0B0C0D) (i32.const 4)) (v128.const i64x2 0xABBCCDDEEFFA0B00 0xD0E0F00A0B0C0D0)) @@ -500,11 +547,18 @@ (assert_return (invoke "i64x2.shl" (v128.const i64x2 1 0x0F) (i32.const 514)) (v128.const i64x2 4 0x3C)) + ;; i64x2 shr_u ;; amount less than lane width (assert_return (invoke "i64x2.shr_u" (v128.const i64x2 -9223372036854775808 -2147483648) (i32.const 1)) (v128.const i64x2 4611686018427387904 9223372035781033984)) +(assert_return (invoke "i64x2.shr_u" (v128.const i64x2 01_234_567_890_123_456_789 01_234_567_890_123_456_789) + (i32.const 2)) + (v128.const i64x2 308641972530864197 308641972530864197)) +(assert_return (invoke "i64x2.shr_u" (v128.const i64x2 0x0_90AB_cdef_8765_4321 0x0_90AB_cdef_8765_4321) + (i32.const 2)) + (v128.const i64x2 0x242af37be1d950c8 0x242af37be1d950c8)) (assert_return (invoke "i64x2.shr_u" (v128.const i64x2 0xAABBCCDDEEFFA0B0 0xC0D0E0F00A0B0C0D) (i32.const 4)) (v128.const i64x2 0xAABBCCDDEEFFA0B 0xC0D0E0F00A0B0C0)) @@ -540,11 +594,18 @@ (assert_return (invoke "i64x2.shr_u" (v128.const i64x2 0 0x0F) (i32.const 514)) (v128.const i64x2 0 0x03)) + ;; i64x2 shr_s ;; amount less than lane width (assert_return (invoke "i64x2.shr_s" (v128.const i64x2 -9223372036854775808 -2147483648) (i32.const 1)) (v128.const i64x2 13835058055282163712 18446744072635809792)) +(assert_return (invoke "i64x2.shr_s" (v128.const i64x2 01_234_567_890_123_456_789 01_234_567_890_123_456_789) + (i32.const 2)) + (v128.const i64x2 308641972530864197 308641972530864197)) +(assert_return (invoke "i64x2.shr_s" (v128.const i64x2 0x0_90AB_cdef_8765_4321 0x0_90AB_cdef_8765_4321) + (i32.const 2)) + (v128.const i64x2 0xe42af37be1d950c8 0xe42af37be1d950c8)) (assert_return (invoke "i64x2.shr_s" (v128.const i64x2 0xAABBCCDDEEFFA0B0 0xC0D0E0F00A0B0C0D) (i32.const 4)) (v128.const i64x2 0xFAABBCCDDEEFFA0B 0xFC0D0E0F00A0B0C0)) @@ -583,6 +644,7 @@ (assert_return (invoke "i64x2.shr_s" (v128.const i64x2 1 0x0F) (i32.const 514)) (v128.const i64x2 0 0x03)) + ;; shifting by a constant amount (assert_return (invoke "i64x2.shl_1" (v128.const i64x2 1 0x0F)) (v128.const i64x2 2 0x1E)) diff --git a/test/core/simd/simd_bitwise.wast b/test/core/simd/simd_bitwise.wast index 0e00b0caf..821f46aa8 100644 --- a/test/core/simd/simd_bitwise.wast +++ b/test/core/simd/simd_bitwise.wast @@ -24,6 +24,10 @@ (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (assert_return (invoke "not" (v128.const i32x4 3435973836 3435973836 3435973836 3435973836)) (v128.const i32x4 858993459 858993459 858993459 858993459)) +(assert_return (invoke "not" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i32x4 3060399405 3060399405 3060399405 3060399405)) +(assert_return (invoke "not" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (v128.const i32x4 0xedcba987 0xedcba987 0xedcba987 0xedcba987)) (assert_return (invoke "and" (v128.const i32x4 0 0 -1 -1) (v128.const i32x4 0 -1 0 -1)) (v128.const i32x4 0 0 0 -1)) @@ -60,6 +64,12 @@ (assert_return (invoke "and" (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i32x4 0x5555 0xFFFF 0x55FF 0x5FFF)) (v128.const i32x4 0x5555 0x5555 0x5555 0x5555)) +(assert_return (invoke "and" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i32x4 1234567890 1234567890 1234567890 1234567890)) +(assert_return (invoke "and" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef)) + (v128.const i32x4 0x10204468 0x10204468 0x10204468 0x10204468)) (assert_return (invoke "or" (v128.const i32x4 0 0 -1 -1) (v128.const i32x4 0 -1 0 -1)) (v128.const i32x4 0 -1 -1 -1)) @@ -96,6 +106,12 @@ (assert_return (invoke "or" (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i32x4 0x5555 0xFFFF 0x55FF 0x5FFF)) (v128.const i32x4 0x55555555 0x5555ffff 0x555555ff 0x55555fff)) +(assert_return (invoke "or" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i32x4 1234567890 1234567890 1234567890 1234567890)) +(assert_return (invoke "or" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef)) + (v128.const i32x4 0x92bfdfff 0x92bfdfff 0x92bfdfff 0x92bfdfff)) (assert_return (invoke "xor" (v128.const i32x4 0 0 -1 -1) (v128.const i32x4 0 -1 0 -1)) (v128.const i32x4 0 -1 -1 0)) @@ -132,6 +148,12 @@ (assert_return (invoke "xor" (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i32x4 0x5555 0xFFFF 0x55FF 0x5FFF)) (v128.const i32x4 0x55550000 0x5555AAAA 0x555500AA 0x55550AAA)) +(assert_return (invoke "xor" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "xor" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef)) + (v128.const i32x4 0x829f9b97 0x829f9b97 0x829f9b97 0x829f9b97)) (assert_return (invoke "bitselect" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i32x4 0xBBBBBBBB 0xBBBBBBBB 0xBBBBBBBB 0xBBBBBBBB) (v128.const i32x4 0x00112345 0xF00FFFFF 0x10112021 0xBBAABBAA)) @@ -156,6 +178,14 @@ (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i32x4 0x55555555 0xAAAAAAAA 0x00000000 0xFFFFFFFF)) (v128.const i32x4 0x00000000 0xFFFFFFFF 0x55555555 0xAAAAAAAA)) +(assert_return (invoke "bitselect" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (v128.const i32x4 03_060_399_406 03_060_399_406 03_060_399_406 03_060_399_406) + (v128.const i32x4 0xcdefcdef 0xcdefcdef 0xcdefcdef 0xcdefcdef)) + (v128.const i32x4 2072391874 2072391874 2072391874 2072391874)) +(assert_return (invoke "bitselect" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 0xcdefcdef 0xcdefcdef 0xcdefcdef 0xcdefcdef)) + (v128.const i32x4 0x10244468 0x10244468 0x10244468 0x10244468)) (assert_return (invoke "andnot" (v128.const i32x4 0 0 -1 -1) (v128.const i32x4 0 -1 0 -1)) (v128.const i32x4 0 0 -1 0)) @@ -192,6 +222,12 @@ (assert_return (invoke "andnot" (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i32x4 0x5555 0xFFFF 0x55FF 0x5FFF)) (v128.const i32x4 0x55550000 0x55550000 0x55550000 0x55550000)) +(assert_return (invoke "andnot" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "andnot" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef)) + (v128.const i32x4 0x02141210 0x02141210 0x02141210 0x02141210)) ;; for float special data [e.g. -nan nan -inf inf] (assert_return (invoke "not" (v128.const f32x4 -nan -nan -nan -nan)) @@ -673,4 +709,4 @@ (assert_return (invoke "nested-v128.xor")) (assert_return (invoke "nested-v128.bitselect")) (assert_return (invoke "nested-v128.andnot")) -(assert_return (invoke "as-param")) +(assert_return (invoke "as-param")) \ No newline at end of file diff --git a/test/core/simd/simd_boolean.wast b/test/core/simd/simd_boolean.wast index 402c0c984..7838520c5 100644 --- a/test/core/simd/simd_boolean.wast +++ b/test/core/simd/simd_boolean.wast @@ -68,6 +68,10 @@ (i32.const 1)) (assert_return (invoke "i16x8.any_true" (v128.const i16x8 0x55 0x55 0x55 0x55 0x55 0x55 0x55 0x55)) (i32.const 1)) +(assert_return (invoke "i16x8.any_true" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345)) + (i32.const 1)) +(assert_return (invoke "i16x8.any_true" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234)) + (i32.const 1)) (assert_return (invoke "i16x8.all_true" (v128.const i16x8 0 0 0 0 0 0 0 0)) (i32.const 0)) (assert_return (invoke "i16x8.all_true" (v128.const i16x8 0 0 0 0 0 0 1 0)) @@ -86,7 +90,10 @@ (i32.const 1)) (assert_return (invoke "i16x8.all_true" (v128.const i16x8 0x55 0x55 0x55 0x55 0x55 0x55 0x55 0x55)) (i32.const 1)) - +(assert_return (invoke "i16x8.all_true" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345)) + (i32.const 1)) +(assert_return (invoke "i16x8.all_true" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234)) + (i32.const 1)) ;; i32x4 (assert_return (invoke "i32x4.any_true" (v128.const i32x4 0 0 0 0)) (i32.const 0)) @@ -106,6 +113,10 @@ (i32.const 1)) (assert_return (invoke "i32x4.any_true" (v128.const i32x4 0x55 0x55 0x55 0x55)) (i32.const 1)) +(assert_return (invoke "i32x4.any_true" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (i32.const 1)) +(assert_return (invoke "i32x4.any_true" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (i32.const 1)) (assert_return (invoke "i32x4.all_true" (v128.const i32x4 0 0 0 0)) (i32.const 0)) (assert_return (invoke "i32x4.all_true" (v128.const i32x4 0 0 1 0)) @@ -124,7 +135,10 @@ (i32.const 1)) (assert_return (invoke "i32x4.all_true" (v128.const i32x4 0x55 0x55 0x55 0x55)) (i32.const 1)) - +(assert_return (invoke "i32x4.all_true" (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (i32.const 1)) +(assert_return (invoke "i32x4.all_true" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (i32.const 1)) ;; Combination diff --git a/test/core/simd/simd_conversions.wast b/test/core/simd/simd_conversions.wast index 5235d6537..b33f2ec6a 100644 --- a/test/core/simd/simd_conversions.wast +++ b/test/core/simd/simd_conversions.wast @@ -130,7 +130,10 @@ (v128.const i32x4 42 0 2147483647 -2147483648)) (assert_return (invoke "i32x4.trunc_sat_f32x4_s" (v128.const f32x4 -42 3.14 nan inf)) (v128.const i32x4 -42 3 0 2147483647)) - +(assert_return (invoke "i32x4.trunc_sat_f32x4_s" (v128.const f32x4 0123456792.0 0123456792.0 0123456792.0 0123456792.0)) + (v128.const i32x4 123456792 123456792 123456792 123456792)) +(assert_return (invoke "i32x4.trunc_sat_f32x4_s" (v128.const f32x4 01234567890.0 01234567890.0 01234567890.0 01234567890.0)) + (v128.const i32x4 0x49960300 0x49960300 0x49960300 0x49960300)) ;; i32x4.trunc_sat_f32x4_u (assert_return (invoke "i32x4.trunc_sat_f32x4_u" (v128.const f32x4 0.0 0.0 0.0 0.0)) @@ -217,7 +220,10 @@ (v128.const i32x4 42 0 0xffffffff 0)) (assert_return (invoke "i32x4.trunc_sat_f32x4_u" (v128.const f32x4 -42 3.14 nan inf)) (v128.const i32x4 0 3 0 0xffffffff)) - +(assert_return (invoke "i32x4.trunc_sat_f32x4_u" (v128.const f32x4 0123456792.0 0123456792.0 0123456792.0 0123456792.0)) + (v128.const i32x4 123456792 123456792 123456792 123456792)) +(assert_return (invoke "i32x4.trunc_sat_f32x4_u" (v128.const f32x4 -0123456789.0 -0123456789.0 -0123456789.0 -0123456789.0)) + (v128.const i32x4 0 0 0 0)) ;; i64x2.trunc_sat_f64x2_s (assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64x2 0.0 0.0)) @@ -300,7 +306,10 @@ (v128.const i64x2 3 0)) (assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64x2 -3.14 -inf)) (v128.const i64x2 -3 -0x8000000000000000)) - +(assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64x2 01234567890123456768.0 01234567890123456768.0)) + (v128.const i64x2 1234567890123456768 1234567890123456768)) +(assert_return (invoke "i64x2.trunc_sat_f64x2_s" (v128.const f64x2 01234567890123456789.0 01234567890123456789.0)) + (v128.const i64x2 0x112210f47de98100 0x112210f47de98100)) ;; i64x2.trunc_sat_f64x2_u (assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64x2 0.0 0.0)) @@ -387,6 +396,10 @@ (v128.const i64x2 3 0)) (assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64x2 -3.14 -inf)) (v128.const i64x2 0 0)) +(assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64x2 01234567890123456768.0 01234567890123456768.0)) + (v128.const i64x2 1234567890123456768 1234567890123456768)) +(assert_return (invoke "i64x2.trunc_sat_f64x2_u" (v128.const f64x2 -01234567890123456789.0 -01234567890123456789.0)) + (v128.const i64x2 0 0)) ;; Integer to floating point ;; f32x4.convert_i32x4_s @@ -403,6 +416,10 @@ (v128.const f32x4 -2147483648.0 -2147483648.0 -2147483648.0 -2147483648.0)) (assert_return (invoke "f32x4.convert_i32x4_s" (v128.const i32x4 1234567890 1234567890 1234567890 1234567890)) (v128.const f32x4 0x1.26580cp+30 0x1.26580cp+30 0x1.26580cp+30 0x1.26580cp+30)) +(assert_return (invoke "f32x4.convert_i32x4_s" (v128.const i32x4 0_123_456_792 0_123_456_792 0_123_456_792 0_123_456_792)) + (v128.const f32x4 123456792.0 123456792.0 123456792.0 123456792.0)) +(assert_return (invoke "f32x4.convert_i32x4_s" (v128.const i32x4 0x0_1234_5680 0x0_1234_5680 0x0_1234_5680 0x0_1234_5680)) + (v128.const f32x4 305419904.0 305419904.0 305419904.0 305419904.0)) ;; Test rounding directions. (assert_return (invoke "f32x4.convert_i32x4_s" (v128.const i32x4 16777217 16777217 16777217 16777217)) @@ -440,7 +457,10 @@ (v128.const f64x2 -9007199254740996.0 -9007199254740996.0)) (assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64x2 0x7fffffffffffffff 0x8000000000000000)) (v128.const f64x2 9223372036854775807.0 -9223372036854775808.0)) - +(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64x2 01_234_567_890_123_456_789 01_234_567_890_123_456_789)) + (v128.const f64x2 1.2345678901234568e+18 1.2345678901234568e+18)) +(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64x2 0x0_1234_5678_90AB_cdef 0x0_1234_5678_90AB_cdef)) + (v128.const f64x2 1.3117684672948997e+18 1.3117684672948997e+18)) ;; f32x4.convert_i32x4_u (assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32x4 0 0 0 0)) @@ -467,6 +487,10 @@ (v128.const f32x4 0x1.fffffep+31 0x1.fffffep+31 0x1.fffffep+31 0x1.fffffep+31)) (assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32x4 0xfffffe82 0xfffffe82 0xfffffe82 0xfffffe82)) (v128.const f32x4 0x1.fffffep+31 0x1.fffffep+31 0x1.fffffep+31 0x1.fffffep+31)) +(assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32x4 0_123_456_792 0_123_456_792 0_123_456_792 0_123_456_792)) + (v128.const f32x4 123456792.0 123456792.0 123456792.0 123456792.0)) +(assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef)) + (v128.const f32x4 2427178496.0 2427178496.0 2427178496.0 2427178496.0)) ;; Test rounding directions. (assert_return (invoke "f32x4.convert_i32x4_u" (v128.const i32x4 16777217 16777217 16777217 16777217)) @@ -508,7 +532,10 @@ (v128.const f64x2 9007199254740996.0 9007199254740996.0)) (assert_return (invoke "f64x2.convert_i64x2_u" (v128.const i64x2 0x7fffffffffffffff 0x8000000000000000)) (v128.const f64x2 9223372036854775807.0 9223372036854775808.0)) - +(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64x2 01_234_567_890_123_456_789 01_234_567_890_123_456_789)) + (v128.const f64x2 1.2345678901234568e+18 1.2345678901234568e+18)) +(assert_return (invoke "f64x2.convert_i64x2_s" (v128.const i64x2 0x0_fedc_BA09_8765_4321 0x0_fedc_BA09_8765_4321)) + (v128.const f64x2 -8.198614311047907e+16 -8.198614311047907e+16)) ;; Integer to integer narrowing ;; i8x16.narrow_i16x8_s @@ -593,7 +620,12 @@ (assert_return (invoke "i8x16.narrow_i16x8_s" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000) (v128.const i16x8 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff)) (v128.const i8x16 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff)) - +(assert_return (invoke "i8x16.narrow_i16x8_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789)) + (v128.const i8x16 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80)) +(assert_return (invoke "i8x16.narrow_i16x8_s" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x0_5678 0x0_5678 0x0_5678 0x0_5678 0x0_5678 0x0_5678 0x0_5678 0x0_5678)) + (v128.const i8x16 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f 0x7f)) ;; i8x16.narrow_i16x8_u (assert_return (invoke "i8x16.narrow_i16x8_u" (v128.const i16x8 0 0 0 0 0 0 0 0) @@ -668,7 +700,12 @@ (assert_return (invoke "i8x16.narrow_i16x8_u" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000 -0x8000) (v128.const i16x8 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff)) (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)) - +(assert_return (invoke "i8x16.narrow_i16x8_u" (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789) + (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345)) + (v128.const i8x16 0 0 0 0 0 0 0 0 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff)) +(assert_return (invoke "i8x16.narrow_i16x8_u" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB) + (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234)) + (v128.const i8x16 0 0 0 0 0 0 0 0 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff)) ;; i16x8.narrow_i32x4_s (assert_return (invoke "i16x8.narrow_i32x4_s" (v128.const i32x4 0 0 0 0) @@ -752,7 +789,12 @@ (assert_return (invoke "i16x8.narrow_i32x4_s" (v128.const i32x4 -0x8000000 -0x8000000 -0x8000000 -0x8000000) (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)) (v128.const i16x8 0x8000 0x8000 0x8000 0x8000 0xffff 0xffff 0xffff 0xffff)) - +(assert_return (invoke "i16x8.narrow_i32x4_s" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i16x8 0x7fff 0x7fff 0x7fff 0x7fff 0x7fff 0x7fff 0x7fff 0x7fff)) +(assert_return (invoke "i16x8.narrow_i32x4_s" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (v128.const i16x8 0x8000 0x8000 0x8000 0x8000 0x7fff 0x7fff 0x7fff 0x7fff)) ;; i16x8.narrow_i32x4_u (assert_return (invoke "i16x8.narrow_i32x4_u" (v128.const i32x4 0 0 0 0) @@ -809,7 +851,12 @@ (assert_return (invoke "i16x8.narrow_i32x4_u" (v128.const i32x4 -0x80000000 -0x80000000 -0x80000000 -0x80000000) (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)) (v128.const i16x8 0 0 0 0 0 0 0 0)) - +(assert_return (invoke "i16x8.narrow_i32x4_u" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 01_234_567_890 01_234_567_890 01_234_567_890 01_234_567_890)) + (v128.const i16x8 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff 0xffff)) +(assert_return (invoke "i16x8.narrow_i32x4_u" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (v128.const i16x8 0 0 0 0 0xffff 0xffff 0xffff 0xffff)) ;; Integer to integer widening ;; i16x8.widen_low_i8x16_s @@ -1036,7 +1083,10 @@ (v128.const i32x4 0xffff8000 0xffff8000 0xffff8000 0xffff8000)) (assert_return (invoke "i32x4.widen_low_i16x8_s" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 0xffff 0xffff 0xffff 0xffff)) (v128.const i32x4 0xffff8000 0xffff8000 0xffff8000 0xffff8000)) - +(assert_return (invoke "i32x4.widen_low_i16x8_s" (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789)) + (v128.const i32x4 0xffffddd5 0xffffddd5 0xffffddd5 0xffffddd5)) +(assert_return (invoke "i32x4.widen_low_i16x8_s" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB)) + (v128.const i32x4 0xffff90ab 0xffff90ab 0xffff90ab 0xffff90ab)) ;; i32x4.widen_high_i16x8_s (assert_return (invoke "i32x4.widen_high_i16x8_s" (v128.const i16x8 0 0 0 0 0 0 0 0)) @@ -1081,7 +1131,10 @@ (v128.const i32x4 0xffff8000 0xffff8000 0xffff8000 0xffff8000)) (assert_return (invoke "i32x4.widen_high_i16x8_s" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 0xffff 0xffff 0xffff 0xffff)) (v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff)) - +(assert_return (invoke "i32x4.widen_high_i16x8_s" (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789)) + (v128.const i32x4 0xffffddd5 0xffffddd5 0xffffddd5 0xffffddd5)) +(assert_return (invoke "i32x4.widen_high_i16x8_s" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB)) + (v128.const i32x4 0xffff90ab 0xffff90ab 0xffff90ab 0xffff90ab)) ;; i32x4.widen_low_i16x8_u (assert_return (invoke "i32x4.widen_low_i16x8_u" (v128.const i16x8 0 0 0 0 0 0 0 0)) @@ -1126,7 +1179,10 @@ (v128.const i32x4 0x8000 0x8000 0x8000 0x8000)) (assert_return (invoke "i32x4.widen_low_i16x8_u" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 0xffff 0xffff 0xffff 0xffff)) (v128.const i32x4 0x8000 0x8000 0x8000 0x8000)) - +(assert_return (invoke "i32x4.widen_low_i16x8_u" (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789)) + (v128.const i32x4 0x0000ddd5 0x0000ddd5 0x0000ddd5 0x0000ddd5)) +(assert_return (invoke "i32x4.widen_low_i16x8_u" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB)) + (v128.const i32x4 0x000090ab 0x000090ab 0x000090ab 0x000090ab)) ;; i32x4.widen_high_i16x8_u (assert_return (invoke "i32x4.widen_high_i16x8_u" (v128.const i16x8 0 0 0 0 0 0 0 0)) @@ -1171,7 +1227,10 @@ (v128.const i32x4 0x8000 0x8000 0x8000 0x8000)) (assert_return (invoke "i32x4.widen_high_i16x8_u" (v128.const i16x8 -0x8000 -0x8000 -0x8000 -0x8000 0xffff 0xffff 0xffff 0xffff)) (v128.const i32x4 0xffff 0xffff 0xffff 0xffff)) - +(assert_return (invoke "i32x4.widen_high_i16x8_u" (v128.const i16x8 056_789 056_789 056_789 056_789 056_789 056_789 056_789 056_789)) + (v128.const i32x4 0x0000ddd5 0x0000ddd5 0x0000ddd5 0x0000ddd5)) +(assert_return (invoke "i32x4.widen_high_i16x8_u" (v128.const i16x8 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB 0x0_90AB)) + (v128.const i32x4 0x000090ab 0x000090ab 0x000090ab 0x000090ab)) ;; Unknown operator diff --git a/test/core/simd/simd_i16x8_cmp.wast b/test/core/simd/simd_i16x8_cmp.wast index b3e24e2e6..9c3bbdc5a 100644 --- a/test/core/simd/simd_i16x8_cmp.wast +++ b/test/core/simd/simd_i16x8_cmp.wast @@ -152,6 +152,12 @@ (assert_return (invoke "eq" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "eq" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "eq" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) ;; ne @@ -290,6 +296,12 @@ (assert_return (invoke "ne" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "ne" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "ne" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) ;; lt_s @@ -422,6 +434,12 @@ (assert_return (invoke "lt_s" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "lt_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "lt_s" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) ;; lt_u @@ -560,6 +578,12 @@ (assert_return (invoke "lt_u" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "lt_u" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "lt_u" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) ;; le_s @@ -698,6 +722,12 @@ (assert_return (invoke "le_s" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "le_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "le_s" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) ;; le_u @@ -836,6 +866,12 @@ (assert_return (invoke "le_u" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "le_u" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "le_u" (v128.const i16x8 0x0_edcb 0x0_edcb 0x0_edcb 0x0_edcb 0x0_edcb 0x0_edcb 0x0_edcb 0x0_edcb) + (v128.const i16x8 -0x1234 -0x1234 -0x1234 -0x1234 -0x1234 -0x1234 -0x1234 -0x1234)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) ;; gt_s @@ -974,6 +1010,12 @@ (assert_return (invoke "gt_s" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "gt_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "gt_s" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) ;; gt_u @@ -1112,6 +1154,12 @@ (assert_return (invoke "gt_u" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "gt_u" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "gt_u" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 0 0 0 0 0 0 0 0)) ;; ge_s @@ -1250,6 +1298,12 @@ (assert_return (invoke "ge_s" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "ge_s" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "ge_s" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) ;; ge_u @@ -1388,6 +1442,12 @@ (assert_return (invoke "ge_u" (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555) (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA)) (v128.const i16x8 0 0 0 0 0 0 0 0)) +(assert_return (invoke "ge_u" (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345) + (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) +(assert_return (invoke "ge_u" (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234) + (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) + (v128.const i16x8 -1 -1 -1 -1 -1 -1 -1 -1)) ;; Type check @@ -1675,4 +1735,3 @@ (assert_return (invoke "nested-gt_u")) (assert_return (invoke "nested-ge_s")) (assert_return (invoke "as-param")) - diff --git a/test/core/simd/simd_i32x4_cmp.wast b/test/core/simd/simd_i32x4_cmp.wast index dd07ee0e5..d541c18a4 100644 --- a/test/core/simd/simd_i32x4_cmp.wast +++ b/test/core/simd/simd_i32x4_cmp.wast @@ -152,6 +152,12 @@ (assert_return (invoke "eq" (v128.const i32x4 0x55555555 0x55555555 0x55555555 0x55555555) (v128.const i16x8 0xAAAA 0xAAAA 0xAAAA 0xAAAA 0xAAAA 0xAAAA 0xAAAA 0xAAAA)) (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "eq" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "eq" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 -1 -1 -1 -1)) ;; ne @@ -290,6 +296,12 @@ (assert_return (invoke "ne" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "ne" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "ne" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 0 0 0 0)) ;; lt_s @@ -428,6 +440,12 @@ (assert_return (invoke "lt_s" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "lt_s" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "lt_s" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 -0x6f543210 -0x6f543210 -0x6f543210 -0x6f543210)) + (v128.const i32x4 -1 -1 -1 -1)) ;; lt_u @@ -566,6 +584,12 @@ (assert_return (invoke "lt_u" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "lt_u" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "lt_u" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 -0x6f543210 -0x6f543210 -0x6f543210 -0x6f543210)) + (v128.const i32x4 -1 -1 -1 -1)) ;; le_s @@ -704,6 +728,12 @@ (assert_return (invoke "le_s" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "le_s" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "le_s" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 -1 -1 -1 -1)) ;; le_u @@ -842,6 +872,12 @@ (assert_return (invoke "le_u" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "le_u" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "le_u" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 0x90ABcdef 0x90ABcdef 0x90ABcdef 0x90ABcdef)) + (v128.const i32x4 -1 -1 -1 -1)) ;; gt_s @@ -980,6 +1016,12 @@ (assert_return (invoke "gt_s" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "gt_s" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "gt_s" (v128.const i32x4 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef 0x0_90AB_cdef) + (v128.const i32x4 -0x6f543211 -0x6f543211 -0x6f543211 -0x6f543211)) + (v128.const i32x4 0 0 0 0)) ;; gt_u @@ -1118,6 +1160,12 @@ (assert_return (invoke "gt_u" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "gt_u" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "gt_u" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 0 0 0 0)) ;; ge_s @@ -1256,6 +1304,12 @@ (assert_return (invoke "ge_s" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 0 0 0 0)) +(assert_return (invoke "ge_s" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "ge_s" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 -1 -1 -1 -1)) ;; ge_u @@ -1394,6 +1448,12 @@ (assert_return (invoke "ge_u" (v128.const i32x4 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA 0xAAAAAAAA) (v128.const i16x8 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555 0x5555)) (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "ge_u" (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789) + (v128.const i32x4 123456789 123456789 123456789 123456789)) + (v128.const i32x4 -1 -1 -1 -1)) +(assert_return (invoke "ge_u" (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678) + (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) + (v128.const i32x4 -1 -1 -1 -1)) ;; Type check @@ -1695,4 +1755,3 @@ (assert_malformed (module quote "(memory 1) (func (param $x v128) (param $y v128) (result v128) (i4x32.gt_u (local.get $x) (local.get $y)))") "unknown operator") (assert_malformed (module quote "(memory 1) (func (param $x v128) (param $y v128) (result v128) (i4x32.ge_s (local.get $x) (local.get $y)))") "unknown operator") (assert_malformed (module quote "(memory 1) (func (param $x v128) (param $y v128) (result v128) (i4x32.ge_u (local.get $x) (local.get $y)))") "unknown operator") - diff --git a/test/core/simd/simd_store.wast b/test/core/simd/simd_store.wast index 0996c7015..74931e51c 100644 --- a/test/core/simd/simd_store.wast +++ b/test/core/simd/simd_store.wast @@ -10,10 +10,27 @@ (v128.store (i32.const 0) (v128.const i16x8 0 1 2 3 4 5 6 7)) (v128.load (i32.const 0)) ) + (func (export "v128.store_i16x8_2") (result v128) + (v128.store (i32.const 0) (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345)) + (v128.load (i32.const 0)) + ) + (func (export "v128.store_i16x8_3") (result v128) + (v128.store (i32.const 0) (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234)) + (v128.load (i32.const 0)) + ) (func (export "v128.store_i32x4") (result v128) (v128.store (i32.const 0) (v128.const i32x4 0 1 2 3)) (v128.load (i32.const 0)) ) + (func (export "v128.store_i32x4_2") (result v128) + (v128.store (i32.const 0) (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789)) + (v128.load (i32.const 0)) + ) + (func (export "v128.store_i32x4_3") (result v128) + (v128.store (i32.const 0) (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678)) + (v128.load (i32.const 0)) + ) + (func (export "v128.store_f32x4") (result v128) (v128.store (i32.const 0) (v128.const f32x4 0 1 2 3)) (v128.load (i32.const 0)) @@ -22,7 +39,11 @@ (assert_return (invoke "v128.store_i8x16") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) (assert_return (invoke "v128.store_i16x8") (v128.const i16x8 0 1 2 3 4 5 6 7)) +(assert_return (invoke "v128.store_i16x8_2") (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345)) +(assert_return (invoke "v128.store_i16x8_3") (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234)) (assert_return (invoke "v128.store_i32x4") (v128.const i32x4 0 1 2 3)) +(assert_return (invoke "v128.store_i32x4_2") (v128.const i32x4 123456789 123456789 123456789 123456789)) +(assert_return (invoke "v128.store_i32x4_3") (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678)) (assert_return (invoke "v128.store_f32x4") (v128.const f32x4 0 1 2 3)) @@ -114,4 +135,4 @@ (assert_invalid (module (memory 1) (func (result v128) (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)))) "type mismatch" -) +) \ No newline at end of file