diff options
| author | Marcin Koscielnicki <koriakin@0x04.net> | 2016-07-10 14:41:22 +0000 |
|---|---|---|
| committer | Marcin Koscielnicki <koriakin@0x04.net> | 2016-07-10 14:41:22 +0000 |
| commit | cf7cc724a728e73e1b2c3258b0adb08326c802c1 (patch) | |
| tree | 78bafc61d804bc8e576ec0843b86d5d789fb81c9 /llvm/lib/Target/SystemZ/SystemZ.h | |
| parent | 303326541bab361acc5c1324b0a743a16aa3bae2 (diff) | |
| download | bcm5719-llvm-cf7cc724a728e73e1b2c3258b0adb08326c802c1.tar.gz bcm5719-llvm-cf7cc724a728e73e1b2c3258b0adb08326c802c1.zip | |
[SystemZ] Utilize Test Data Class instructions.
This adds a new SystemZ-specific intrinsic, llvm.s390.tdc.f(32|64|128),
which maps straight to the test data class instructions. A new IR pass
is added to recognize instructions that can be converted to TDC and
perform the necessary replacements.
Differential Revision: http://reviews.llvm.org/D21949
llvm-svn: 275016
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZ.h')
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZ.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZ.h b/llvm/lib/Target/SystemZ/SystemZ.h index cafe2c5948c..c8ea9641fb6 100644 --- a/llvm/lib/Target/SystemZ/SystemZ.h +++ b/llvm/lib/Target/SystemZ/SystemZ.h @@ -87,6 +87,11 @@ const unsigned CCMASK_VCMP_MIXED = CCMASK_1; const unsigned CCMASK_VCMP_NONE = CCMASK_3; const unsigned CCMASK_VCMP = CCMASK_0 | CCMASK_1 | CCMASK_3; +// Condition-code mask assignments for Test Data Class. +const unsigned CCMASK_TDC_NOMATCH = CCMASK_0; +const unsigned CCMASK_TDC_MATCH = CCMASK_1; +const unsigned CCMASK_TDC = CCMASK_TDC_NOMATCH | CCMASK_TDC_MATCH; + // The position of the low CC bit in an IPM result. const unsigned IPM_CC = 28; @@ -94,6 +99,41 @@ const unsigned IPM_CC = 28; const unsigned PFD_READ = 1; const unsigned PFD_WRITE = 2; +// Mask assignments for TDC +const unsigned TDCMASK_ZERO_PLUS = 0x800; +const unsigned TDCMASK_ZERO_MINUS = 0x400; +const unsigned TDCMASK_NORMAL_PLUS = 0x200; +const unsigned TDCMASK_NORMAL_MINUS = 0x100; +const unsigned TDCMASK_SUBNORMAL_PLUS = 0x080; +const unsigned TDCMASK_SUBNORMAL_MINUS = 0x040; +const unsigned TDCMASK_INFINITY_PLUS = 0x020; +const unsigned TDCMASK_INFINITY_MINUS = 0x010; +const unsigned TDCMASK_QNAN_PLUS = 0x008; +const unsigned TDCMASK_QNAN_MINUS = 0x004; +const unsigned TDCMASK_SNAN_PLUS = 0x002; +const unsigned TDCMASK_SNAN_MINUS = 0x001; + +const unsigned TDCMASK_ZERO = TDCMASK_ZERO_PLUS | TDCMASK_ZERO_MINUS; +const unsigned TDCMASK_POSITIVE = TDCMASK_NORMAL_PLUS | + TDCMASK_SUBNORMAL_PLUS | + TDCMASK_INFINITY_PLUS; +const unsigned TDCMASK_NEGATIVE = TDCMASK_NORMAL_MINUS | + TDCMASK_SUBNORMAL_MINUS | + TDCMASK_INFINITY_MINUS; +const unsigned TDCMASK_NAN = TDCMASK_QNAN_PLUS | + TDCMASK_QNAN_MINUS | + TDCMASK_SNAN_PLUS | + TDCMASK_SNAN_MINUS; +const unsigned TDCMASK_PLUS = TDCMASK_POSITIVE | + TDCMASK_ZERO_PLUS | + TDCMASK_QNAN_PLUS | + TDCMASK_SNAN_PLUS; +const unsigned TDCMASK_MINUS = TDCMASK_NEGATIVE | + TDCMASK_ZERO_MINUS | + TDCMASK_QNAN_MINUS | + TDCMASK_SNAN_MINUS; +const unsigned TDCMASK_ALL = TDCMASK_PLUS | TDCMASK_MINUS; + // Number of bits in a vector register. const unsigned VectorBits = 128; @@ -138,6 +178,7 @@ FunctionPass *createSystemZElimComparePass(SystemZTargetMachine &TM); FunctionPass *createSystemZShortenInstPass(SystemZTargetMachine &TM); FunctionPass *createSystemZLongBranchPass(SystemZTargetMachine &TM); FunctionPass *createSystemZLDCleanupPass(SystemZTargetMachine &TM); +FunctionPass *createSystemZTDCPass(); } // end namespace llvm #endif |

