1//==- SystemZInstrDFP.td - Floating-point SystemZ instructions -*- tblgen-*-==// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// The instructions in this file implement SystemZ decimal floating-point 11// arithmetic. These instructions are inot currently used for code generation, 12// are provided for use with the assembler and disassembler only. If LLVM 13// ever supports decimal floating-point types (_Decimal64 etc.), they can 14// also be used for code generation for those types. 15// 16//===----------------------------------------------------------------------===// 17 18//===----------------------------------------------------------------------===// 19// Move instructions 20//===----------------------------------------------------------------------===// 21 22// Load and test. 23let Defs = [CC] in { 24 def LTDTR : UnaryRRE<"ltdtr", 0xB3D6, null_frag, FP64, FP64>; 25 def LTXTR : UnaryRRE<"ltxtr", 0xB3DE, null_frag, FP128, FP128>; 26} 27 28 29//===----------------------------------------------------------------------===// 30// Conversion instructions 31//===----------------------------------------------------------------------===// 32 33// Convert floating-point values to narrower representations. The destination 34// of LDXTR is a 128-bit value, but only the first register of the pair is used. 35def LEDTR : TernaryRRFe<"ledtr", 0xB3D5, FP32, FP64>; 36def LDXTR : TernaryRRFe<"ldxtr", 0xB3DD, FP128, FP128>; 37 38// Extend floating-point values to wider representations. 39def LDETR : BinaryRRFd<"ldetr", 0xB3D4, FP64, FP32>; 40def LXDTR : BinaryRRFd<"lxdtr", 0xB3DC, FP128, FP64>; 41 42// Convert a signed integer value to a floating-point one. 43def CDGTR : UnaryRRE<"cdgtr", 0xB3F1, null_frag, FP64, GR64>; 44def CXGTR : UnaryRRE<"cxgtr", 0xB3F9, null_frag, FP128, GR64>; 45let Predicates = [FeatureFPExtension] in { 46 def CDGTRA : TernaryRRFe<"cdgtra", 0xB3F1, FP64, GR64>; 47 def CXGTRA : TernaryRRFe<"cxgtra", 0xB3F9, FP128, GR64>; 48 def CDFTR : TernaryRRFe<"cdftr", 0xB951, FP64, GR32>; 49 def CXFTR : TernaryRRFe<"cxftr", 0xB959, FP128, GR32>; 50} 51 52// Convert an unsigned integer value to a floating-point one. 53let Predicates = [FeatureFPExtension] in { 54 def CDLGTR : TernaryRRFe<"cdlgtr", 0xB952, FP64, GR64>; 55 def CXLGTR : TernaryRRFe<"cxlgtr", 0xB95A, FP128, GR64>; 56 def CDLFTR : TernaryRRFe<"cdlftr", 0xB953, FP64, GR32>; 57 def CXLFTR : TernaryRRFe<"cxlftr", 0xB95B, FP128, GR32>; 58} 59 60// Convert a floating-point value to a signed integer value. 61let Defs = [CC] in { 62 def CGDTR : BinaryRRFe<"cgdtr", 0xB3E1, GR64, FP64>; 63 def CGXTR : BinaryRRFe<"cgxtr", 0xB3E9, GR64, FP128>; 64 let Predicates = [FeatureFPExtension] in { 65 def CGDTRA : TernaryRRFe<"cgdtra", 0xB3E1, GR64, FP64>; 66 def CGXTRA : TernaryRRFe<"cgxtra", 0xB3E9, GR64, FP128>; 67 def CFDTR : TernaryRRFe<"cfdtr", 0xB941, GR32, FP64>; 68 def CFXTR : TernaryRRFe<"cfxtr", 0xB949, GR32, FP128>; 69 } 70} 71 72// Convert a floating-point value to an unsigned integer value. 73let Defs = [CC] in { 74 let Predicates = [FeatureFPExtension] in { 75 def CLGDTR : TernaryRRFe<"clgdtr", 0xB942, GR64, FP64>; 76 def CLGXTR : TernaryRRFe<"clgxtr", 0xB94A, GR64, FP128>; 77 def CLFDTR : TernaryRRFe<"clfdtr", 0xB943, GR32, FP64>; 78 def CLFXTR : TernaryRRFe<"clfxtr", 0xB94B, GR32, FP128>; 79 } 80} 81 82// Convert a packed value to a floating-point one. 83def CDSTR : UnaryRRE<"cdstr", 0xB3F3, null_frag, FP64, GR64>; 84def CXSTR : UnaryRRE<"cxstr", 0xB3FB, null_frag, FP128, GR128>; 85def CDUTR : UnaryRRE<"cdutr", 0xB3F2, null_frag, FP64, GR64>; 86def CXUTR : UnaryRRE<"cxutr", 0xB3FA, null_frag, FP128, GR128>; 87 88// Convert a floating-point value to a packed value. 89def CSDTR : BinaryRRFd<"csdtr", 0xB3E3, GR64, FP64>; 90def CSXTR : BinaryRRFd<"csxtr", 0xB3EB, GR128, FP128>; 91def CUDTR : UnaryRRE<"cudtr", 0xB3E2, null_frag, GR64, FP64>; 92def CUXTR : UnaryRRE<"cuxtr", 0xB3EA, null_frag, GR128, FP128>; 93 94// Convert from/to memory values in the zoned format. 95let Predicates = [FeatureDFPZonedConversion] in { 96 def CDZT : BinaryRSL<"cdzt", 0xEDAA, FP64>; 97 def CXZT : BinaryRSL<"cxzt", 0xEDAB, FP128>; 98 def CZDT : StoreBinaryRSL<"czdt", 0xEDA8, FP64>; 99 def CZXT : StoreBinaryRSL<"czxt", 0xEDA9, FP128>; 100} 101 102// Convert from/to memory values in the packed format. 103let Predicates = [FeatureDFPPackedConversion] in { 104 def CDPT : BinaryRSL<"cdpt", 0xEDAE, FP64>; 105 def CXPT : BinaryRSL<"cxpt", 0xEDAF, FP128>; 106 def CPDT : StoreBinaryRSL<"cpdt", 0xEDAC, FP64>; 107 def CPXT : StoreBinaryRSL<"cpxt", 0xEDAD, FP128>; 108} 109 110// Perform floating-point operation. 111let Defs = [CC, R1L, F0Q], Uses = [R0L, F4Q] in 112 def PFPO : SideEffectInherentE<"pfpo", 0x010A>; 113 114 115//===----------------------------------------------------------------------===// 116// Unary arithmetic 117//===----------------------------------------------------------------------===// 118 119// Round to an integer, with the second operand (M3) specifying the rounding 120// mode. M4 can be set to 4 to suppress detection of inexact conditions. 121def FIDTR : TernaryRRFe<"fidtr", 0xB3D7, FP64, FP64>; 122def FIXTR : TernaryRRFe<"fixtr", 0xB3DF, FP128, FP128>; 123 124// Extract biased exponent. 125def EEDTR : UnaryRRE<"eedtr", 0xB3E5, null_frag, FP64, FP64>; 126def EEXTR : UnaryRRE<"eextr", 0xB3ED, null_frag, FP128, FP128>; 127 128// Extract significance. 129def ESDTR : UnaryRRE<"esdtr", 0xB3E7, null_frag, FP64, FP64>; 130def ESXTR : UnaryRRE<"esxtr", 0xB3EF, null_frag, FP128, FP128>; 131 132 133//===----------------------------------------------------------------------===// 134// Binary arithmetic 135//===----------------------------------------------------------------------===// 136 137// Addition. 138let Defs = [CC] in { 139 let isCommutable = 1 in { 140 def ADTR : BinaryRRFa<"adtr", 0xB3D2, null_frag, FP64, FP64, FP64>; 141 def AXTR : BinaryRRFa<"axtr", 0xB3DA, null_frag, FP128, FP128, FP128>; 142 } 143 let Predicates = [FeatureFPExtension] in { 144 def ADTRA : TernaryRRFa<"adtra", 0xB3D2, FP64, FP64, FP64>; 145 def AXTRA : TernaryRRFa<"axtra", 0xB3DA, FP128, FP128, FP128>; 146 } 147} 148 149// Subtraction. 150let Defs = [CC] in { 151 def SDTR : BinaryRRFa<"sdtr", 0xB3D3, null_frag, FP64, FP64, FP64>; 152 def SXTR : BinaryRRFa<"sxtr", 0xB3DB, null_frag, FP128, FP128, FP128>; 153 let Predicates = [FeatureFPExtension] in { 154 def SDTRA : TernaryRRFa<"sdtra", 0xB3D3, FP64, FP64, FP64>; 155 def SXTRA : TernaryRRFa<"sxtra", 0xB3DB, FP128, FP128, FP128>; 156 } 157} 158 159// Multiplication. 160let isCommutable = 1 in { 161 def MDTR : BinaryRRFa<"mdtr", 0xB3D0, null_frag, FP64, FP64, FP64>; 162 def MXTR : BinaryRRFa<"mxtr", 0xB3D8, null_frag, FP128, FP128, FP128>; 163} 164let Predicates = [FeatureFPExtension] in { 165 def MDTRA : TernaryRRFa<"mdtra", 0xB3D0, FP64, FP64, FP64>; 166 def MXTRA : TernaryRRFa<"mxtra", 0xB3D8, FP128, FP128, FP128>; 167} 168 169// Division. 170def DDTR : BinaryRRFa<"ddtr", 0xB3D1, null_frag, FP64, FP64, FP64>; 171def DXTR : BinaryRRFa<"dxtr", 0xB3D9, null_frag, FP128, FP128, FP128>; 172let Predicates = [FeatureFPExtension] in { 173 def DDTRA : TernaryRRFa<"ddtra", 0xB3D1, FP64, FP64, FP64>; 174 def DXTRA : TernaryRRFa<"dxtra", 0xB3D9, FP128, FP128, FP128>; 175} 176 177// Quantize. 178def QADTR : TernaryRRFb<"qadtr", 0xB3F5, FP64, FP64, FP64>; 179def QAXTR : TernaryRRFb<"qaxtr", 0xB3FD, FP128, FP128, FP128>; 180 181// Reround. 182def RRDTR : TernaryRRFb<"rrdtr", 0xB3F7, FP64, FP64, FP64>; 183def RRXTR : TernaryRRFb<"rrxtr", 0xB3FF, FP128, FP128, FP128>; 184 185// Shift significand left/right. 186def SLDT : BinaryRXF<"sldt", 0xED40, null_frag, FP64, FP64, null_frag, 0>; 187def SLXT : BinaryRXF<"slxt", 0xED48, null_frag, FP128, FP128, null_frag, 0>; 188def SRDT : BinaryRXF<"srdt", 0xED41, null_frag, FP64, FP64, null_frag, 0>; 189def SRXT : BinaryRXF<"srxt", 0xED49, null_frag, FP128, FP128, null_frag, 0>; 190 191// Insert biased exponent. 192def IEDTR : BinaryRRFb<"iedtr", 0xB3F6, null_frag, FP64, FP64, FP64>; 193def IEXTR : BinaryRRFb<"iextr", 0xB3FE, null_frag, FP128, FP128, FP128>; 194 195 196//===----------------------------------------------------------------------===// 197// Comparisons 198//===----------------------------------------------------------------------===// 199 200// Compare. 201let Defs = [CC] in { 202 def CDTR : CompareRRE<"cdtr", 0xB3E4, null_frag, FP64, FP64>; 203 def CXTR : CompareRRE<"cxtr", 0xB3EC, null_frag, FP128, FP128>; 204} 205 206// Compare and signal. 207let Defs = [CC] in { 208 def KDTR : CompareRRE<"kdtr", 0xB3E0, null_frag, FP64, FP64>; 209 def KXTR : CompareRRE<"kxtr", 0xB3E8, null_frag, FP128, FP128>; 210} 211 212// Compare biased exponent. 213let Defs = [CC] in { 214 def CEDTR : CompareRRE<"cedtr", 0xB3F4, null_frag, FP64, FP64>; 215 def CEXTR : CompareRRE<"cextr", 0xB3FC, null_frag, FP128, FP128>; 216} 217 218// Test Data Class. 219let Defs = [CC] in { 220 def TDCET : TestRXE<"tdcet", 0xED50, null_frag, FP32>; 221 def TDCDT : TestRXE<"tdcdt", 0xED54, null_frag, FP64>; 222 def TDCXT : TestRXE<"tdcxt", 0xED58, null_frag, FP128>; 223} 224 225// Test Data Group. 226let Defs = [CC] in { 227 def TDGET : TestRXE<"tdget", 0xED51, null_frag, FP32>; 228 def TDGDT : TestRXE<"tdgdt", 0xED55, null_frag, FP64>; 229 def TDGXT : TestRXE<"tdgxt", 0xED59, null_frag, FP128>; 230} 231 232