Project

General

Profile

Actions

Task #6052

closed

Multiple preparators per mode (index range, value mask, etc.)

Added by Alexander Kamkin almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
Template Processor
Target version:
Start date:
06/16/2015
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
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.

Actions #1

Updated by Andrei Tatarnikov almost 9 years ago

  • 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)
}
Actions #2

Updated by Andrei Tatarnikov almost 9 years ago

  • Published in build set to 150619
Actions #3

Updated by Andrei Tatarnikov almost 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF