/// <summary> /// Replaces the intrinsic call site /// </summary> /// <param name="context">The context.</param> /// <param name="methodCompiler">The method compiler.</param> /// <exception cref="CompilerException"></exception> void IIntrinsicInternalMethod.ReplaceIntrinsicCall(Context context, MethodCompiler methodCompiler) { if (context.OperandCount == 2) { var instruction = !context.Operand2.Is64BitInteger ? (BaseInstruction)IRInstruction.StoreInt32 : IRInstruction.StoreInt64; if (context.Operand2.IsR4) instruction = IRInstruction.StoreFloatR4; else if (context.Operand2.IsR8) instruction = IRInstruction.StoreFloatR8; context.SetInstruction(instruction, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { var instruction = !context.Operand3.Is64BitInteger ? (BaseInstruction)IRInstruction.StoreInt32 : IRInstruction.StoreInt64; if (context.Operand3.IsR4) instruction = IRInstruction.StoreFloatR4; else if (context.Operand3.IsR8) instruction = IRInstruction.StoreFloatR8; context.SetInstruction(instruction, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new CompilerException(); } LoadStore.OrderStoreOperands(context.Node, methodCompiler); }
/// <summary> /// Replaces the intrinsic call site /// </summary> /// <param name="context">The context.</param> /// <param name="methodCompiler">The method compiler.</param> /// <exception cref="CompilerException"></exception> void IIntrinsicInternalMethod.ReplaceIntrinsicCall(Context context, MethodCompiler methodCompiler) { if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.StoreInt8, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { context.SetInstruction(IRInstruction.StoreInt8, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new CompilerException(); } LoadStore.OrderStoreOperands(context.Node, methodCompiler); }
private static void StoreR4(Context context, MethodCompiler methodCompiler) { if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.StoreFloatR4, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { context.SetInstruction(IRInstruction.StoreFloatR4, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new CompilerException(); } LoadStore.OrderStoreOperands(context.Node, methodCompiler); }
private static void StorePointer(Context context, MethodCompiler methodCompiler) { var instruction = methodCompiler.Architecture.Is32BitPlatform ? (BaseInstruction)IRInstruction.StoreInt32 : IRInstruction.StoreInt64; if (context.OperandCount == 2) { context.SetInstruction(instruction, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { context.SetInstruction(instruction, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new CompilerException(); } LoadStore.OrderStoreOperands(context, methodCompiler); }
/// <summary> /// Replaces the intrinsic call site /// </summary> /// <param name="context">The context.</param> /// <param name="methodCompiler">The method compiler.</param> /// <exception cref="InvalidCompilerException"></exception> void IIntrinsicInternalMethod.ReplaceIntrinsicCall(Context context, BaseMethodCompiler methodCompiler) { const InstructionSize size = InstructionSize.Size32; if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.StoreInteger, size, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { context.SetInstruction(IRInstruction.StoreInteger, size, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new InvalidCompilerException(); } LoadStore.OrderStoreOperands(context.Node, methodCompiler); }
private static void Store(Context context, MethodCompiler methodCompiler) { if (context.OperandCount == 2) { var instruction = !context.Operand2.Is64BitInteger ? (BaseInstruction)IRInstruction.StoreInt32 : IRInstruction.StoreInt64; if (context.Operand2.IsR4) { instruction = IRInstruction.StoreFloatR4; } else if (context.Operand2.IsR8) { instruction = IRInstruction.StoreFloatR8; } context.SetInstruction(instruction, null, context.Operand1, methodCompiler.ConstantZero, context.Operand2); } else if (context.OperandCount == 3) { var instruction = !context.Operand3.Is64BitInteger ? (BaseInstruction)IRInstruction.StoreInt32 : IRInstruction.StoreInt64; if (context.Operand3.IsR4) { instruction = IRInstruction.StoreFloatR4; } else if (context.Operand3.IsR8) { instruction = IRInstruction.StoreFloatR8; } context.SetInstruction(instruction, null, context.Operand1, context.Operand2, context.Operand3); } else { throw new CompilerException(); } LoadStore.OrderStoreOperands(context, methodCompiler); }
private void StoreInt8(Context context) { LoadStore.OrderStoreOperands(context, MethodCompiler); context.SetInstruction(X64.MovStore8, null, context.Operand1, context.Operand2, context.Operand3); }
private void StoreInt8(InstructionNode node) { LoadStore.OrderStoreOperands(node, MethodCompiler); node.SetInstruction(X86.MovStore8, null, node.Operand1, node.Operand2, node.Operand3); }