diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-16 11:21:54 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-08-16 11:21:54 +0000 |
commit | e1b2af731e2a45344a7c502232f66c55cd746da0 (patch) | |
tree | bb6a3377594da6a0b30e8179e071137324d5cf69 /lib/Target/SystemZ/SystemZInstrFormats.td | |
parent | 6a079fef4fad3e6c2e07c9e1d0776e20a0b05b1e (diff) | |
download | external_llvm-e1b2af731e2a45344a7c502232f66c55cd746da0.zip external_llvm-e1b2af731e2a45344a7c502232f66c55cd746da0.tar.gz external_llvm-e1b2af731e2a45344a7c502232f66c55cd746da0.tar.bz2 |
[SystemZ] Use CLST to implement strcmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZInstrFormats.td')
-rw-r--r-- | lib/Target/SystemZ/SystemZInstrFormats.td | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZInstrFormats.td b/lib/Target/SystemZ/SystemZInstrFormats.td index 2d18e03..1f80c27 100644 --- a/lib/Target/SystemZ/SystemZInstrFormats.td +++ b/lib/Target/SystemZ/SystemZInstrFormats.td @@ -1405,3 +1405,23 @@ multiclass MemorySS<string mnemonic, bits<8> opcode, [(operator bdaddr12only:$dest, bdaddr12only:$src, imm32len8:$length)]>; } + +// Define an instruction that operates on two strings, both terminated +// by the character in R0. The instruction processes a CPU-determinated +// number of bytes at a time and sets CC to 3 if the instruction needs +// to be repeated. Also define a pseudo instruction that represents +// the full loop (the main instruction plus the branch on CC==3). +multiclass StringRRE<string mnemonic, bits<16> opcode, + SDPatternOperator operator> { + def "" : InstRRE<opcode, (outs GR64:$R1, GR64:$R2), + (ins GR64:$R1src, GR64:$R2src), + mnemonic#"\t$R1, $R2", []> { + let Constraints = "$R1 = $R1src, $R2 = $R2src"; + let DisableEncoding = "$R1src, $R2src"; + } + let usesCustomInserter = 1 in + def Loop : Pseudo<(outs GR64:$end), + (ins GR64:$start1, GR64:$start2, GR32:$char), + [(set GR64:$end, (operator GR64:$start1, GR64:$start2, + GR32:$char))]>; +} |