summaryrefslogtreecommitdiff
path: root/include/llvm/Target/Target.td
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-12-19 16:12:53 +0000
committerHal Finkel <hfinkel@anl.gov>2013-12-19 16:12:53 +0000
commitd715c3e9ac0c7e2e02b7f24821dd5df68f1c9a3c (patch)
tree2f46db261cdf7a4cf972946599bb4d16554b0d6f /include/llvm/Target/Target.td
parentafe1c6b96d2a62fdb656e8c1689005c4a4a1e481 (diff)
downloadllvm-d715c3e9ac0c7e2e02b7f24821dd5df68f1c9a3c.tar.gz
llvm-d715c3e9ac0c7e2e02b7f24821dd5df68f1c9a3c.tar.bz2
llvm-d715c3e9ac0c7e2e02b7f24821dd5df68f1c9a3c.tar.xz
Add support for positionally-encoded operands to FixedLenDecoderEmitter
Unfortunately, the PowerPC instruction definitions make heavy use of the positional operand encoding heuristic to map operands onto bitfield variables in the instruction definitions. Changing this to use name-based mapping is not trivial, however, because additional infrastructure needs to be designed to handle mapping of complex operands (with multiple suboperands) onto multiple bitfield variables. In the mean time, this adds support for positionally encoded operands to FixedLenDecoderEmitter, so that we can generate a disassembler for the PowerPC backend. To prevent an accidental reliance on this feature, and to prevent an undesirable interaction with existing disassemblers, a backend must opt-in to this support by setting the new decodePositionallyEncodedOperands instruction-set bit to true. When enabled, this iterates the variables that contribute to the instruction encoding, just as the encoder does, and emulates the procedure the encoder uses to map "numbered" operands to variables. The bit range for each variable is also determined as the encoder determines them. This map is then consulted during the decoder-generator's loop over operands to decode, allowing the decoder to understand both position-based and name-based operand-to-variable mappings. As noted in the comment on the decodePositionallyEncodedOperands definition, this support should be removed once it is no longer needed. There should be no change to existing disassemblers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
-rw-r--r--include/llvm/Target/Target.td12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td
index bceda5f204..31da7ebca4 100644
--- a/include/llvm/Target/Target.td
+++ b/include/llvm/Target/Target.td
@@ -685,6 +685,18 @@ class InstrInfo {
//
// This option is a temporary migration help. It will go away.
bit guessInstructionProperties = 1;
+
+ // TableGen's instruction encoder generator has support for matching operands
+ // to bit-field variables both by name and by position. While matching by
+ // name is preferred, this is currently not possible for complex operands,
+ // and some targets still reply on the positional encoding rules. When
+ // generating a decoder for such targets, the positional encoding rules must
+ // be used by the decoder generator as well.
+ //
+ // This option is temporary; it will go away once the TableGen decoder
+ // generator has better support for complex operands and targets have
+ // migrated away from using positionally encoded operands.
+ bit decodePositionallyEncodedOperands = 0;
}
// Standard Pseudo Instructions.