crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple_VFP.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using SymbianUtils.BasicTypes;
       
    21 using SymbianStructuresLib.Arm.Registers;
       
    22 using SymbianStructuresLib.Arm.Registers.VFP;
       
    23 using SymbianStructuresLib.Arm.Instructions;
       
    24 using SymbianInstructionLib.Arm.Instructions.Common;
       
    25 
       
    26 namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer
       
    27 {
       
    28     public abstract class Arm_LoadOrStoreMultiple_VFP : Arm_LoadOrStoreMultiple
       
    29     {
       
    30         #region Constructors
       
    31         protected Arm_LoadOrStoreMultiple_VFP()
       
    32         {
       
    33             base.AITarget = TArmInstructionTarget.EVectorFloatingPoint;
       
    34         }
       
    35         #endregion
       
    36 
       
    37         #region Frin Arm_LoadOrStoreMultiple
       
    38         public override TArmRegisterType BaseRegister
       
    39         {
       
    40             get
       
    41             {
       
    42                 SymMask mask = new SymMask( 0xF << 16, SymMask.TShiftDirection.ERight, 16 );
       
    43                 TArmRegisterType ret = (TArmRegisterType) mask.Apply( base.AIRawValue );
       
    44                 return ret;
       
    45             }
       
    46         }
       
    47         #endregion
       
    48 
       
    49         #region Framework API
       
    50         public abstract TArmRegisterTypeVFP FirstRegister
       
    51         {
       
    52             get;
       
    53         }
       
    54 
       
    55         public abstract TArmRegisterTypeVFP[] Registers
       
    56         {
       
    57             get;
       
    58         }
       
    59         #endregion
       
    60 
       
    61         #region Properties
       
    62         public TArmInstructionAddressingModeVFP AddressingMode
       
    63         {
       
    64             get
       
    65             {
       
    66                 // The address mode is a combination of P U and W bits.
       
    67                 TArmInstructionAddressingModeVFP ret = TArmInstructionAddressingModeVFP.EUndefined;
       
    68 
       
    69                 // First extract P and U bits. NB: We shift this only 22 to the right because
       
    70                 // we are about to inject the 'W' bit at bit zero.
       
    71                 SymMask maskPU = new SymMask( 3u << 23, SymMask.TShiftDirection.ERight, 22 );
       
    72                 uint bits = maskPU.Apply( base.AIRawValue );
       
    73 
       
    74                 // Extract W bit
       
    75                 SymBit wBit = base.AIRawValue[ ArmInstruction.KBitIndexW ];
       
    76                 bits |= (uint) wBit;
       
    77 
       
    78                 switch ( bits )
       
    79                 {
       
    80                 case 0:
       
    81                 case 1:
       
    82                 case 7:
       
    83                 default:
       
    84                     break;
       
    85                 //         P U W 
       
    86                 case 2: // 0 1 0
       
    87                     ret = TArmInstructionAddressingModeVFP.EUnindexed;
       
    88                     break;
       
    89                 case 3: // 0 1 0
       
    90                     ret = TArmInstructionAddressingModeVFP.EIncrement;
       
    91                     break;
       
    92                 case 4: // 1 0 0
       
    93                     ret = TArmInstructionAddressingModeVFP.EOffsetNegative;
       
    94                     break;
       
    95                 case 5: // 1 0 1
       
    96                     ret = TArmInstructionAddressingModeVFP.EDecrement;
       
    97                     break;
       
    98                 case 6: // 1 1 0
       
    99                     ret = TArmInstructionAddressingModeVFP.EOffsetPositive;
       
   100                     break;
       
   101                 }
       
   102                 //
       
   103                 return ret;
       
   104             }
       
   105         }
       
   106 
       
   107         public uint Offset
       
   108         {
       
   109             get
       
   110             {
       
   111                 uint offset = base.AIRawValue & 0xFF;
       
   112                 return offset;
       
   113             }
       
   114         }
       
   115         #endregion
       
   116 
       
   117         #region Internal constants
       
   118         protected readonly static SymMask KMaskFirstReg = new SymMask( 0xF000, SymMask.TShiftDirection.ERight, 12 );
       
   119         #endregion
       
   120 
       
   121         #region Data members
       
   122         #endregion
       
   123     }
       
   124 }
       
   125