diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-09-06 14:15:52 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-09-06 14:15:52 +0000 |
commit | 6d3d7656539188b496089a3313ed4d13759adba3 (patch) | |
tree | 2167b65519599cb776e3b40c2236c607c476f522 /include/llvm/Target/Target.td | |
parent | 4178946afba97a9a432a33ab1596f49a1ac090e7 (diff) | |
download | llvm-6d3d7656539188b496089a3313ed4d13759adba3.tar.gz llvm-6d3d7656539188b496089a3313ed4d13759adba3.tar.bz2 llvm-6d3d7656539188b496089a3313ed4d13759adba3.tar.xz |
Tablegen: Add OperandWithDefaultOps Operand type
This Operand type takes a default argument, and is initialized to
this value if it does not appear in a patter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
-rw-r--r-- | include/llvm/Target/Target.td | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 52b491d434..87bd84ec84 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -602,23 +602,31 @@ def f64imm : Operand<f64>; /// def zero_reg; +/// OperandWithDefaultOps - This Operand class can be used as the parent class +/// for an Operand that needs to be initialized with a default value if +/// no value is supplied in a pattern. This class can be used to simplify the +/// pattern definitions for instructions that have target specific flags +/// encoded as immediate operands. +class OperandWithDefaultOps<ValueType ty, dag defaultops> + : Operand<ty> { + dag DefaultOps = defaultops; +} + /// PredicateOperand - This can be used to define a predicate operand for an /// instruction. OpTypes specifies the MIOperandInfo for the operand, and /// AlwaysVal specifies the value of this predicate when set to "always /// execute". class PredicateOperand<ValueType ty, dag OpTypes, dag AlwaysVal> - : Operand<ty> { + : OperandWithDefaultOps<ty, AlwaysVal> { let MIOperandInfo = OpTypes; - dag DefaultOps = AlwaysVal; } /// OptionalDefOperand - This is used to define a optional definition operand /// for an instruction. DefaultOps is the register the operand represents if /// none is supplied, e.g. zero_reg. class OptionalDefOperand<ValueType ty, dag OpTypes, dag defaultops> - : Operand<ty> { + : OperandWithDefaultOps<ty, defaultops> { let MIOperandInfo = OpTypes; - dag DefaultOps = defaultops; } |