[a32b204] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
[a436947] | 7 | // CommonType.cc -- |
---|
[a32b204] | 8 | // |
---|
| 9 | // Author : Richard C. Bilson |
---|
| 10 | // Created On : Sun May 17 06:59:27 2015 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[ada4575] | 12 | // Last Modified On : Thu Feb 14 17:10:10 2019 |
---|
| 13 | // Update Count : 24 |
---|
[a32b204] | 14 | // |
---|
[51b7345] | 15 | |
---|
[e3e16bc] | 16 | #include <cassert> // for strict_dynamic_cast |
---|
[ea6332d] | 17 | #include <map> // for _Rb_tree_const_iterator |
---|
| 18 | #include <utility> // for pair |
---|
| 19 | |
---|
[53452de] | 20 | #include "Common/PassVisitor.h" |
---|
[ea6332d] | 21 | #include "ResolvExpr/TypeEnvironment.h" // for OpenVarSet, AssertionSet |
---|
| 22 | #include "SymTab/Indexer.h" // for Indexer |
---|
| 23 | #include "SynTree/Declaration.h" // for TypeDecl, NamedTypeDecl (ptr... |
---|
| 24 | #include "SynTree/Type.h" // for BasicType, BasicType::Kind::... |
---|
| 25 | #include "SynTree/Visitor.h" // for Visitor |
---|
[d286cf68] | 26 | #include "Unify.h" // for unifyExact, WidenMode |
---|
[ea6332d] | 27 | #include "typeops.h" // for isFtype |
---|
[51b7345] | 28 | |
---|
[ba89e9b7] | 29 | // #define DEBUG |
---|
[9d1e3f7] | 30 | #ifdef DEBUG |
---|
| 31 | #define PRINT(x) x |
---|
| 32 | #else |
---|
| 33 | #define PRINT(x) |
---|
| 34 | #endif |
---|
[51b7345] | 35 | |
---|
| 36 | namespace ResolvExpr { |
---|
[53452de] | 37 | struct CommonType : public WithShortCircuiting { |
---|
[a32b204] | 38 | CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ); |
---|
| 39 | Type *get_result() const { return result; } |
---|
| 40 | |
---|
[53452de] | 41 | void previsit( BaseSyntaxNode * ) { visit_children = false; } |
---|
| 42 | |
---|
| 43 | void postvisit( VoidType * voidType ); |
---|
| 44 | void postvisit( BasicType * basicType ); |
---|
| 45 | void postvisit( PointerType * pointerType ); |
---|
| 46 | void postvisit( ArrayType * arrayType ); |
---|
| 47 | void postvisit( ReferenceType * refType ); |
---|
| 48 | void postvisit( FunctionType * functionType ); |
---|
| 49 | void postvisit( StructInstType * aggregateUseType ); |
---|
| 50 | void postvisit( UnionInstType * aggregateUseType ); |
---|
| 51 | void postvisit( EnumInstType * aggregateUseType ); |
---|
| 52 | void postvisit( TraitInstType * aggregateUseType ); |
---|
| 53 | void postvisit( TypeInstType * aggregateUseType ); |
---|
| 54 | void postvisit( TupleType * tupleType ); |
---|
| 55 | void postvisit( VarArgsType * varArgsType ); |
---|
| 56 | void postvisit( ZeroType * zeroType ); |
---|
| 57 | void postvisit( OneType * oneType ); |
---|
| 58 | |
---|
| 59 | private: |
---|
[65cec25] | 60 | template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); |
---|
| 61 | template< typename RefType > void handleRefType( RefType *inst, Type *other ); |
---|
[a32b204] | 62 | |
---|
| 63 | Type *result; |
---|
| 64 | Type *type2; // inherited |
---|
| 65 | bool widenFirst, widenSecond; |
---|
| 66 | const SymTab::Indexer &indexer; |
---|
| 67 | TypeEnvironment &env; |
---|
| 68 | const OpenVarSet &openVars; |
---|
| 69 | }; |
---|
| 70 | |
---|
[000178a] | 71 | Type * handleReference( Type * t1, Type * t2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) { |
---|
| 72 | Type * common = nullptr; |
---|
[65cec25] | 73 | AssertionSet have, need; |
---|
| 74 | OpenVarSet newOpen( openVars ); |
---|
| 75 | // need unify to bind type variables |
---|
[000178a] | 76 | if ( unify( t1, t2, env, have, need, newOpen, indexer, common ) ) { |
---|
[9d1e3f7] | 77 | PRINT( |
---|
| 78 | std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl; |
---|
| 79 | ) |
---|
[000178a] | 80 | if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) { |
---|
[9d1e3f7] | 81 | PRINT( |
---|
| 82 | std::cerr << "widen okay" << std::endl; |
---|
| 83 | ) |
---|
[000178a] | 84 | common->get_qualifiers() |= t1->get_qualifiers(); |
---|
| 85 | common->get_qualifiers() |= t2->get_qualifiers(); |
---|
| 86 | return common; |
---|
[65cec25] | 87 | } |
---|
| 88 | } |
---|
[9d1e3f7] | 89 | PRINT( |
---|
| 90 | std::cerr << "exact unify failed: " << t1 << " " << t2 << std::endl; |
---|
| 91 | ) |
---|
[000178a] | 92 | return nullptr; |
---|
[65cec25] | 93 | } |
---|
| 94 | |
---|
[a32b204] | 95 | Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { |
---|
[53452de] | 96 | PassVisitor<CommonType> visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); |
---|
[65cec25] | 97 | |
---|
[e6cee92] | 98 | int depth1 = type1->referenceDepth(); |
---|
| 99 | int depth2 = type2->referenceDepth(); |
---|
| 100 | if ( depth1 > 0 || depth2 > 0 ) { |
---|
| 101 | int diff = depth1-depth2; |
---|
| 102 | // TODO: should it be possible for commonType to generate complicated conversions? I would argue no, only conversions that involve types of the same reference level or a difference of 1 should be allowed. |
---|
[ba89e9b7] | 103 | // if ( diff > 1 || diff < -1 ) return nullptr; |
---|
[e6cee92] | 104 | |
---|
| 105 | // special case where one type has a reference depth of 1 larger than the other |
---|
[000178a] | 106 | if ( diff > 0 || diff < 0 ) { |
---|
[9d1e3f7] | 107 | PRINT( |
---|
| 108 | std::cerr << "reference depth diff: " << diff << std::endl; |
---|
| 109 | ) |
---|
[000178a] | 110 | Type * result = nullptr; |
---|
[74cdfb1] | 111 | ReferenceType * ref1 = dynamic_cast< ReferenceType * >( type1 ); |
---|
| 112 | ReferenceType * ref2 = dynamic_cast< ReferenceType * >( type2 ); |
---|
| 113 | if ( diff > 0 ) { |
---|
| 114 | // deeper on the left |
---|
| 115 | assert( ref1 ); |
---|
[000178a] | 116 | result = handleReference( ref1->base, type2, widenFirst, widenSecond, indexer, env, openVars ); |
---|
| 117 | } else { |
---|
[74cdfb1] | 118 | // deeper on the right |
---|
| 119 | assert( ref2 ); |
---|
[000178a] | 120 | result = handleReference( type1, ref2->base, widenFirst, widenSecond, indexer, env, openVars ); |
---|
| 121 | } |
---|
[74cdfb1] | 122 | if ( result && ref1 ) { |
---|
| 123 | // formal is reference, so result should be reference |
---|
[9d1e3f7] | 124 | PRINT( |
---|
| 125 | std::cerr << "formal is reference; result should be reference" << std::endl; |
---|
| 126 | ) |
---|
[74cdfb1] | 127 | result = new ReferenceType( ref1->get_qualifiers(), result ); |
---|
| 128 | } |
---|
[9d1e3f7] | 129 | PRINT( |
---|
| 130 | std::cerr << "common type of reference [" << type1 << "] and [" << type2 << "] is [" << result << "]" << std::endl; |
---|
| 131 | ) |
---|
[000178a] | 132 | return result; |
---|
[65cec25] | 133 | } |
---|
[e6cee92] | 134 | // otherwise, both are reference types of the same depth and this is handled by the CommonType visitor. |
---|
[65cec25] | 135 | } |
---|
| 136 | |
---|
[a32b204] | 137 | type1->accept( visitor ); |
---|
[53452de] | 138 | Type *result = visitor.pass.get_result(); |
---|
[a32b204] | 139 | if ( ! result ) { |
---|
[2c57025] | 140 | // this appears to be handling for opaque type declarations |
---|
[a32b204] | 141 | if ( widenSecond ) { |
---|
[2c57025] | 142 | if ( TypeInstType *inst = dynamic_cast< TypeInstType* >( type2 ) ) { |
---|
| 143 | if ( NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ) ) { |
---|
[e3e16bc] | 144 | TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt ); |
---|
[a32b204] | 145 | if ( type->get_base() ) { |
---|
| 146 | Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers(); |
---|
| 147 | AssertionSet have, need; |
---|
| 148 | OpenVarSet newOpen( openVars ); |
---|
| 149 | type1->get_qualifiers() = Type::Qualifiers(); |
---|
| 150 | type->get_base()->get_qualifiers() = tq1; |
---|
| 151 | if ( unifyExact( type1, type->get_base(), env, have, need, newOpen, indexer ) ) { |
---|
| 152 | result = type1->clone(); |
---|
[6f95000] | 153 | result->get_qualifiers() = tq1 | tq2; |
---|
[a32b204] | 154 | } // if |
---|
| 155 | type1->get_qualifiers() = tq1; |
---|
| 156 | type->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 157 | } // if |
---|
| 158 | } // if |
---|
| 159 | } // if |
---|
| 160 | } // if |
---|
| 161 | } // if |
---|
[51b7345] | 162 | #ifdef DEBUG |
---|
[c93bc28] | 163 | std::cerr << "============= commonType" << std::endl << "type1 is "; |
---|
| 164 | type1->print( std::cerr ); |
---|
| 165 | std::cerr << " type2 is "; |
---|
| 166 | type2->print( std::cerr ); |
---|
[a32b204] | 167 | if ( result ) { |
---|
[c93bc28] | 168 | std::cerr << " common type is "; |
---|
| 169 | result->print( std::cerr ); |
---|
[a32b204] | 170 | } else { |
---|
[c93bc28] | 171 | std::cerr << " no common type"; |
---|
[a32b204] | 172 | } // if |
---|
[c93bc28] | 173 | std::cerr << std::endl; |
---|
[51b7345] | 174 | #endif |
---|
[a32b204] | 175 | return result; |
---|
| 176 | } |
---|
[cdcddfe1] | 177 | |
---|
[e15853c] | 178 | // GENERATED START, DO NOT EDIT |
---|
[6fd1955] | 179 | // GENERATED BY BasicTypes-gen.cc |
---|
[e15853c] | 180 | #define BT BasicType:: |
---|
| 181 | static const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor |
---|
[96df1329] | 182 | /* B C SC UC SI SUI |
---|
| 183 | I UI LI LUI LLI LLUI |
---|
| 184 | IB UIB _FH _FH _F _FC |
---|
| 185 | F FC _FX _FXC FD _FDC |
---|
| 186 | D DC F80X _FDXC F80 _FB |
---|
| 187 | _FLDC FB LD LDC _FBX _FLDXC |
---|
| 188 | */ |
---|
| 189 | { |
---|
| 190 | /* B*/ BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 191 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 192 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 193 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 194 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 195 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 196 | }, |
---|
| 197 | { |
---|
| 198 | /* C*/ BT Char, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 199 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 200 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 201 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 202 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 203 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 204 | }, |
---|
| 205 | { |
---|
| 206 | /* SC*/ BT SignedChar, BT SignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 207 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 208 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 209 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 210 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 211 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 212 | }, |
---|
| 213 | { |
---|
| 214 | /* UC*/ BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 215 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 216 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 217 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 218 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 219 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 220 | }, |
---|
| 221 | { |
---|
| 222 | /* SI*/ BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 223 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 224 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 225 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 226 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 227 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 228 | }, |
---|
| 229 | { |
---|
| 230 | /* SUI*/ BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, |
---|
| 231 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 232 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 233 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 234 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 235 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 236 | }, |
---|
| 237 | { |
---|
| 238 | /* I*/ BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, |
---|
| 239 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 240 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 241 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 242 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 243 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 244 | }, |
---|
| 245 | { |
---|
| 246 | /* UI*/ BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, |
---|
| 247 | BT UnsignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 248 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 249 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 250 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 251 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 252 | }, |
---|
| 253 | { |
---|
| 254 | /* LI*/ BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, |
---|
| 255 | BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 256 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 257 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 258 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 259 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 260 | }, |
---|
| 261 | { |
---|
| 262 | /* LUI*/ BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, |
---|
| 263 | BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 264 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 265 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 266 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 267 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 268 | }, |
---|
| 269 | { |
---|
| 270 | /* LLI*/ BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, |
---|
| 271 | BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 272 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 273 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 274 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 275 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 276 | }, |
---|
| 277 | { |
---|
| 278 | /* LLUI*/ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, |
---|
| 279 | BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, |
---|
| 280 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 281 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 282 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 283 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 284 | }, |
---|
| 285 | { |
---|
| 286 | /* IB*/ BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, |
---|
| 287 | BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, |
---|
| 288 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 289 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 290 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 291 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 292 | }, |
---|
| 293 | { |
---|
| 294 | /* UIB*/ BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, |
---|
| 295 | BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, |
---|
| 296 | BT UnsignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 297 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 298 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 299 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 300 | }, |
---|
| 301 | { |
---|
| 302 | /* _FH*/ BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, |
---|
| 303 | BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, |
---|
| 304 | BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 305 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 306 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 307 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 308 | }, |
---|
| 309 | { |
---|
| 310 | /* _FH*/ BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, |
---|
| 311 | BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, |
---|
| 312 | BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 313 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 314 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 315 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 316 | }, |
---|
| 317 | { |
---|
| 318 | /* _F*/ BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, |
---|
| 319 | BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, |
---|
| 320 | BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 321 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 322 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 323 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 324 | }, |
---|
| 325 | { |
---|
| 326 | /* _FC*/ BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 327 | BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 328 | BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 329 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 330 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 331 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 332 | }, |
---|
| 333 | { |
---|
| 334 | /* F*/ BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, |
---|
| 335 | BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, |
---|
| 336 | BT Float, BT Float, BT Float, BT FloatComplex, BT Float, BT FloatComplex, |
---|
| 337 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 338 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 339 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 340 | }, |
---|
| 341 | { |
---|
| 342 | /* FC*/ BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 343 | BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 344 | BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 345 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 346 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 347 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 348 | }, |
---|
| 349 | { |
---|
| 350 | /* _FX*/ BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, |
---|
| 351 | BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, |
---|
| 352 | BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, |
---|
| 353 | BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 354 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 355 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 356 | }, |
---|
| 357 | { |
---|
| 358 | /* _FXC*/ BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 359 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 360 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 361 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 362 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 363 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 364 | }, |
---|
| 365 | { |
---|
| 366 | /* FD*/ BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, |
---|
| 367 | BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, |
---|
| 368 | BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, |
---|
| 369 | BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, |
---|
| 370 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 371 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 372 | }, |
---|
| 373 | { |
---|
| 374 | /* _FDC*/ BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 375 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 376 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 377 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 378 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 379 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 380 | }, |
---|
| 381 | { |
---|
| 382 | /* D*/ BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, |
---|
| 383 | BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, |
---|
| 384 | BT Double, BT Double, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, |
---|
| 385 | BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, |
---|
| 386 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 387 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 388 | }, |
---|
| 389 | { |
---|
| 390 | /* DC*/ BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 391 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 392 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 393 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 394 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 395 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 396 | }, |
---|
| 397 | { |
---|
| 398 | /* F80X*/ BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, |
---|
| 399 | BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, |
---|
| 400 | BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, |
---|
| 401 | BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, |
---|
| 402 | BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 403 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 404 | }, |
---|
| 405 | { |
---|
| 406 | /* _FDXC*/ BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 407 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 408 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 409 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 410 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 411 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 412 | }, |
---|
| 413 | { |
---|
| 414 | /* F80*/ BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, |
---|
| 415 | BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, |
---|
| 416 | BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, |
---|
| 417 | BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, |
---|
| 418 | BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 419 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 420 | }, |
---|
| 421 | { |
---|
| 422 | /* _FB*/ BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, |
---|
| 423 | BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, |
---|
| 424 | BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, |
---|
| 425 | BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, |
---|
| 426 | BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128, |
---|
| 427 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 428 | }, |
---|
| 429 | { |
---|
| 430 | /* _FLDC*/ BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 431 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 432 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 433 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 434 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 435 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 436 | }, |
---|
| 437 | { |
---|
| 438 | /* FB*/ BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, |
---|
| 439 | BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, |
---|
| 440 | BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, |
---|
| 441 | BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, |
---|
| 442 | BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uuFloat128, |
---|
| 443 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 444 | }, |
---|
| 445 | { |
---|
| 446 | /* LD*/ BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, |
---|
| 447 | BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, |
---|
| 448 | BT LongDouble, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, |
---|
| 449 | BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, |
---|
| 450 | BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDouble, |
---|
| 451 | BT LongDoubleComplex, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 452 | }, |
---|
| 453 | { |
---|
| 454 | /* LDC*/ BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 455 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 456 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 457 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 458 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 459 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 460 | }, |
---|
| 461 | { |
---|
| 462 | /* _FBX*/ BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, |
---|
| 463 | BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, |
---|
| 464 | BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 465 | BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 466 | BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, |
---|
| 467 | BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 468 | }, |
---|
| 469 | { |
---|
| 470 | /*_FLDXC*/ BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 471 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 472 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 473 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 474 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 475 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 476 | }, |
---|
[fd9ae1d] | 477 | }; // commonTypes |
---|
[e15853c] | 478 | #undef BT |
---|
| 479 | // GENERATED END |
---|
[4ee3b0c1] | 480 | static_assert( |
---|
[cdcddfe1] | 481 | sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, |
---|
[4ee3b0c1] | 482 | "Each basic type kind should have a corresponding row in the combined type matrix" |
---|
| 483 | ); |
---|
[a32b204] | 484 | |
---|
| 485 | CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) |
---|
| 486 | : result( 0 ), type2( type2 ), widenFirst( widenFirst ), widenSecond( widenSecond ), indexer( indexer ), env( env ), openVars( openVars ) { |
---|
| 487 | } |
---|
| 488 | |
---|
[53452de] | 489 | void CommonType::postvisit( VoidType * ) {} |
---|
[a32b204] | 490 | |
---|
[53452de] | 491 | void CommonType::postvisit( BasicType *basicType ) { |
---|
[a32b204] | 492 | if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { |
---|
[cdcddfe1] | 493 | BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ otherBasic->get_kind() ]; |
---|
[a32b204] | 494 | if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) { |
---|
[6f95000] | 495 | result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType ); |
---|
[a32b204] | 496 | } // if |
---|
[89e6ffc] | 497 | } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { |
---|
| 498 | // use signed int in lieu of the enum/zero/one type |
---|
[cdcddfe1] | 499 | BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ BasicType::SignedInt ]; |
---|
[89e6ffc] | 500 | if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) { |
---|
[6f95000] | 501 | result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType ); |
---|
[a436947] | 502 | } // if |
---|
[a32b204] | 503 | } // if |
---|
| 504 | } |
---|
| 505 | |
---|
[65cec25] | 506 | template< typename Pointer > |
---|
| 507 | void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) { |
---|
[a2a77af] | 508 | if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) { |
---|
| 509 | OpenVarSet::const_iterator entry = openVars.find( var->get_name() ); |
---|
| 510 | if ( entry != openVars.end() ) { |
---|
| 511 | AssertionSet need, have; |
---|
| 512 | WidenMode widen( widenFirst, widenSecond ); |
---|
[d286cf68] | 513 | if ( entry != openVars.end() && ! env.bindVar(var, voidPointer->get_base(), entry->second, need, have, openVars, widen, indexer ) ) return; |
---|
[a2a77af] | 514 | } |
---|
[2c57025] | 515 | } |
---|
[a2a77af] | 516 | result = voidPointer->clone(); |
---|
[6f95000] | 517 | result->get_qualifiers() |= otherPointer->get_qualifiers(); |
---|
[2c57025] | 518 | } |
---|
| 519 | |
---|
[53452de] | 520 | void CommonType::postvisit( PointerType *pointerType ) { |
---|
[a32b204] | 521 | if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { |
---|
[c93bc28] | 522 | // std::cerr << "commonType: two pointers: " << pointerType << " / " << otherPointer << std::endl; |
---|
[d7dc824] | 523 | if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base()) ) { |
---|
[a2a77af] | 524 | getCommonWithVoidPointer( otherPointer, pointerType ); |
---|
[d7dc824] | 525 | } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base()) ) { |
---|
[a2a77af] | 526 | getCommonWithVoidPointer( pointerType, otherPointer ); |
---|
[a32b204] | 527 | } else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst ) |
---|
| 528 | && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) { |
---|
[c93bc28] | 529 | // std::cerr << "middle case" << std::endl; |
---|
[a32b204] | 530 | Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(), tq2 = otherPointer->get_base()->get_qualifiers(); |
---|
| 531 | pointerType->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 532 | otherPointer->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 533 | AssertionSet have, need; |
---|
| 534 | OpenVarSet newOpen( openVars ); |
---|
| 535 | if ( unifyExact( pointerType->get_base(), otherPointer->get_base(), env, have, need, newOpen, indexer ) ) { |
---|
[c93bc28] | 536 | // std::cerr << "unifyExact success" << std::endl; |
---|
[a32b204] | 537 | if ( tq1 < tq2 ) { |
---|
| 538 | result = pointerType->clone(); |
---|
| 539 | } else { |
---|
| 540 | result = otherPointer->clone(); |
---|
| 541 | } // if |
---|
[825170d] | 542 | strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2; |
---|
[a32b204] | 543 | } else { |
---|
[c93bc28] | 544 | /// std::cerr << "place for ptr-to-type" << std::endl; |
---|
[a32b204] | 545 | } // if |
---|
| 546 | pointerType->get_base()->get_qualifiers() = tq1; |
---|
| 547 | otherPointer->get_base()->get_qualifiers() = tq2; |
---|
| 548 | } // if |
---|
[89e6ffc] | 549 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 550 | result = pointerType->clone(); |
---|
[6f95000] | 551 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[a32b204] | 552 | } // if |
---|
| 553 | } |
---|
| 554 | |
---|
[53452de] | 555 | void CommonType::postvisit( ArrayType * ) {} |
---|
[65cec25] | 556 | |
---|
[53452de] | 557 | void CommonType::postvisit( ReferenceType *refType ) { |
---|
[65cec25] | 558 | if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { |
---|
[c93bc28] | 559 | // std::cerr << "commonType: both references: " << refType << " / " << otherRef << std::endl; |
---|
| 560 | // std::cerr << ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst ) << (refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond) << std::endl; |
---|
[65cec25] | 561 | if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) { |
---|
| 562 | getCommonWithVoidPointer( otherRef, refType ); |
---|
| 563 | } else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) { |
---|
| 564 | getCommonWithVoidPointer( refType, otherRef ); |
---|
| 565 | } else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst ) |
---|
| 566 | && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) { |
---|
[c93bc28] | 567 | // std::cerr << "middle case" << std::endl; |
---|
[65cec25] | 568 | Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers(); |
---|
| 569 | refType->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 570 | otherRef->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 571 | AssertionSet have, need; |
---|
| 572 | OpenVarSet newOpen( openVars ); |
---|
| 573 | if ( unifyExact( refType->get_base(), otherRef->get_base(), env, have, need, newOpen, indexer ) ) { |
---|
| 574 | if ( tq1 < tq2 ) { |
---|
| 575 | result = refType->clone(); |
---|
| 576 | } else { |
---|
| 577 | result = otherRef->clone(); |
---|
| 578 | } // if |
---|
[825170d] | 579 | strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2; |
---|
[65cec25] | 580 | } else { |
---|
[c93bc28] | 581 | /// std::cerr << "place for ptr-to-type" << std::endl; |
---|
[65cec25] | 582 | } // if |
---|
| 583 | refType->get_base()->get_qualifiers() = tq1; |
---|
| 584 | otherRef->get_base()->get_qualifiers() = tq2; |
---|
| 585 | } // if |
---|
| 586 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 587 | result = refType->clone(); |
---|
| 588 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
| 589 | } // if |
---|
| 590 | } |
---|
| 591 | |
---|
[53452de] | 592 | void CommonType::postvisit( FunctionType * ) {} |
---|
| 593 | void CommonType::postvisit( StructInstType * ) {} |
---|
| 594 | void CommonType::postvisit( UnionInstType * ) {} |
---|
[a32b204] | 595 | |
---|
[53452de] | 596 | void CommonType::postvisit( EnumInstType *enumInstType ) { |
---|
[89e6ffc] | 597 | if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { |
---|
[a436947] | 598 | // reuse BasicType, EnumInstType code by swapping type2 with enumInstType |
---|
[53452de] | 599 | result = commonType( type2, enumInstType, widenSecond, widenFirst, indexer, env, openVars ); |
---|
[a436947] | 600 | } // if |
---|
[a32b204] | 601 | } |
---|
| 602 | |
---|
[53452de] | 603 | void CommonType::postvisit( TraitInstType * ) { |
---|
[a32b204] | 604 | } |
---|
| 605 | |
---|
[53452de] | 606 | void CommonType::postvisit( TypeInstType *inst ) { |
---|
[a32b204] | 607 | if ( widenFirst ) { |
---|
| 608 | NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ); |
---|
| 609 | if ( nt ) { |
---|
[e3e16bc] | 610 | TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt ); |
---|
[a32b204] | 611 | if ( type->get_base() ) { |
---|
| 612 | Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers(); |
---|
| 613 | AssertionSet have, need; |
---|
| 614 | OpenVarSet newOpen( openVars ); |
---|
| 615 | type2->get_qualifiers() = Type::Qualifiers(); |
---|
| 616 | type->get_base()->get_qualifiers() = tq1; |
---|
| 617 | if ( unifyExact( type->get_base(), type2, env, have, need, newOpen, indexer ) ) { |
---|
| 618 | result = type2->clone(); |
---|
[6f95000] | 619 | result->get_qualifiers() = tq1 | tq2; |
---|
[a32b204] | 620 | } // if |
---|
| 621 | type2->get_qualifiers() = tq2; |
---|
| 622 | type->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 623 | } // if |
---|
| 624 | } // if |
---|
| 625 | } // if |
---|
| 626 | } |
---|
| 627 | |
---|
[53452de] | 628 | void CommonType::postvisit( TupleType * ) {} |
---|
| 629 | void CommonType::postvisit( VarArgsType * ) {} |
---|
[89e6ffc] | 630 | |
---|
[53452de] | 631 | void CommonType::postvisit( ZeroType *zeroType ) { |
---|
[89e6ffc] | 632 | if ( widenFirst ) { |
---|
| 633 | if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { |
---|
| 634 | if ( widenSecond || zeroType->get_qualifiers() <= type2->get_qualifiers() ) { |
---|
| 635 | result = type2->clone(); |
---|
[6f95000] | 636 | result->get_qualifiers() |= zeroType->get_qualifiers(); |
---|
[89e6ffc] | 637 | } |
---|
[4cb935e] | 638 | } else if ( widenSecond && dynamic_cast< OneType* >( type2 ) ) { |
---|
| 639 | result = new BasicType( zeroType->get_qualifiers(), BasicType::SignedInt ); |
---|
[6f95000] | 640 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[89e6ffc] | 641 | } |
---|
| 642 | } |
---|
| 643 | } |
---|
| 644 | |
---|
[53452de] | 645 | void CommonType::postvisit( OneType *oneType ) { |
---|
[89e6ffc] | 646 | if ( widenFirst ) { |
---|
| 647 | if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { |
---|
| 648 | if ( widenSecond || oneType->get_qualifiers() <= type2->get_qualifiers() ) { |
---|
| 649 | result = type2->clone(); |
---|
[6f95000] | 650 | result->get_qualifiers() |= oneType->get_qualifiers(); |
---|
[89e6ffc] | 651 | } |
---|
[4cb935e] | 652 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 653 | result = new BasicType( oneType->get_qualifiers(), BasicType::SignedInt ); |
---|
[6f95000] | 654 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[89e6ffc] | 655 | } |
---|
| 656 | } |
---|
| 657 | } |
---|
[51b7345] | 658 | } // namespace ResolvExpr |
---|
[a32b204] | 659 | |
---|
| 660 | // Local Variables: // |
---|
| 661 | // tab-width: 4 // |
---|
| 662 | // mode: c++ // |
---|
| 663 | // compile-command: "make install" // |
---|
| 664 | // End: // |
---|