Class: Crabstone::ARM64::Operand
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Crabstone::ARM64::Operand
- Defined in:
- lib/arch/arm64.rb
Instance Method Summary collapse
- #barrier? ⇒ Boolean
- #cimm? ⇒ Boolean
- #ext? ⇒ Boolean
- #fp? ⇒ Boolean
- #imm? ⇒ Boolean
- #mem? ⇒ Boolean
- #mrs? ⇒ Boolean
- #msr? ⇒ Boolean
- #prefetch? ⇒ Boolean
- #pstate? ⇒ Boolean
- #reg? ⇒ Boolean
- #shift? ⇒ Boolean
- #shift_type ⇒ Object
- #shift_value ⇒ Object
- #valid? ⇒ Boolean
- #value ⇒ Object
Instance Method Details
#barrier? ⇒ Boolean
125 126 127 |
# File 'lib/arch/arm64.rb', line 125 def self[:type] == OP_BARRIER end |
#cimm? ⇒ Boolean
101 102 103 |
# File 'lib/arch/arm64.rb', line 101 def cimm? self[:type] == OP_CIMM end |
#ext? ⇒ Boolean
89 90 91 |
# File 'lib/arch/arm64.rb', line 89 def ext? self[:ext] != EXT_INVALID end |
#fp? ⇒ Boolean
109 110 111 |
# File 'lib/arch/arm64.rb', line 109 def fp? self[:type] == OP_FP end |
#imm? ⇒ Boolean
97 98 99 |
# File 'lib/arch/arm64.rb', line 97 def imm? self[:type] == OP_IMM end |
#mem? ⇒ Boolean
105 106 107 |
# File 'lib/arch/arm64.rb', line 105 def mem? self[:type] == OP_MEM end |
#mrs? ⇒ Boolean
121 122 123 |
# File 'lib/arch/arm64.rb', line 121 def mrs? self[:type] == OP_REG_MRS end |
#msr? ⇒ Boolean
117 118 119 |
# File 'lib/arch/arm64.rb', line 117 def msr? self[:type] == OP_REG_MSR end |
#prefetch? ⇒ Boolean
129 130 131 |
# File 'lib/arch/arm64.rb', line 129 def prefetch? self[:type] == OP_PREFETCH end |
#pstate? ⇒ Boolean
113 114 115 |
# File 'lib/arch/arm64.rb', line 113 def pstate? self[:type] == OP_PSTATE end |
#reg? ⇒ Boolean
93 94 95 |
# File 'lib/arch/arm64.rb', line 93 def reg? self[:type] == OP_REG end |
#shift? ⇒ Boolean
85 86 87 |
# File 'lib/arch/arm64.rb', line 85 def shift? self[:shift][:type] != SFT_INVALID end |
#shift_type ⇒ Object
77 78 79 |
# File 'lib/arch/arm64.rb', line 77 def shift_type self[:shift][:type] end |
#shift_value ⇒ Object
81 82 83 |
# File 'lib/arch/arm64.rb', line 81 def shift_value self[:shift][:value] end |
#valid? ⇒ Boolean
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/arch/arm64.rb', line 133 def valid? [ OP_INVALID, OP_REG, OP_CIMM, OP_IMM, OP_FP, OP_MEM, OP_REG_MRS, OP_REG_MSR, OP_PSTATE, OP_SYS, OP_PREFETCH, OP_BARRIER ].include? self[:type] end |
#value ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/arch/arm64.rb', line 54 def value case self[:type] when *[OP_REG, OP_REG_MRS, OP_REG_MSR] # Register operand. self[:value][:reg] when *[OP_IMM, OP_CIMM] # Immediate operand. self[:value][:imm] when OP_FP # Floating-Point immediate operand. self[:value][:fp] when OP_MEM # Memory operand self[:value][:mem] when OP_PSTATE # PState operand. self[:value][:pstate] when OP_SYS # SYS operand for IC/DC/AT/TLBI instructions. self[:value][:sys] when OP_PREFETCH # Prefetch operand (PRFM). self[:value][:prefetch] when OP_BARRIER # Memory barrier operand (ISB/DMB/DSB instructions). self[:value][:barrier] else nil end end |