Skip to content

Commit

Permalink
Add f64
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Aug 7, 2020
1 parent 7d01c63 commit 6942142
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions lib/fizzy/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, span<const Value>
{
comparison_op<float>(stack, std::greater<float>());
break;
// throw unsupported_feature("Floating point instruction.");
}
case Instr::f32_le:
{
Expand All @@ -1428,6 +1427,36 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, span<const Value>
binary_op(stack, std::plus<float>{});
break;
}
case Instr::f64_eq:
{
comparison_op(stack, std::equal_to<double>());
break;
}
case Instr::f64_ne:
{
comparison_op(stack, std::not_equal_to<double>());
break;
}
case Instr::f64_lt:
{
comparison_op(stack, std::less<double>());
break;
}
case Instr::f64_gt:
{
comparison_op<double>(stack, std::greater<double>());
break;
}
case Instr::f64_le:
{
comparison_op(stack, std::less_equal<double>());
break;
}
case Instr::f64_ge:
{
comparison_op(stack, std::greater_equal<double>());
break;
}
case Instr::f64_add:
{
binary_op(stack, std::plus<double>{});
Expand All @@ -1438,12 +1467,6 @@ ExecutionResult execute(Instance& instance, FuncIdx func_idx, span<const Value>
case Instr::f64_load:
case Instr::f32_store:
case Instr::f64_store:
case Instr::f64_eq:
case Instr::f64_ne:
case Instr::f64_lt:
case Instr::f64_gt:
case Instr::f64_le:
case Instr::f64_ge:
case Instr::f32_abs:
case Instr::f32_neg:
case Instr::f32_ceil:
Expand Down

0 comments on commit 6942142

Please sign in to comment.