mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 10:44:47 +01:00
add i32.eq, i32.ne, loop, br and br_if to the wat parser.
This commit is contained in:
parent
f761e4bf44
commit
0138eb5dc0
@ -82,12 +82,18 @@ public class WatParser extends WasmCodeBuilder {
|
||||
case "i32.add":
|
||||
addNumericInstruction( NumericOperator.add, ValueType.i32, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.eq":
|
||||
addNumericInstruction( NumericOperator.eq, ValueType.i32, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.eqz":
|
||||
addNumericInstruction( NumericOperator.eqz, ValueType.i32, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.mul":
|
||||
addNumericInstruction( NumericOperator.mul, ValueType.i32, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.ne":
|
||||
addNumericInstruction( NumericOperator.ne, ValueType.i32, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.reinterpret_f32":
|
||||
addConvertInstruction( ValueTypeConvertion.f2i_re, javaCodePos, lineNumber );
|
||||
break;
|
||||
@ -244,6 +250,15 @@ public class WatParser extends WasmCodeBuilder {
|
||||
case "drop":
|
||||
addBlockInstruction( WasmBlockOperator.DROP, null, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "loop":
|
||||
addBlockInstruction( WasmBlockOperator.LOOP, null, javaCodePos, lineNumber );
|
||||
break;
|
||||
case "br":
|
||||
addBlockInstruction( WasmBlockOperator.BR, getInt( tokens, ++i ), javaCodePos, lineNumber );
|
||||
break;
|
||||
case "br_if":
|
||||
addBlockInstruction( WasmBlockOperator.BR_IF, getInt( tokens, ++i ), javaCodePos, lineNumber );
|
||||
break;
|
||||
case "i32.load":
|
||||
i = addMemoryInstruction( MemoryOperator.load, ValueType.i32, tokens, i, lineNumber );
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user