Skip to content

Commit

Permalink
plus endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaTP committed Oct 13, 2023
1 parent a585ce3 commit 8dd38b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
const.wast,
align.wast,
int_literals.wast,
int_exprs.wast</wastToProcess>
int_exprs.wast,
endianness.wast</wastToProcess>
<excludedTests>
<!-- Assertion failures -->
<!-- Errors -->
Expand Down
20 changes: 19 additions & 1 deletion runtime/src/main/java/com/dylibso/chicory/runtime/Machine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ void eval(List<Instruction> code) throws ChicoryException {
case F64_REINTERPRET_I64:
{
var tos = this.stack.pop();
this.stack.push(Value.i64(tos.asLong()));
this.stack.push(Value.f64(tos.asLong()));
break;
}
case I64_TRUNC_F64_S:
Expand All @@ -1111,6 +1111,24 @@ void eval(List<Instruction> code) throws ChicoryException {
this.stack.push(Value.i64(tos.asUInt()));
break;
}
case I32_REINTERPRET_F32:
{
var tos = this.stack.pop();
this.stack.push(Value.i32(tos.asInt()));
break;
}
case I64_REINTERPRET_F64:
{
var tos = this.stack.pop();
this.stack.push(Value.i64(tos.asLong()));
break;
}
case F32_REINTERPRET_I32:
{
var tos = this.stack.pop();
this.stack.push(Value.f32(tos.asInt()));
break;
}
default:
throw new RuntimeException(
"Machine doesn't recognize Instruction " + instruction);
Expand Down

0 comments on commit 8dd38b0

Please sign in to comment.