|
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 System.ComponentModel; |
|
21 using SymbianUtils.BasicTypes; |
|
22 using SymbianStructuresLib.Arm.Registers; |
|
23 using SymbianInstructionLib.Arm.Instructions.Common; |
|
24 |
|
25 namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing |
|
26 { |
|
27 public abstract class Arm_DataProcessing_Shift : Arm_DataProcessing |
|
28 { |
|
29 #region Enumerations |
|
30 public enum TShiftType |
|
31 { |
|
32 EShiftNone = -1, |
|
33 EShiftLogicalLeft = 0, |
|
34 EShiftLogicalRight, |
|
35 EShiftArithmeticRight, |
|
36 EShiftRotateRight, |
|
37 EShiftRotateRightWithExtend |
|
38 } |
|
39 #endregion |
|
40 |
|
41 #region Constructors |
|
42 protected Arm_DataProcessing_Shift( TEncoding aEncoding ) |
|
43 : base( aEncoding ) |
|
44 { |
|
45 } |
|
46 #endregion |
|
47 |
|
48 #region From ArmBaseInstruction |
|
49 protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) |
|
50 { |
|
51 TArmRegisterType reg1 = base.Rn; |
|
52 TArmRegisterType reg2 = this.Rm; |
|
53 return ( aRegister == reg1 || aRegister == reg2 ); |
|
54 } |
|
55 #endregion |
|
56 |
|
57 #region From ArmInstruction |
|
58 public override bool Matches( uint aOpCode ) |
|
59 { |
|
60 // If the following values hold true then it is not a data processing instruction at all. |
|
61 // |
|
62 // bit[25] == 0 |
|
63 // bit[ 4] == 1 |
|
64 // bit[ 7] == 1 |
|
65 // |
|
66 bool match = base.Matches( aOpCode ); |
|
67 if ( match ) |
|
68 { |
|
69 SymUInt32 raw = aOpCode; |
|
70 if ( raw[ 25 ] == SymBit.EClear && raw[ 4 ] == SymBit.ESet && raw[ 7 ] == SymBit.ESet ) |
|
71 { |
|
72 match = false; |
|
73 } |
|
74 } |
|
75 // |
|
76 return match; |
|
77 } |
|
78 #endregion |
|
79 |
|
80 #region API |
|
81 #endregion |
|
82 |
|
83 #region Properties |
|
84 public virtual TShiftType ShiftType |
|
85 { |
|
86 get |
|
87 { |
|
88 TShiftType ret = (TShiftType) base.AIRawValue[ 6, 5 ].ToUInt(); |
|
89 return ret; |
|
90 } |
|
91 } |
|
92 |
|
93 public TArmRegisterType Rm |
|
94 { |
|
95 get |
|
96 { |
|
97 TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 3, 0 ].ToUInt(); |
|
98 return ret; |
|
99 } |
|
100 } |
|
101 #endregion |
|
102 |
|
103 #region Internal methods |
|
104 #endregion |
|
105 |
|
106 #region Data members |
|
107 #endregion |
|
108 } |
|
109 } |
|
110 |