source: src/ResolvExpr/CommonType.cc@ 7fabfdf

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr persistent-indexer pthread-emulation qualifiedEnum stuck-waitfor-destruct
Last change on this file since 7fabfdf was cdcddfe1, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

add signedness to cost model and _FloatNN

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