An ARMv6 machine code emitter.
Inheritance: Mosa.Compiler.Framework.BaseCodeEmitter
Exemplo n.º 1
0
 /// <summary>
 /// Emits the data processing instruction.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <param name="emitter">The emitter.</param>
 /// <param name="opcode">The opcode.</param>
 /// <exception cref="InvalidCompilerException"></exception>
 protected void EmitDataProcessingInstruction(InstructionNode node, MachineCodeEmitter emitter, byte opcode)
 {
     if (node.Operand2.IsCPURegister && node.Operand3.IsShift)
     {
         emitter.EmitInstructionWithRegister(node.ConditionCode, opcode, node.UpdateStatus, node.Operand1.Register.Index, node.Result.Register.Index, node.Operand3.ShiftType, node.Operand2.Register.Index);
     }
     else if (node.Operand2.IsConstant && node.Operand3.IsConstant)
     {
         emitter.EmitInstructionWithImmediate(node.ConditionCode, opcode, node.UpdateStatus, node.Operand1.Register.Index, node.Result.Register.Index, (int)node.Operand2.ConstantSignedLongInteger, (int)node.Operand3.ConstantSignedLongInteger);
     }
     else
     {
         throw new InvalidCompilerException();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Emits the specified platform instruction.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="emitter">The emitter.</param>
 protected override void Emit(Context context, MachineCodeEmitter emitter)
 {
     // TODO
 }
Exemplo n.º 3
0
 protected void EmitMemoryLoadStore(InstructionNode node, MachineCodeEmitter emitter, TransferType transferType)
 {
     if (node.Operand2.IsConstant)
     {
         emitter.EmitSingleDataTransfer(
             node.ConditionCode,
             Indexing.Post,
             OffsetDirection.Up,
             TransferSize.Word,
             WriteBack.NoWriteBack,
             transferType,
             node.Operand1.Index,
             node.Result.Index,
             (uint)node.Operand2.ConstantUnsignedLongInteger
         );
     }
     else
     {
         emitter.EmitSingleDataTransfer(
               node.ConditionCode,
               Indexing.Post,
               OffsetDirection.Up,
               TransferSize.Word,
               WriteBack.NoWriteBack,
               transferType,
               node.Operand1.Index,
               node.Result.Index,
               node.Operand2.ShiftType,
               node.Operand3.Index
           );
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Emits the specified platform instruction.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <param name="emitter">The emitter.</param>
 protected virtual void Emit(InstructionNode node, MachineCodeEmitter emitter)
 {
     // TODO: Check x86 Implementation
 }
Exemplo n.º 5
0
 /// <summary>
 /// Emits the multiply instruction.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <param name="emitter">The emitter.</param>
 protected void EmitMultiplyInstruction(InstructionNode node, MachineCodeEmitter emitter)
 {
     if (!node.Operand3.IsCPURegister)
     {
         emitter.EmitMultiply(node.ConditionCode, node.UpdateStatus, node.Operand1.Register.Index, node.Result.Register.Index, node.Operand2.Register.Index);
     }
     else
     {
         emitter.EmitMultiplyWithAccumulate(node.ConditionCode, node.UpdateStatus, node.Operand1.Register.Index, node.Result.Register.Index, node.Operand2.Register.Index, node.Operand3.Register.Index);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Emits the specified platform instruction.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="emitter">The emitter.</param>
 protected virtual void Emit(Context context, MachineCodeEmitter emitter)
 {
     // TODO: Check x86 Implementation
 }