asmjit::Imm Class Reference
Inheritance diagram for asmjit::Imm:
asmjit::Operand asmjit::Operand_

Immediate operands are encoded with instruction data.

Member Functions

Construction & Destruction
Overloaded Operators
Accessors
Utilities
- Public Member Functions inherited from asmjit::Operand
- Public Member Functions inherited from asmjit::Operand_

Additional Inherited Members

- Public Attributes inherited from asmjit::Operand_
- Public Types inherited from asmjit::Operand_
- Static Public Member Functions inherited from asmjit::Operand_

Constructor & Destructor Documentation

Imm::Imm()constexprconstexprnoexcept[1/4]◆ 

Creates a new immediate value (initial value is 0).

Imm::Imm(const Imm& other)constexprconstexprnoexcept[2/4]◆ 

Creates a new immediate value from other.

Imm::Imm(const arm::Shift& shift)constexprconstexprnoexcept[3/4]◆ 

Creates a new immediate value from ARM/AArch64 specific shift.

template<typename T, typename = typename std::enable_if<IsConstexprConstructibleAsImmType<typename std::decay<T>::type>::value>::type>
Imm::Imm(const T& val, const uint32_t predicate = 0)constexprconstexprnoexcept[4/4]◆ 

Creates a new signed immediate value, assigning the value to val and an architecture-specific predicate to predicate.

Note
Predicate is currently only used by ARM architectures.

Member Function Documentation

Imm& Imm::operator=(const Imm& other)noexcept◆ 

Assigns the value of the other operand to this immediate.

ImmType Imm::type() constconstexprconstexprnoexcept◆ 

Returns immediate type.

void Imm::setType(ImmType type)noexcept◆ 

Sets the immediate type to type.

void Imm::resetType()noexcept◆ 

Resets immediate type to ImmType::kInt.

uint32_t Imm::predicate() constconstexprconstexprnoexcept◆ 

Returns operation predicate of the immediate.

The meaning depends on architecture, for example on ARM hardware this describes arm::ShiftOp of the immediate.

void Imm::setPredicate(uint32_t predicate)noexcept◆ 

Sets operation predicate of the immediate to predicate.

The meaning depends on architecture, for example on ARM hardware this describes arm::ShiftOp of the immediate.

void Imm::resetPredicate()noexcept◆ 

Resets the shift operation type of the immediate to the default value (no operation).

int64_t Imm::value() constconstexprconstexprnoexcept◆ 

Returns the immediate value as int64_t, which is the internal format Imm uses.

uint32_t Imm::isInt() constconstexprconstexprnoexcept◆ 

Tests whether this immediate value is integer of any size.

uint32_t Imm::isDouble() constconstexprconstexprnoexcept◆ 

Tests whether this immediate value is a double precision floating point value.

bool Imm::isInt8() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 8-bit signed integer.

bool Imm::isUInt8() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 8-bit unsigned integer.

bool Imm::isInt16() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 16-bit signed integer.

bool Imm::isUInt16() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 16-bit unsigned integer.

bool Imm::isInt32() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 32-bit signed integer.

bool Imm::isUInt32() constconstexprconstexprnoexcept◆ 

Tests whether the immediate can be casted to 32-bit unsigned integer.

template<typename T>
T Imm::valueAs() constnoexcept◆ 

Returns the immediate value casted to T.

The value is masked before it's casted to T so the returned value is simply the representation of T considering the original value's lowest bits.

int32_t Imm::int32Lo() constconstexprconstexprnoexcept◆ 

Returns low 32-bit signed integer.

int32_t Imm::int32Hi() constconstexprconstexprnoexcept◆ 

Returns high 32-bit signed integer.

uint32_t Imm::uint32Lo() constconstexprconstexprnoexcept◆ 

Returns low 32-bit signed integer.

uint32_t Imm::uint32Hi() constconstexprconstexprnoexcept◆ 

Returns high 32-bit signed integer.

template<typename T>
void Imm::setValue(const T& val)noexcept◆ 

Sets immediate value to val, the value is casted to a signed 64-bit integer.

Imm Imm::clone() constconstexprconstexprnoexcept◆ 

Clones the immediate operand.