mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
LibJS: Add bytecode instructions for modulo and exponentiation
This commit is contained in:
parent
6af9d87258
commit
55f0791b13
4 changed files with 66 additions and 0 deletions
|
@ -55,6 +55,12 @@ Optional<Bytecode::Register> BinaryExpression::generate_bytecode(Bytecode::Gener
|
|||
case BinaryOp::Division:
|
||||
generator.emit<Bytecode::Op::Div>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::Modulo:
|
||||
generator.emit<Bytecode::Op::Mod>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::Exponentiation:
|
||||
generator.emit<Bytecode::Op::Exp>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::LessThan:
|
||||
generator.emit<Bytecode::Op::LessThan>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue