Track the default member name for immediate operands.
Usually an instruction firmat has only a single immediate operand called 'imm', or 'cond' if it is one of the condigtion codes. Add a 'default_member' field to ImmediateKind to keep track of this default member name in the InstructionData struct.
This commit is contained in:
@@ -237,11 +237,15 @@ variable_args = OperandKind(
|
||||
class ImmediateKind(OperandKind):
|
||||
"""
|
||||
The kind of an immediate instruction operand.
|
||||
|
||||
:param default_member: The default member name of this kind the
|
||||
`InstructionData` data structure.
|
||||
"""
|
||||
|
||||
def __init__(self, name, doc):
|
||||
def __init__(self, name, doc, default_member='imm'):
|
||||
self.name = name
|
||||
self.__doc__ = doc
|
||||
self.default_member = default_member
|
||||
|
||||
def __repr__(self):
|
||||
return 'ImmediateKind({})'.format(self.name)
|
||||
|
||||
@@ -34,11 +34,16 @@ immvector = ImmediateKind('immvector', 'An immediate SIMD vector.')
|
||||
#:
|
||||
#: This enumerated operand kind is used for the :cton:inst:`icmp` instruction
|
||||
#: and corresponds to the `condcodes::IntCC` Rust type.
|
||||
intcc = ImmediateKind('intcc', 'An integer comparison condition code.')
|
||||
intcc = ImmediateKind(
|
||||
'intcc',
|
||||
'An integer comparison condition code.',
|
||||
default_member='cond')
|
||||
|
||||
#: A condition code for comparing floating point values.
|
||||
#:
|
||||
#: This enumerated operand kind is used for the :cton:inst:`fcmp` instruction
|
||||
#: and corresponds to the `condcodes::FloatCC` Rust type.
|
||||
floatcc = ImmediateKind(
|
||||
'floatcc', 'A floating point comparison condition code.')
|
||||
'floatcc',
|
||||
'A floating point comparison condition code.',
|
||||
default_member='cond')
|
||||
|
||||
Reference in New Issue
Block a user