mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-26 07:49:28 +01:00
implement max operation in text format
This commit is contained in:
parent
a189a8328f
commit
fe442e42e6
@ -73,6 +73,9 @@ public class WatParser extends WasmCodeBuilder {
|
|||||||
case "f32.max":
|
case "f32.max":
|
||||||
addNumericInstruction( NumericOperator.max, ValueType.f32, javaCodePos );
|
addNumericInstruction( NumericOperator.max, ValueType.f32, javaCodePos );
|
||||||
break;
|
break;
|
||||||
|
case "f64.max":
|
||||||
|
addNumericInstruction( NumericOperator.max, ValueType.f64, javaCodePos );
|
||||||
|
break;
|
||||||
case "i64.extend_s/i32":
|
case "i64.extend_s/i32":
|
||||||
addConvertInstruction( ValueTypeConvertion.i2l, javaCodePos );
|
addConvertInstruction( ValueTypeConvertion.i2l, javaCodePos );
|
||||||
break;
|
break;
|
||||||
|
@ -101,6 +101,16 @@ public class WatParserTest {
|
|||||||
test( "i32.add" );
|
test( "i32.add" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void f32_max() throws IOException {
|
||||||
|
test( "f32.max" );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void f64_max() throws IOException {
|
||||||
|
test( "f64.max" );
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void i32_const() throws IOException {
|
public void i32_const() throws IOException {
|
||||||
test( " i32.const -7 " );
|
test( " i32.const -7 " );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user