Task #6052
closed
Multiple preparators per mode (index range, value mask, etc.)
Added by Alexander Kamkin over 9 years ago.
Updated over 9 years ago.
Assignee:
Andrei Tatarnikov
Category:
Template Processor
Published in build:
150619
Description
There should be a possibility to specify several preparators for a single access mode. If there are several preparators, the first of them that matches parameters and value is chosen.
- Status changed from New to Resolved
- % Done changed from 0 to 100
Done. Example:
#
# The code below specifies an instruction sequence that writes a value
# to the specified register (target) via the REG addressing mode.
#
# Default preparator: It is used when no special case previded below
# is applicable.
#
preparator(:target => 'REG') {
lui target, value(16, 31)
addi target, target, value(0, 15)
}
#
# Special case: Target is $zero register. Since it is read only and
# always equal zero, it makes no sence to initialize it.
#
preparator(:target => 'REG', :arguments => {:i => 0}) {
# Empty
}
#
# Special case: Value equals 0x00000000. In the case, it is
# more convenient to use $zero register to reset the target.
#
preparator(:target => 'REG', :mask => "00000000") {
OR target, zero, zero
}
#
# Special case: Higher half of value is filled with zeros. In this case,
# only one initializing instruction is enough.
#
preparator(:target => 'REG', :mask => "0000XXXX") {
addi target, zero, value(0, 15)
}
#
# Special case: Lower half of value is filled with zeros. In this case,
# only one initializing instruction is enough.
#
preparator(:target => 'REG', :mask => "XXXX0000") {
lui target, value(16, 31)
}
- Published in build set to 150619
- Status changed from Resolved to Closed
Also available in: Atom
PDF