1 //! \file
2 /*
3 **  Copyright (C) - Triton
4 **
5 **  This program is under the terms of the Apache License 2.0.
6 */
7 
8 #ifndef TRITON_ARMOPERANDPROPERTIES
9 #define TRITON_ARMOPERANDPROPERTIES
10 
11 #include <triton/archEnums.hpp>
12 #include <triton/dllexport.hpp>
13 #include <triton/tritonTypes.hpp>
14 
15 
16 
17 //! The Triton namespace
18 namespace triton {
19 /*!
20  *  \addtogroup triton
21  *  @{
22  */
23 
24   //! The arch namespace
25   namespace arch {
26   /*!
27    *  \ingroup triton
28    *  \addtogroup arch
29    *  @{
30    */
31 
32     //! The arm namespace
33     namespace arm {
34     /*!
35      *  \ingroup arch
36      *  \addtogroup arm
37      *  @{
38      */
39 
40       /*! \class ArmOperandProperties
41        *  \brief This class is used to represent specific properties of an Arm operand.
42        */
43       class ArmOperandProperties {
44         protected:
45           //! The shift type.
46           triton::arch::arm::shift_e shiftType;
47 
48           //! The shift value immediate.
49           triton::uint32 shiftValueImmediate;
50 
51           //! The shift value register.
52           triton::arch::register_e shiftValueRegister;
53 
54           //! The extend type.
55           triton::arch::arm::extend_e extendType;
56 
57           //! The extend size (in bits).
58           triton::uint32 extendSize;
59 
60           //! The subtracted flag. Used in memory access operands and determines whether this operand has to be added or subtracted to the base register.
61           bool subtracted;
62 
63         public:
64           //! Constructor.
65           TRITON_EXPORT ArmOperandProperties();
66 
67           //! Constructor by copy.
68           TRITON_EXPORT ArmOperandProperties(const ArmOperandProperties& other);
69 
70           //! Returns the type of the shift.
71           TRITON_EXPORT triton::arch::arm::shift_e getShiftType(void) const;
72 
73           //! Returns the value of the shift immediate.
74           TRITON_EXPORT triton::uint32 getShiftImmediate(void) const;
75 
76           //! Returns the value of the shift register.
77           TRITON_EXPORT triton::arch::register_e getShiftRegister(void) const;
78 
79           //! Returns the type of the extend.
80           TRITON_EXPORT triton::arch::arm::extend_e getExtendType(void) const;
81 
82           //! Returns the size (in bits) of the extend.
83           TRITON_EXPORT triton::uint32 getExtendSize(void) const;
84 
85           //! Returns true if the operand has to be subtracted when computing a memory access.
86           TRITON_EXPORT bool isSubtracted(void) const;
87 
88           //! Sets the type of the shift.
89           TRITON_EXPORT void setShiftType(triton::arch::arm::shift_e type);
90 
91           //! Sets the value of the shift immediate.
92           TRITON_EXPORT void setShiftValue(triton::uint32 imm);
93 
94           //! Sets the value of the shift register.
95           TRITON_EXPORT void setShiftValue(triton::arch::register_e reg);
96 
97           //! Sets the type of the extend.
98           TRITON_EXPORT void setExtendType(triton::arch::arm::extend_e type);
99 
100           //! Sets the extended size (in bits) after extension.
101           TRITON_EXPORT void setExtendedSize(triton::uint32 dstSize);
102 
103           //! Sets subtracted flag.
104           TRITON_EXPORT void setSubtracted(bool value);
105 
106           //! Copy an ArmOperandProperties.
107           TRITON_EXPORT ArmOperandProperties& operator=(const ArmOperandProperties& other);
108       };
109 
110     /*! @} End of arm namespace */
111     };
112   /*! @} End of arch namespace */
113   };
114 /*! @} End of triton namespace */
115 };
116 
117 #endif /* TRITON_ARMOPERANDPROPERTIES */
118