diff --git a/test/core/simd/meta/simd_f32x4.py b/test/core/simd/meta/simd_f32x4.py index 974427012..30aad03c6 100644 --- a/test/core/simd/meta/simd_f32x4.py +++ b/test/core/simd/meta/simd_f32x4.py @@ -20,6 +20,11 @@ class Simdf32x4Case(Simdf32x4ArithmeticCase): '0x1.921fb6p+2', '-0x1.921fb6p+2', '0x1.fffffep+127', '-0x1.fffffep+127', 'inf', '-inf' ) + LITERAL_NUMBERS = ( + '0123456789e019', '0123456789e-019', + '0123456789.e019', '0123456789.e+019', + '-0123456789.0123456789' + ) NAN_NUMBERS = ('nan', '-nan', 'nan:0x200000', '-nan:0x200000') binary_params_template = ('({assert_type} (invoke "{func}" ', '{operand_1}', '{operand_2})', '{expected_result})') unary_param_template = ('({assert_type} (invoke "{func}" ', '{operand})', '{expected_result})') @@ -330,6 +335,11 @@ def get_normal_case(self): # assert_return_canonical_nan statements binary_test_data.append(['assert_return_canonical_nan_f32x4', op_name, p1, p2]) + for p1 in self.LITERAL_NUMBERS: + for p2 in self.LITERAL_NUMBERS: + result = self.floatOp.binary_op(op, p1, p2, hex_form=False) + binary_test_data.append(['assert_return', op_name, p1, p2, result]) + # assert_return_canonical_nan and assert_return_arithmetic_nan cases for p1 in self.NAN_NUMBERS: for p2 in self.FLOAT_NUMBERS: @@ -395,9 +405,12 @@ def get_normal_case(self): self.v128_const(case_data[3][1], case_data[1][1])], self.v128_const(case_data[3][2], case_data[2][0])))) - for p in self.FLOAT_NUMBERS: + for p in self.FLOAT_NUMBERS + self.LITERAL_NUMBERS: op_name = self.full_op_name('abs') - result = self.floatOp.unary_op('abs', p) + hex_literal = True + if p in self.LITERAL_NUMBERS: + hex_literal = False + result = self.floatOp.unary_op('abs', p, hex_form=hex_literal) # Abs operation is valid for all the floating point numbers unary_test_data.append(['assert_return', op_name, p, result]) diff --git a/test/core/simd/meta/simd_f64x2.py b/test/core/simd/meta/simd_f64x2.py index c9f129f63..4319ba3f9 100644 --- a/test/core/simd/meta/simd_f64x2.py +++ b/test/core/simd/meta/simd_f64x2.py @@ -17,7 +17,10 @@ class Simdf64x2Case(Simdf32x4Case): '0x0p+0', '-0x0p+0', '0x1p-1074', '-0x1p-1074', '0x1p-1022', '-0x1p-1022', '0x1p-1', '-0x1p-1', '0x1p+0', '-0x1p+0', '0x1.921fb54442d18p+2', '-0x1.921fb54442d18p+2', '0x1.fffffffffffffp+1023', '-0x1.fffffffffffffp+1023', 'inf', '-inf' ) - + LITERAL_NUMBERS = ('01234567890123456789e038', '01234567890123456789e-038', + '0123456789.e038', '0123456789.e+038', + '-01234567890123456789.01234567890123456789' + ) NAN_NUMBERS = ('nan', '-nan', 'nan:0x4000000000000', '-nan:0x4000000000000') def gen_test_func_template(self): @@ -28,7 +31,7 @@ def gen_test_func_template(self): # Function template tpl_func = ' (func (export "{func}"){params} (result v128) ({op} {operand_1}{operand_2}))' - # Raw data list specific for "const vs const" and "param vs const" tests + # Raw data list specific for "const vs const" and "param vs const" tests" const_test_raw_data = [ [ [['0', '1'], ['0', '2']], @@ -362,6 +365,11 @@ def get_normal_case(self): else: binary_test_data.append(['assert_return_canonical_nan_f64x2', op_name, p1, p2]) + for p1 in self.LITERAL_NUMBERS: + for p2 in self.LITERAL_NUMBERS: + result = self.floatOp.binary_op(op, p1, p2, hex_form=False) + binary_test_data.append(['assert_return', op_name, p1, p2, result]) + for case in binary_test_data: cases.append(self.single_binary_test(case)) @@ -419,9 +427,12 @@ def get_normal_case(self): self.v128_const(case_data[3][1], case_data[1][1])], self.v128_const(case_data[3][2], case_data[2][0])))) - for p in self.FLOAT_NUMBERS: + for p in self.FLOAT_NUMBERS + self.LITERAL_NUMBERS: op_name = self.full_op_name('abs') - result = self.floatOp.unary_op('abs', p) + hex_literal = True + if p in self.LITERAL_NUMBERS: + hex_literal = False + result = self.floatOp.unary_op('abs', p, hex_form=hex_literal) # Abs operation is valid for all the floating point numbers unary_test_data.append(['assert_return', op_name, p, result]) diff --git a/test/core/simd/meta/simd_float_op.py b/test/core/simd/meta/simd_float_op.py index 657d0814e..0546ce54b 100644 --- a/test/core/simd/meta/simd_float_op.py +++ b/test/core/simd/meta/simd_float_op.py @@ -137,7 +137,7 @@ def float_neg(self, p): class FloatingPointSimpleOp(FloatingPointOp): """Common simple ops for both f32x4 and f64x2: abs, min, max""" - def binary_op(self, op: str, p1: str, p2: str) -> str: + def binary_op(self, op: str, p1: str, p2: str, hex_form=True) -> str: """Binary operation on p1 and p2 with the operation specified by op :param op: min, max, @@ -145,8 +145,15 @@ def binary_op(self, op: str, p1: str, p2: str) -> str: :param p2: float number in hex :return: """ - f1 = float.fromhex(p1) - f2 = float.fromhex(p2) + if '0x' in p1: + f1 = float.fromhex(p1) + else: + f1 = float(p1) + + if '0x' in p2: + f2 = float.fromhex(p2) + else: + f2 = float(p2) if '-nan' in [p1, p2] and 'nan' in [p1, p2]: return p1 @@ -160,28 +167,38 @@ def binary_op(self, op: str, p1: str, p2: str) -> str: if op == 'min': if '-0x0p+0' in [p1, p2] and '0x0p+0' in [p1, p2]: return '-0x0p+0' - result = min(f1, f2) + if hex_form: + return min(f1, f2).hex() + else: + return p1 if f1 <= f2 else p2 elif op == 'max': if '-0x0p+0' in [p1, p2] and '0x0p+0' in [p1, p2]: return '0x0p+0' - result = max(f1, f2) + if hex_form: + return max(f1, f2).hex() + else: + return p1 if f1 > f2 else p2 else: raise Exception('Unknown binary operation: {}'.format(op)) - return result.hex() - - def unary_op(self, op: str, p1: str) -> str: + def unary_op(self, op: str, p1: str, hex_form=True) -> str: """Unnary operation on p1 with the operation specified by op :param op: abs, :param p1: float number in hex :return: """ - f1 = float.fromhex(p1) + if '0x' in p1: + f1 = float.fromhex(p1) + else: + f1 = float(p1) if op == 'abs': - return abs(f1).hex() + if hex_form: + return abs(f1).hex() + else: + return p1 if not p1.startswith('-') else p1[1:] raise Exception('Unknown unary operation: {}'.format(op)) diff --git a/test/core/simd/simd_f32x4.wast b/test/core/simd/simd_f32x4.wast index ed2500ed3..099a18912 100644 --- a/test/core/simd/simd_f32x4.wast +++ b/test/core/simd/simd_f32x4.wast @@ -991,6 +991,81 @@ (assert_return (invoke "f32x4.min" (v128.const f32x4 -inf -inf -inf -inf) (v128.const f32x4 -inf -inf -inf -inf)) (v128.const f32x4 -inf -inf -inf -inf)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) +(assert_return (invoke "f32x4.min" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) (assert_return_canonical_nan_f32x4 (invoke "f32x4.min" (v128.const f32x4 nan nan nan nan) (v128.const f32x4 0x0p+0 0x0p+0 0x0p+0 0x0p+0))) (assert_return_canonical_nan_f32x4 (invoke "f32x4.min" (v128.const f32x4 0x0p+0 0x0p+0 0x0p+0 0x0p+0) @@ -2047,6 +2122,81 @@ (assert_return (invoke "f32x4.max" (v128.const f32x4 -inf -inf -inf -inf) (v128.const f32x4 -inf -inf -inf -inf)) (v128.const f32x4 -inf -inf -inf -inf)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.max" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) (assert_return_canonical_nan_f32x4 (invoke "f32x4.max" (v128.const f32x4 nan nan nan nan) (v128.const f32x4 0x0p+0 0x0p+0 0x0p+0 0x0p+0))) (assert_return_canonical_nan_f32x4 (invoke "f32x4.max" (v128.const f32x4 0x0p+0 0x0p+0 0x0p+0 0x0p+0) @@ -2383,6 +2533,16 @@ (v128.const f32x4 inf inf inf inf)) (assert_return (invoke "f32x4.abs" (v128.const f32x4 -inf -inf -inf -inf)) (v128.const f32x4 inf inf inf inf)) +(assert_return (invoke "f32x4.abs" (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) + (v128.const f32x4 0123456789e019 0123456789e019 0123456789e019 0123456789e019)) +(assert_return (invoke "f32x4.abs" (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) + (v128.const f32x4 0123456789e-019 0123456789e-019 0123456789e-019 0123456789e-019)) +(assert_return (invoke "f32x4.abs" (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) + (v128.const f32x4 0123456789.e019 0123456789.e019 0123456789.e019 0123456789.e019)) +(assert_return (invoke "f32x4.abs" (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) + (v128.const f32x4 0123456789.e+019 0123456789.e+019 0123456789.e+019 0123456789.e+019)) +(assert_return (invoke "f32x4.abs" (v128.const f32x4 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789 -0123456789.0123456789)) + (v128.const f32x4 0123456789.0123456789 0123456789.0123456789 0123456789.0123456789 0123456789.0123456789)) ;; Unknown operators diff --git a/test/core/simd/simd_f64x2.wast b/test/core/simd/simd_f64x2.wast index 22ffa5b86..df3c3a80a 100644 --- a/test/core/simd/simd_f64x2.wast +++ b/test/core/simd/simd_f64x2.wast @@ -1281,6 +1281,81 @@ (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))) (assert_return_arithmetic_nan_f64x2 (invoke "f64x2.min" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000) (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) +(assert_return (invoke "f64x2.min" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) (assert_return (invoke "f64x2.max" (v128.const f64x2 0x0p+0 0x0p+0) (v128.const f64x2 0x0p+0 0x0p+0)) (v128.const f64x2 0x0.0p+0 0x0.0p+0)) @@ -2337,6 +2412,81 @@ (v128.const f64x2 nan:0x4000000000000 nan:0x4000000000000))) (assert_return_arithmetic_nan_f64x2 (invoke "f64x2.max" (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000) (v128.const f64x2 -nan:0x4000000000000 -nan:0x4000000000000))) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e038 0123456789.e038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 0123456789.e+038 0123456789.e+038) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.max" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) ;; Test opposite signs of zero (assert_return (invoke "f64x2.min" (v128.const f64x2 0 0) @@ -2391,6 +2541,16 @@ (v128.const f64x2 inf inf)) (assert_return (invoke "f64x2.abs" (v128.const f64x2 -inf -inf)) (v128.const f64x2 inf inf)) +(assert_return (invoke "f64x2.abs" (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) + (v128.const f64x2 01234567890123456789e038 01234567890123456789e038)) +(assert_return (invoke "f64x2.abs" (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) + (v128.const f64x2 01234567890123456789e-038 01234567890123456789e-038)) +(assert_return (invoke "f64x2.abs" (v128.const f64x2 0123456789.e038 0123456789.e038)) + (v128.const f64x2 0123456789.e038 0123456789.e038)) +(assert_return (invoke "f64x2.abs" (v128.const f64x2 0123456789.e+038 0123456789.e+038)) + (v128.const f64x2 0123456789.e+038 0123456789.e+038)) +(assert_return (invoke "f64x2.abs" (v128.const f64x2 -01234567890123456789.01234567890123456789 -01234567890123456789.01234567890123456789)) + (v128.const f64x2 01234567890123456789.01234567890123456789 01234567890123456789.01234567890123456789)) ;; type check (assert_invalid (module (func (result v128) (f64x2.abs (i32.const 0)))) "type mismatch")