implement max operation in text format

This commit is contained in:
Volker Berlin 2018-11-16 20:27:19 +01:00
parent a189a8328f
commit fe442e42e6
2 changed files with 13 additions and 0 deletions

View File

@ -73,6 +73,9 @@ public class WatParser extends WasmCodeBuilder {
case "f32.max":
addNumericInstruction( NumericOperator.max, ValueType.f32, javaCodePos );
break;
case "f64.max":
addNumericInstruction( NumericOperator.max, ValueType.f64, javaCodePos );
break;
case "i64.extend_s/i32":
addConvertInstruction( ValueTypeConvertion.i2l, javaCodePos );
break;

View File

@ -101,6 +101,16 @@ public class WatParserTest {
test( "i32.add" );
}
@Test
public void f32_max() throws IOException {
test( "f32.max" );
}
@Test
public void f64_max() throws IOException {
test( "f64.max" );
}
@Test
public void i32_const() throws IOException {
test( " i32.const -7 " );