summaryrefslogtreecommitdiffstats
path: root/llvm/docs/TableGen
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2014-07-17 17:04:27 +0000
committerAdam Nemet <anemet@apple.com>2014-07-17 17:04:27 +0000
commit017fca0272cebfbf84182d0c49cbce1c3e926905 (patch)
treea7445bb5b262b0e8fa813bcda8816398e077c24e /llvm/docs/TableGen
parente5a1173f67f8bf56bc1df93b8c4fd49e8ed69994 (diff)
downloadbcm5719-llvm-017fca0272cebfbf84182d0c49cbce1c3e926905.tar.gz
bcm5719-llvm-017fca0272cebfbf84182d0c49cbce1c3e926905.zip
[TableGen] Allow shift operators to take bits<n>
Convert the operand to int if possible, i.e. if the value is properly initialized. (I suppose there is further room for improvement here to also peform the shift if the uninitialized bits are shifted out.) With this little change we can now compute the scaling factor for compressed displacement with pure tablegen code in the X86 backend. This is useful because both the X86-disassembler-specific part of tablegen and the assembler need this and TD is the natural sharing place. The patch also adds the missing documentation for the shift and add operator. llvm-svn: 213277
Diffstat (limited to 'llvm/docs/TableGen')
-rw-r--r--llvm/docs/TableGen/LangIntro.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/docs/TableGen/LangIntro.rst b/llvm/docs/TableGen/LangIntro.rst
index 3e74dffb00e..0f8b3f62136 100644
--- a/llvm/docs/TableGen/LangIntro.rst
+++ b/llvm/docs/TableGen/LangIntro.rst
@@ -208,6 +208,12 @@ supported include:
on string, int and bit objects. Use !cast<string> to compare other types of
objects.
+``!shl(a,b)``
+``!srl(a,b)``
+``!sra(a,b)``
+``!add(a,b)``
+ The usual logical and arithmetic operators.
+
Note that all of the values have rules specifying how they convert to values
for different types. These rules allow you to assign a value like "``7``"
to a "``bits<4>``" value, for example.
OpenPOWER on IntegriCloud