using Cpp2IL.Core.Analysis;
namespace Cpp2IL.Core.ISIL;
///
/// If changing this, also update
///
public enum OpCode
{
/// Invalid instruction, op 1 is the debug string
Invalid,
/// Not implemented instruction, op 1 is the debug string
NotImplemented,
///
/// Interrupt, kept for stack analysis
///
Interrupt,
///
/// No operation
///
Nop,
/// Moves op 2 into op 1
Move,
/// Moves the result of phi function into op 1, other operands are inputs
Phi,
/// Calls a method @ op 1, moves the result into op 2, and the rest are params
Call,
/// Calls a method @ op 1, the rest are params
CallVoid,
/// Calls a method @ op 1, the rest are params
IndirectCall,
/// Returns from the method, op 1 is the value to return (optional)
Return,
/// Jumps to op 1
Jump,
/// Jumps to op 1
IndirectJump,
/// If op 2 is true, jumps to op 1
ConditionalJump,
/// Adds op 1 to stack pointer
ShiftStack,
/// Adds op 2 and op 3, and moves the result into op 1
Add,
/// Subtracts op 3 from op 2, and moves the result into op 1
Subtract,
/// Multiplies op 2 by op 3, and moves the result into op 1
Multiply,
/// Divides op 2 by op 3, and moves the result into op 1
Divide,
/// Divides op 2 by op 3, and moves the remainder into op 1
Modulo,
/// Shifts the bits of op 2 left by op 3, and moves the result into op 1
ShiftLeft,
/// Shifts the bits of op 2 right by op 3, and moves the result into op 1
ShiftRight,
/// Bitwise AND on op 2 and op 3, moves the result into op 1
And,
/// Bitwise OR on op 2 and op 3, moves the result into op 1
Or,
/// Bitwise XOR on op 2 and op 3, moves the result into op 1
Xor,
/// Logical not on op 2, moves the result into op 1
Not,
/// Negates op 2, moves the result into op 1
Negate,
/// Moves 1 into op 1, if op 2 and op 3 are equal
CheckEqual,
/// Moves 1 into op 1, if op 2 is greater than op 3
CheckGreater,
/// Moves 1 into op 1, if op 2 is less than op 3
CheckLess,
/// Moves 1 into op 1, if op 2 and op 3 are not equal
CheckNotEqual,
/// Moves 1 into op 1, if op 2 is greater than or equal to op 3
CheckGreaterOrEqual,
/// Moves 1 into op 1, if op 2 is less than or equal to op 3
CheckLessOrEqual,
///
/// Allocates a new, uninitialized instance of the type described by op 2 and moves it into op 1.
///
Newobj,
///
/// Allocates a new array of the type described by op 2, with the length in op 3, into op 1.
///
NewArr,
///
/// Boxes the value at op 3 as the type described by op 2, and moves the result into op 1.
///
Box,
///
/// Throws a new instance of the exception type described by op 1.
///
Throw
}