| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using ARMeilleure.State;
- using System;
- namespace ARMeilleure.IntermediateRepresentation
- {
- static class OperandHelper
- {
- public static Operand Const(OperandType type, long value)
- {
- return type == OperandType.I32 ? new Operand((int)value) : new Operand(value);
- }
- public static Operand Const(bool value)
- {
- return new Operand(value ? 1 : 0);
- }
- public static Operand Const(int value)
- {
- return new Operand(value);
- }
- public static Operand Const(uint value)
- {
- return new Operand(value);
- }
- public static Operand Const(long value)
- {
- return new Operand(value);
- }
- public static Operand Const(ulong value)
- {
- return new Operand(value);
- }
- public static Operand ConstF(float value)
- {
- return new Operand(value);
- }
- public static Operand ConstF(double value)
- {
- return new Operand(value);
- }
- public static Operand Label()
- {
- return new Operand(OperandKind.Label);
- }
- public static Operand Local(OperandType type)
- {
- return new Operand(OperandKind.LocalVariable, type);
- }
- public static Operand Register(int index, RegisterType regType, OperandType type)
- {
- return new Operand(index, regType, type);
- }
- public static Operand Undef()
- {
- return new Operand(OperandKind.Undefined);
- }
- }
- }
|