/// <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.Size64; BaseIRInstruction instruction = IRInstruction.LoadZeroExtended; if (methodCompiler.Architecture.NativeIntegerSize == 64) { instruction = IRInstruction.LoadInteger; } if (context.OperandCount == 1) { context.SetInstruction(IRInstruction.LoadZeroExtended, size, context.Result, context.Operand1, methodCompiler.ConstantZero); } else if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.LoadZeroExtended, size, context.Result, context.Operand1, context.Operand2); } else { throw new InvalidCompilerException(); } LoadStore.OrderLoadOperands(context.Node, methodCompiler); }
/// <summary> /// Visitation function for LoadZeroExtended instruction. /// </summary> /// <param name="node">The node.</param> private void LoadZeroExtended(InstructionNode node) { Debug.Assert(node.Size == InstructionSize.Size8 || node.Size == InstructionSize.Size16); LoadStore.OrderLoadOperands(node, MethodCompiler); node.SetInstruction(X86.MovzxLoad, node.Size, node.Result, node.Operand1, node.Operand2); }
private void LoadInt32(Context context) { Debug.Assert(!context.Result.IsR4); Debug.Assert(!context.Result.IsR8); LoadStore.OrderLoadOperands(context, MethodCompiler); context.SetInstruction(X64.MovLoad32, context.Result, context.Operand1, context.Operand2); }
private void LoadInt32(InstructionNode node) { Debug.Assert(!node.Result.IsR4); Debug.Assert(!node.Result.IsR8); LoadStore.OrderLoadOperands(node, MethodCompiler); node.SetInstruction(X86.MovLoad32, node.Result, node.Operand1, node.Operand2); }
/// <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 == 1) { context.SetInstruction(IRInstruction.LoadInt64, context.Result, context.Operand1, methodCompiler.ConstantZero); } else if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.LoadInt64, context.Result, context.Operand1, context.Operand2); } else { throw new CompilerException(); } LoadStore.OrderLoadOperands(context.Node, methodCompiler); }
private static void Load64(Context context, MethodCompiler methodCompiler) { if (context.OperandCount == 1) { context.SetInstruction(IRInstruction.Load64, context.Result, context.Operand1, methodCompiler.ConstantZero); } else if (context.OperandCount == 2) { context.SetInstruction(IRInstruction.Load64, context.Result, context.Operand1, context.Operand2); } else { throw new CompilerException(); } LoadStore.OrderLoadOperands(context, 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) { var instruction = methodCompiler.Architecture.Is32BitPlatform ? (BaseInstruction)IRInstruction.LoadZeroExtend16x32 : IRInstruction.LoadZeroExtend16x64; if (context.OperandCount == 1) { context.SetInstruction(instruction, context.Result, context.Operand1, methodCompiler.ConstantZero); } else if (context.OperandCount == 2) { context.SetInstruction(instruction, context.Result, context.Operand1, context.Operand2); } else { throw new CompilerException(); } LoadStore.OrderLoadOperands(context.Node, methodCompiler); }
private static void LoadPointer(Context context, MethodCompiler methodCompiler) { var instruction = methodCompiler.Architecture.Is32BitPlatform ? (BaseInstruction)IRInstruction.Load32 : IRInstruction.LoadZeroExtend32x64; if (context.OperandCount == 1) { context.SetInstruction(instruction, context.Result, context.Operand1, methodCompiler.ConstantZero); } else if (context.OperandCount == 2) { context.SetInstruction(instruction, context.Result, context.Operand1, context.Operand2); } else { throw new CompilerException(); } LoadStore.OrderLoadOperands(context, methodCompiler); }
private void LoadZeroExtend8x32(Context context) { LoadStore.OrderLoadOperands(context, MethodCompiler); context.SetInstruction(X64.MovzxLoad8, context.Result, context.Operand1, context.Operand2); }
private void LoadSignExtend16x32(Context context) { LoadStore.OrderLoadOperands(context, MethodCompiler); context.SetInstruction(X86.MovsxLoad16, context.Result, context.Operand1, context.Operand2); }
private void LoadZeroExtend8x32(InstructionNode node) { LoadStore.OrderLoadOperands(node, MethodCompiler); node.SetInstruction(X86.MovzxLoad8, node.Result, node.Operand1, node.Operand2); }
private void LoadSignExtend32x64(Context context) { LoadStore.OrderLoadOperands(context, MethodCompiler); context.SetInstruction(X64.MovzxLoad32, context.Result, context.Operand1, context.Operand2); }
private void LoadSignExtend16x64(InstructionNode node) { LoadStore.OrderLoadOperands(node, MethodCompiler); node.SetInstruction(X64.MovsxLoad16, node.Result, node.Operand1, node.Operand2); }