[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 |
---|
[ada4575] | 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 |
---|
| 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 | /* B*/ BT Bool, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 190 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 191 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 192 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 193 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 194 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 195 | |
---|
| 196 | /* C*/ BT Char, BT Char, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 197 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 198 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 199 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 200 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 201 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 202 | |
---|
| 203 | /* SC*/ BT SignedChar, BT SignedChar, BT SignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 204 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 205 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 206 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 207 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 208 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 209 | |
---|
| 210 | /* UC*/ BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT UnsignedChar, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 211 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 212 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 213 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 214 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 215 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 216 | |
---|
| 217 | /* SI*/ BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortSignedInt, BT ShortUnsignedInt, |
---|
| 218 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 219 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 220 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 221 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 222 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 223 | |
---|
| 224 | /* SUI*/ BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, BT ShortUnsignedInt, |
---|
| 225 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 226 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 227 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 228 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 229 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 230 | |
---|
| 231 | /* I*/ BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, BT SignedInt, |
---|
| 232 | BT SignedInt, BT UnsignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 233 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 234 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 235 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 236 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 237 | |
---|
| 238 | /* UI*/ BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, BT UnsignedInt, |
---|
| 239 | BT UnsignedInt, 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 | /* LI*/ BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, |
---|
| 246 | BT LongSignedInt, BT LongSignedInt, BT LongSignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 247 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 248 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 249 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 250 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 251 | |
---|
| 252 | /* LUI*/ BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, |
---|
| 253 | BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongUnsignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 254 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 255 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 256 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 257 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 258 | |
---|
| 259 | /* LLI*/ BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, |
---|
| 260 | BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongSignedInt, BT LongLongUnsignedInt, |
---|
| 261 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 262 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 263 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 264 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 265 | |
---|
| 266 | /* LLUI*/ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, |
---|
| 267 | BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, |
---|
| 268 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 269 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 270 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 271 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 272 | |
---|
| 273 | /* IB*/ BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, |
---|
| 274 | BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, BT SignedInt128, |
---|
| 275 | BT SignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 276 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 277 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 278 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 279 | |
---|
| 280 | /* UIB*/ BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, |
---|
| 281 | BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, BT UnsignedInt128, |
---|
| 282 | BT UnsignedInt128, BT UnsignedInt128, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 283 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 284 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 285 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 286 | |
---|
| 287 | /* _FH*/ BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, |
---|
| 288 | BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16, |
---|
| 289 | BT uFloat16, BT uFloat16, BT uFloat16, BT uFloat16Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 290 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 291 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 292 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 293 | |
---|
| 294 | /* _FH*/ BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, |
---|
| 295 | BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, |
---|
| 296 | BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat16Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 297 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 298 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 299 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 300 | |
---|
| 301 | /* _F*/ BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, |
---|
| 302 | BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32, |
---|
| 303 | BT uFloat32, BT uFloat32, BT uFloat32, BT uFloat32Complex, BT uFloat32, BT uFloat32Complex, |
---|
| 304 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 305 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 306 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 307 | |
---|
| 308 | /* _FC*/ BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 309 | BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 310 | BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, BT uFloat32Complex, |
---|
| 311 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 312 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 313 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 314 | |
---|
| 315 | /* F*/ BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, |
---|
| 316 | BT Float, BT Float, BT Float, BT Float, BT Float, BT Float, |
---|
| 317 | BT Float, BT Float, BT Float, BT FloatComplex, BT Float, BT FloatComplex, |
---|
| 318 | BT Float, BT FloatComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 319 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 320 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 321 | |
---|
| 322 | /* FC*/ BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 323 | BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 324 | BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, BT FloatComplex, |
---|
| 325 | BT FloatComplex, BT FloatComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 326 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 327 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 328 | |
---|
| 329 | /* _FX*/ BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, |
---|
| 330 | BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32x, |
---|
| 331 | BT uFloat32x, BT uFloat32x, BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, |
---|
| 332 | BT uFloat32x, BT uFloat32xComplex, BT uFloat32x, BT uFloat32xComplex, BT uFloat64, BT uFloat64Complex, |
---|
| 333 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 334 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 335 | |
---|
| 336 | /* _FXC*/ BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 337 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 338 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, |
---|
| 339 | BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat32xComplex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 340 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 341 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 342 | |
---|
| 343 | /* FD*/ BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, |
---|
| 344 | BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64, |
---|
| 345 | BT uFloat64, BT uFloat64, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, |
---|
| 346 | BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, BT uFloat64, BT uFloat64Complex, |
---|
| 347 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 348 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 349 | |
---|
| 350 | /* _FDC*/ BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 351 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 352 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 353 | BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, BT uFloat64Complex, |
---|
| 354 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 355 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 356 | |
---|
| 357 | /* D*/ BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, |
---|
| 358 | BT Double, BT Double, BT Double, BT Double, BT Double, BT Double, |
---|
| 359 | BT Double, BT Double, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, |
---|
| 360 | BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, BT Double, BT DoubleComplex, |
---|
| 361 | BT Double, BT DoubleComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 362 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 363 | |
---|
| 364 | /* DC*/ BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 365 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 366 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 367 | BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, BT DoubleComplex, |
---|
| 368 | BT DoubleComplex, BT DoubleComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 369 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 370 | |
---|
| 371 | /* F80X*/ BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, |
---|
| 372 | BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64x, |
---|
| 373 | BT uFloat64x, BT uFloat64x, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, |
---|
| 374 | BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, |
---|
| 375 | BT uFloat64x, BT uFloat64xComplex, BT uFloat64x, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 376 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 377 | |
---|
| 378 | /* _FDXC*/ BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 379 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 380 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 381 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, |
---|
| 382 | BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat64xComplex, BT uFloat128Complex, |
---|
| 383 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 384 | |
---|
| 385 | /* F80*/ BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, |
---|
| 386 | BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uuFloat80, |
---|
| 387 | BT uuFloat80, BT uuFloat80, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, |
---|
| 388 | BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, |
---|
| 389 | BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat64xComplex, BT uuFloat80, BT uFloat128, |
---|
| 390 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 391 | |
---|
| 392 | /* _FB*/ BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, |
---|
| 393 | BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128, |
---|
| 394 | BT uFloat128, BT uFloat128, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, |
---|
| 395 | BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, |
---|
| 396 | BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128Complex, BT uFloat128, BT uFloat128, |
---|
| 397 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 398 | |
---|
| 399 | /* _FLDC*/ BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 400 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 401 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 402 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 403 | BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, BT uFloat128Complex, |
---|
| 404 | BT uFloat128Complex, BT uFloat128Complex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 405 | |
---|
| 406 | /* FB*/ BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, |
---|
| 407 | BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uuFloat128, |
---|
| 408 | BT uuFloat128, BT uuFloat128, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, |
---|
| 409 | BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, |
---|
| 410 | BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uFloat128Complex, BT uuFloat128, BT uuFloat128, |
---|
| 411 | BT uFloat128Complex, BT uuFloat128, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 412 | |
---|
| 413 | /* LD*/ BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, |
---|
| 414 | BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, BT LongDouble, |
---|
| 415 | BT LongDouble, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, |
---|
| 416 | BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, |
---|
| 417 | BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDoubleComplex, BT LongDouble, BT LongDouble, |
---|
| 418 | BT LongDoubleComplex, BT LongDouble, BT LongDouble, BT LongDoubleComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 419 | |
---|
| 420 | /* LDC*/ BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 421 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 422 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 423 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 424 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, |
---|
| 425 | BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT LongDoubleComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 426 | |
---|
| 427 | /* _FBX*/ BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, |
---|
| 428 | BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128x, |
---|
| 429 | BT uFloat128x, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 430 | BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 431 | BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, |
---|
| 432 | BT uFloat128xComplex, BT uFloat128x, BT uFloat128x, BT uFloat128xComplex, BT uFloat128x, BT uFloat128xComplex, |
---|
| 433 | |
---|
| 434 | /*_FLDXC*/ BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 435 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 436 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 437 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 438 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 439 | BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, BT uFloat128xComplex, |
---|
| 440 | |
---|
| 441 | }; |
---|
| 442 | #undef BT |
---|
| 443 | // GENERATED END |
---|
[4ee3b0c1] | 444 | static_assert( |
---|
[cdcddfe1] | 445 | sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES, |
---|
[4ee3b0c1] | 446 | "Each basic type kind should have a corresponding row in the combined type matrix" |
---|
| 447 | ); |
---|
[a32b204] | 448 | |
---|
| 449 | CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) |
---|
| 450 | : result( 0 ), type2( type2 ), widenFirst( widenFirst ), widenSecond( widenSecond ), indexer( indexer ), env( env ), openVars( openVars ) { |
---|
| 451 | } |
---|
| 452 | |
---|
[53452de] | 453 | void CommonType::postvisit( VoidType * ) {} |
---|
[a32b204] | 454 | |
---|
[53452de] | 455 | void CommonType::postvisit( BasicType *basicType ) { |
---|
[a32b204] | 456 | if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) { |
---|
[cdcddfe1] | 457 | BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ otherBasic->get_kind() ]; |
---|
[a32b204] | 458 | if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) { |
---|
[6f95000] | 459 | result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType ); |
---|
[a32b204] | 460 | } // if |
---|
[89e6ffc] | 461 | } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { |
---|
| 462 | // use signed int in lieu of the enum/zero/one type |
---|
[cdcddfe1] | 463 | BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ BasicType::SignedInt ]; |
---|
[89e6ffc] | 464 | if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) { |
---|
[6f95000] | 465 | result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType ); |
---|
[a436947] | 466 | } // if |
---|
[a32b204] | 467 | } // if |
---|
| 468 | } |
---|
| 469 | |
---|
[65cec25] | 470 | template< typename Pointer > |
---|
| 471 | void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) { |
---|
[a2a77af] | 472 | if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) { |
---|
| 473 | OpenVarSet::const_iterator entry = openVars.find( var->get_name() ); |
---|
| 474 | if ( entry != openVars.end() ) { |
---|
| 475 | AssertionSet need, have; |
---|
| 476 | WidenMode widen( widenFirst, widenSecond ); |
---|
[d286cf68] | 477 | if ( entry != openVars.end() && ! env.bindVar(var, voidPointer->get_base(), entry->second, need, have, openVars, widen, indexer ) ) return; |
---|
[a2a77af] | 478 | } |
---|
[2c57025] | 479 | } |
---|
[a2a77af] | 480 | result = voidPointer->clone(); |
---|
[6f95000] | 481 | result->get_qualifiers() |= otherPointer->get_qualifiers(); |
---|
[2c57025] | 482 | } |
---|
| 483 | |
---|
[53452de] | 484 | void CommonType::postvisit( PointerType *pointerType ) { |
---|
[a32b204] | 485 | if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) { |
---|
[c93bc28] | 486 | // std::cerr << "commonType: two pointers: " << pointerType << " / " << otherPointer << std::endl; |
---|
[d7dc824] | 487 | if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base()) ) { |
---|
[a2a77af] | 488 | getCommonWithVoidPointer( otherPointer, pointerType ); |
---|
[d7dc824] | 489 | } else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base()) ) { |
---|
[a2a77af] | 490 | getCommonWithVoidPointer( pointerType, otherPointer ); |
---|
[a32b204] | 491 | } else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst ) |
---|
| 492 | && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) { |
---|
[c93bc28] | 493 | // std::cerr << "middle case" << std::endl; |
---|
[a32b204] | 494 | Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(), tq2 = otherPointer->get_base()->get_qualifiers(); |
---|
| 495 | pointerType->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 496 | otherPointer->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 497 | AssertionSet have, need; |
---|
| 498 | OpenVarSet newOpen( openVars ); |
---|
| 499 | if ( unifyExact( pointerType->get_base(), otherPointer->get_base(), env, have, need, newOpen, indexer ) ) { |
---|
[c93bc28] | 500 | // std::cerr << "unifyExact success" << std::endl; |
---|
[a32b204] | 501 | if ( tq1 < tq2 ) { |
---|
| 502 | result = pointerType->clone(); |
---|
| 503 | } else { |
---|
| 504 | result = otherPointer->clone(); |
---|
| 505 | } // if |
---|
[825170d] | 506 | strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2; |
---|
[a32b204] | 507 | } else { |
---|
[c93bc28] | 508 | /// std::cerr << "place for ptr-to-type" << std::endl; |
---|
[a32b204] | 509 | } // if |
---|
| 510 | pointerType->get_base()->get_qualifiers() = tq1; |
---|
| 511 | otherPointer->get_base()->get_qualifiers() = tq2; |
---|
| 512 | } // if |
---|
[89e6ffc] | 513 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 514 | result = pointerType->clone(); |
---|
[6f95000] | 515 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[a32b204] | 516 | } // if |
---|
| 517 | } |
---|
| 518 | |
---|
[53452de] | 519 | void CommonType::postvisit( ArrayType * ) {} |
---|
[65cec25] | 520 | |
---|
[53452de] | 521 | void CommonType::postvisit( ReferenceType *refType ) { |
---|
[65cec25] | 522 | if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { |
---|
[c93bc28] | 523 | // std::cerr << "commonType: both references: " << refType << " / " << otherRef << std::endl; |
---|
| 524 | // 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] | 525 | if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) { |
---|
| 526 | getCommonWithVoidPointer( otherRef, refType ); |
---|
| 527 | } else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) { |
---|
| 528 | getCommonWithVoidPointer( refType, otherRef ); |
---|
| 529 | } else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst ) |
---|
| 530 | && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) { |
---|
[c93bc28] | 531 | // std::cerr << "middle case" << std::endl; |
---|
[65cec25] | 532 | Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers(); |
---|
| 533 | refType->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 534 | otherRef->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 535 | AssertionSet have, need; |
---|
| 536 | OpenVarSet newOpen( openVars ); |
---|
| 537 | if ( unifyExact( refType->get_base(), otherRef->get_base(), env, have, need, newOpen, indexer ) ) { |
---|
| 538 | if ( tq1 < tq2 ) { |
---|
| 539 | result = refType->clone(); |
---|
| 540 | } else { |
---|
| 541 | result = otherRef->clone(); |
---|
| 542 | } // if |
---|
[825170d] | 543 | strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2; |
---|
[65cec25] | 544 | } else { |
---|
[c93bc28] | 545 | /// std::cerr << "place for ptr-to-type" << std::endl; |
---|
[65cec25] | 546 | } // if |
---|
| 547 | refType->get_base()->get_qualifiers() = tq1; |
---|
| 548 | otherRef->get_base()->get_qualifiers() = tq2; |
---|
| 549 | } // if |
---|
| 550 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 551 | result = refType->clone(); |
---|
| 552 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
| 553 | } // if |
---|
| 554 | } |
---|
| 555 | |
---|
[53452de] | 556 | void CommonType::postvisit( FunctionType * ) {} |
---|
| 557 | void CommonType::postvisit( StructInstType * ) {} |
---|
| 558 | void CommonType::postvisit( UnionInstType * ) {} |
---|
[a32b204] | 559 | |
---|
[53452de] | 560 | void CommonType::postvisit( EnumInstType *enumInstType ) { |
---|
[89e6ffc] | 561 | if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { |
---|
[a436947] | 562 | // reuse BasicType, EnumInstType code by swapping type2 with enumInstType |
---|
[53452de] | 563 | result = commonType( type2, enumInstType, widenSecond, widenFirst, indexer, env, openVars ); |
---|
[a436947] | 564 | } // if |
---|
[a32b204] | 565 | } |
---|
| 566 | |
---|
[53452de] | 567 | void CommonType::postvisit( TraitInstType * ) { |
---|
[a32b204] | 568 | } |
---|
| 569 | |
---|
[53452de] | 570 | void CommonType::postvisit( TypeInstType *inst ) { |
---|
[a32b204] | 571 | if ( widenFirst ) { |
---|
| 572 | NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ); |
---|
| 573 | if ( nt ) { |
---|
[e3e16bc] | 574 | TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt ); |
---|
[a32b204] | 575 | if ( type->get_base() ) { |
---|
| 576 | Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers(); |
---|
| 577 | AssertionSet have, need; |
---|
| 578 | OpenVarSet newOpen( openVars ); |
---|
| 579 | type2->get_qualifiers() = Type::Qualifiers(); |
---|
| 580 | type->get_base()->get_qualifiers() = tq1; |
---|
| 581 | if ( unifyExact( type->get_base(), type2, env, have, need, newOpen, indexer ) ) { |
---|
| 582 | result = type2->clone(); |
---|
[6f95000] | 583 | result->get_qualifiers() = tq1 | tq2; |
---|
[a32b204] | 584 | } // if |
---|
| 585 | type2->get_qualifiers() = tq2; |
---|
| 586 | type->get_base()->get_qualifiers() = Type::Qualifiers(); |
---|
| 587 | } // if |
---|
| 588 | } // if |
---|
| 589 | } // if |
---|
| 590 | } |
---|
| 591 | |
---|
[53452de] | 592 | void CommonType::postvisit( TupleType * ) {} |
---|
| 593 | void CommonType::postvisit( VarArgsType * ) {} |
---|
[89e6ffc] | 594 | |
---|
[53452de] | 595 | void CommonType::postvisit( ZeroType *zeroType ) { |
---|
[89e6ffc] | 596 | if ( widenFirst ) { |
---|
| 597 | if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { |
---|
| 598 | if ( widenSecond || zeroType->get_qualifiers() <= type2->get_qualifiers() ) { |
---|
| 599 | result = type2->clone(); |
---|
[6f95000] | 600 | result->get_qualifiers() |= zeroType->get_qualifiers(); |
---|
[89e6ffc] | 601 | } |
---|
[4cb935e] | 602 | } else if ( widenSecond && dynamic_cast< OneType* >( type2 ) ) { |
---|
| 603 | result = new BasicType( zeroType->get_qualifiers(), BasicType::SignedInt ); |
---|
[6f95000] | 604 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[89e6ffc] | 605 | } |
---|
| 606 | } |
---|
| 607 | } |
---|
| 608 | |
---|
[53452de] | 609 | void CommonType::postvisit( OneType *oneType ) { |
---|
[89e6ffc] | 610 | if ( widenFirst ) { |
---|
| 611 | if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) { |
---|
| 612 | if ( widenSecond || oneType->get_qualifiers() <= type2->get_qualifiers() ) { |
---|
| 613 | result = type2->clone(); |
---|
[6f95000] | 614 | result->get_qualifiers() |= oneType->get_qualifiers(); |
---|
[89e6ffc] | 615 | } |
---|
[4cb935e] | 616 | } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { |
---|
| 617 | result = new BasicType( oneType->get_qualifiers(), BasicType::SignedInt ); |
---|
[6f95000] | 618 | result->get_qualifiers() |= type2->get_qualifiers(); |
---|
[89e6ffc] | 619 | } |
---|
| 620 | } |
---|
| 621 | } |
---|
[51b7345] | 622 | } // namespace ResolvExpr |
---|
[a32b204] | 623 | |
---|
| 624 | // Local Variables: // |
---|
| 625 | // tab-width: 4 // |
---|
| 626 | // mode: c++ // |
---|
| 627 | // compile-command: "make install" // |
---|
| 628 | // End: // |
---|