Changeset cdcddfe1 for src/ResolvExpr


Ignore:
Timestamp:
Feb 11, 2019, 9:37:43 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
3e7c323
Parents:
ba01b14
Message:

add signedness to cost model and _FloatNN

Location:
src/ResolvExpr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    rba01b14 rcdcddfe1  
    1010// Created On       : Sun May 17 06:59:27 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:18:17 2017
    13 // Update Count     : 9
     12// Last Modified On : Fri Feb  8 09:30:15 2019
     13// Update Count     : 17
    1414//
    1515
     
    175175                return result;
    176176        }
    177 
     177#if 0
     178        #define BT BasicType::
    178179        static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] =
    179180        {
    180181/*              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 */
    181                 /* Bool */      { BasicType::Bool,              BasicType::Char,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    182                 /* Char */      { BasicType::Char,              BasicType::Char,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    183                 /* SignedChar */        { BasicType::SignedChar,        BasicType::UnsignedChar,        BasicType::SignedChar,  BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    184                 /* UnsignedChar */      { BasicType::UnsignedChar,      BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::UnsignedChar,        BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    185                 /* ShortSignedInt */    { BasicType::ShortSignedInt,    BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortSignedInt,      BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    186                 /* ShortUnsignedInt */  { BasicType::ShortUnsignedInt,  BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::ShortUnsignedInt,    BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    187                 /* SignedInt */         { BasicType::SignedInt,         BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::SignedInt,   BasicType::UnsignedInt, BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    188                 /* UnsignedInt */       { BasicType::UnsignedInt,               BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::UnsignedInt, BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    189                 /* LongSignedInt */     { BasicType::LongSignedInt,             BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongSignedInt,       BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    190                 /* LongUnsignedInt */   { BasicType::LongUnsignedInt,   BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongUnsignedInt,     BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    191                 /* LongLongSignedInt */         { BasicType::LongLongSignedInt, BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongSignedInt,   BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    192                 /* LongLongUnsignedInt */       { BasicType::LongLongUnsignedInt,       BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::LongLongUnsignedInt, BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
    193                 /* Float */     { BasicType::Float,     BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::Float,       BasicType::Float, BasicType::Float80, BasicType::Float128 },
    194                 /* Double */    { BasicType::Double,    BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::Double,      BasicType::LongDouble,  BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::Double,      BasicType::Double, BasicType::Float80, BasicType::Float128 },
    195                 /* LongDouble */        { BasicType::LongDouble,                BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDouble,  BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDouble,  BasicType::LongDouble, BasicType::BasicType::LongDouble, BasicType::Float128 },
    196                 /* FloatComplex */      { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::FloatComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, },
    197                 /* DoubleComplex */     { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex },
    198                 /* LongDoubleComplex */         { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, },
    199                 /* FloatImaginary */    { BasicType::FloatComplex,      BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatImaginary,      BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary, BasicType::FloatImaginary,      BasicType::FloatImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
    200                 /* DoubleImaginary */   { BasicType::DoubleComplex,     BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleComplex,       BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::DoubleImaginary,     BasicType::DoubleImaginary,     BasicType::LongDoubleImaginary, BasicType::DoubleImaginary,     BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
    201                 /* LongDoubleImaginary */       { BasicType::LongDoubleComplex, BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
    202                 /* SignedInt128 */      { BasicType::SignedInt128,      BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::SignedInt128,        BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::SignedInt128,        BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, },
    203                 /* UnsignedInt128 */    { BasicType::UnsignedInt128,    BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::UnsignedInt128,      BasicType::Float,       BasicType::Double,      BasicType::LongDouble,  BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::FloatComplex,        BasicType::DoubleComplex,       BasicType::LongDoubleComplex,   BasicType::UnsignedInt128,      BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, },
    204                 /* Float80 */   { BasicType::Float80,   BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::Float80,     BasicType::LongDouble,  BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::Float80,     BasicType::Float80, BasicType::Float80, BasicType::Float128 },
    205                 /* Float128 */  { BasicType::Float128,  BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::Float128,    BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::LongDoubleComplex,   BasicType::Float128,    BasicType::Float128, BasicType::Float128, BasicType::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 },
    206225        };
     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
    207493        static_assert(
    208                 sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
     494                sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
    209495                "Each basic type kind should have a corresponding row in the combined type matrix"
    210496        );
     
    218504        void CommonType::postvisit( BasicType *basicType ) {
    219505                if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
    220                         BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ];
     506                        BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ otherBasic->get_kind() ];
    221507                        if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) {
    222508                                result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType );
     
    224510                } else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
    225511                        // use signed int in lieu of the enum/zero/one type
    226                         BasicType::Kind newType = combinedType[ basicType->get_kind() ][ BasicType::SignedInt ];
     512                        BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ BasicType::SignedInt ];
    227513                        if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) {
    228514                                result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType );
  • src/ResolvExpr/ConversionCost.cc

    rba01b14 rcdcddfe1  
    1010// Created On       : Sun May 17 07:06:19 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 15:43:34 2017
    13 // Update Count     : 10
     12// Last Modified On : Fri Feb  8 09:48:39 2019
     13// Update Count     : 19
    1414//
    1515
     
    2828
    2929namespace ResolvExpr {
    30         const Cost Cost::zero =      Cost{  0,  0,  0,  0,  0,  0 };
    31         const Cost Cost::infinity =  Cost{ -1, -1, -1, -1,  1, -1 };
    32         const Cost Cost::unsafe =    Cost{  1,  0,  0,  0,  0,  0 };
    33         const Cost Cost::poly =      Cost{  0,  1,  0,  0,  0,  0 };
    34         const Cost Cost::safe =      Cost{  0,  0,  1,  0,  0,  0 };
    35         const Cost Cost::var =       Cost{  0,  0,  0,  1,  0,  0 };
    36         const Cost Cost::spec =      Cost{  0,  0,  0,  0, -1,  0 };
    37         const Cost Cost::reference = Cost{  0,  0,  0,  0,  0,  1 };
     30        const Cost Cost::zero =      Cost{  0,  0,  0,  0,  0,  0,  0 };
     31        const Cost Cost::infinity =  Cost{ -1, -1, -1, -1, -1,  1, -1 };
     32        const Cost Cost::unsafe =    Cost{  1,  0,  0,  0,  0,  0,  0 };
     33        const Cost Cost::poly =      Cost{  0,  1,  0,  0,  0,  0,  0 };
     34        const Cost Cost::safe =      Cost{  0,  0,  1,  0,  0,  0,  0 };
     35        const Cost Cost::sign =      Cost{  0,  0,  0,  1,  0,  0,  0 };
     36        const Cost Cost::var =       Cost{  0,  0,  0,  0,  1,  0,  0 };
     37        const Cost Cost::spec =      Cost{  0,  0,  0,  0,  0, -1,  0 };
     38        const Cost Cost::reference = Cost{  0,  0,  0,  0,  0,  0,  1 };
    3839
    3940#if 0
     
    178179                : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) {
    179180        }
    180 
     181#if 0
    181182/*
    182183            Old
     
    265266                "Each basic type kind should have a corresponding row in the cost matrix"
    266267        );
    267 
     268#endif
     269
     270        /* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves)
     271                    _Bool
     272        Char    SignedChar    UnsignedChar
     273                ShortSignedInt    ShortUnsignedInt
     274                SignedInt    UnsignedInt
     275                LongSignedInt    LongUnsignedInt
     276                LongLongSignedInt    LongLongUnsignedInt
     277                SignedInt128    UnsignedInt128
     278                _Float16    _Float16Complex
     279                _Float32    _Float32Complex
     280                Float    FloatComplex
     281                _Float32x    _Float32xComplex
     282                _Float64    _Float64Complex
     283                Double    DoubleComplex
     284                _Float64x    _Float64xComplex
     285                    __float80
     286                _Float128    _Float128Complex
     287                    __float128
     288                LongDouble    LongDoubleComplex
     289                _Float128x    _Float128xComplex
     290        */
     291
     292        static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
     293                /*          B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X _FDXC  F80  _FB _FLDC   FB   LD  LDC _FBX _FLDXC */
     294                /*     B*/  0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17,
     295                /*     C*/ -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16,
     296                /*    SC*/ -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16,
     297                /*    UC*/ -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16,
     298                /*    SI*/ -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15,
     299                /*   SUI*/ -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15,
     300                /*     I*/ -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14,
     301                /*    UI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14,
     302                /*    LI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13,
     303                /*   LUI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13,
     304                /*   LLI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12,
     305                /*  LLUI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12,
     306                /*    IB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11,
     307                /*   UIB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11,
     308                /*   _FH*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,   9,  11,  10,
     309                /*   _FH*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   7,  -1,  -1,   8,  -1,   9,
     310                /*    _F*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   8,  10,   9,
     311                /*   _FC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   6,  -1,  -1,   7,  -1,   8,
     312                /*     F*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   7,   9,   8,
     313                /*    FC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   5,  -1,  -1,   6,  -1,   7,
     314                /*   _FX*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   6,   8,   7,
     315                /*  _FXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   4,  -1,  -1,   5,  -1,   6,
     316                /*    FD*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   5,   7,   6,
     317                /*  _FDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,  -1,   3,  -1,  -1,   4,  -1,   5,
     318                /*     D*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   4,   6,   5,
     319                /*    DC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,  -1,   2,  -1,  -1,   3,  -1,   4,
     320                /*  F80X*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   3,   5,   4,
     321                /* _FDXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   1,  -1,  -1,   2,  -1,   3,
     322                /*   F80*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   1,   0,   1,   2,   2,   3,   3,   4,   4,
     323                /*   _FB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,
     324                /* _FLDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   1,  -1,   2,
     325                /*    FB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   1,   0,   1,   2,   2,   3,
     326                /*    LD*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,
     327                /*   LDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,
     328                /*  _FBX*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,
     329                /*_FLDXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,
     330        };
     331        static_assert(
     332                sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
     333                "Missing row in the cost matrix"
     334        );
     335
     336        static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
     337                /*          B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X _FDXC  F80  _FB _FLDC   FB   LD  LDC _FBX _FLDXC */
     338                /*     B*/  0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     339                /*     C*/ -1,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     340                /*    SC*/ -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     341                /*    UC*/ -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     342                /*    SI*/ -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     343                /*   SUI*/ -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     344                /*     I*/ -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     345                /*    UI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     346                /*    LI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     347                /*   LUI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     348                /*   LLI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     349                /*  LLUI*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     350                /*    IB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     351                /*   UIB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     352                /*   _FH*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     353                /*   _FH*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     354                /*    _F*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     355                /*   _FC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     356                /*     F*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     357                /*    FC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     358                /*   _FX*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     359                /*  _FXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     360                /*    FD*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     361                /*  _FDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     362                /*     D*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     363                /*    DC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     364                /*  F80X*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     365                /* _FDXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     366                /*   F80*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,
     367                /*   _FB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,
     368                /* _FLDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   0,  -1,   0,
     369                /*    FB*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,
     370                /*    LD*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,
     371                /*   LDC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,
     372                /*  _FBX*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,
     373                /*_FLDXC*/ -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,
     374        };
     375        static_assert(
     376                sizeof(signMatrix)/sizeof(signMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
     377                "Missing row in the sign matrix"
     378        );
    268379
    269380        void ConversionCost::postvisit( VoidType * ) {
     
    279390                                cost = Cost::zero;
    280391                                cost.incSafe( tableResult );
     392                                cost.incSign( signMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ] );
    281393                        } // if
    282394                } else if ( dynamic_cast< EnumInstType *>( dest ) ) {
     
    300412                                        // types are the same, except otherPointer has more qualifiers
    301413                                        cost = Cost::safe;
    302                                 }
     414                                } // if
    303415                        } else {
    304416                                int assignResult = ptrsAssignable( pointerType->base, destAsPtr->base, env );
     
    422534                                cost = Cost::zero;
    423535                                cost.incSafe( tableResult + 1 );
    424                         }
     536                                cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] );
     537                        } // if
    425538                } else if ( dynamic_cast< PointerType* >( dest ) ) {
    426539                        cost = Cost::safe;
    427                 }
     540                } // if
    428541        }
    429542
     
    439552                                cost = Cost::zero;
    440553                                cost.incSafe( tableResult + 1 );
    441                         }
    442                 }
     554                                cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] );
     555                        } // if
     556                } // if
    443557        }
    444558} // namespace ResolvExpr
  • src/ResolvExpr/Cost.h

    rba01b14 rcdcddfe1  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 09:39:50 2015
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Fri Oct 05 14:32:00 2018
    13 // Update Count     : 7
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Feb  7 20:54:29 2019
     13// Update Count     : 8
    1414//
    1515
     
    2121        class Cost {
    2222          private:
    23                 Cost( int unsafeCost, int polyCost, int safeCost, int varCost, int specCost,
    24                         int referenceCost );
    25 
     23                Cost( int unsafeCost, int polyCost, int safeCost, int signCost,
     24                        int varCost, int specCost, int referenceCost );
    2625          public:
    2726                Cost & incUnsafe( int inc = 1 );
    2827                Cost & incPoly( int inc = 1 );
    2928                Cost & incSafe( int inc = 1 );
     29                Cost & incSign( int inc = 1 );
    3030                Cost & incVar( int inc = 1 );
    3131                Cost & decSpec( int inc = 1 );
     
    3535                int get_polyCost() const { return polyCost; }
    3636                int get_safeCost() const { return safeCost; }
     37                int get_signCost() const { return signCost; }
    3738                int get_varCost() const { return varCost; }
    3839                int get_specCost() const { return specCost; }
     
    4041
    4142                Cost operator+( const Cost &other ) const;
    42                 Cost operator-( const Cost &other ) const;
    4343                Cost &operator+=( const Cost &other );
    4444                bool operator<( const Cost &other ) const;
     
    5555                static const Cost poly;
    5656                static const Cost safe;
     57                static const Cost sign;
    5758                static const Cost var;
    5859                static const Cost spec;
     
    6364                int polyCost;       ///< Count of parameters and return values bound to some poly type
    6465                int safeCost;       ///< Safe (widening) conversions
     66                int signCost;       ///< Count of safe sign conversions
    6567                int varCost;        ///< Count of polymorphic type variables
    6668                int specCost;       ///< Polymorphic type specializations (type assertions), negative cost
     
    6870        };
    6971
    70         inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int varCost, int specCost,
    71                         int referenceCost )
    72                 : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), varCost( varCost ),
    73                   specCost( specCost ), referenceCost( referenceCost ) {}
     72        inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int signCost,
     73                        int varCost, int specCost, int referenceCost )
     74                : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), signCost( signCost ),
     75                  varCost( varCost ), specCost( specCost ), referenceCost( referenceCost ) {}
    7476
    7577        inline Cost & Cost::incUnsafe( int inc ) {
     
    8890                if ( *this == infinity ) return *this;
    8991                safeCost += inc;
     92                return *this;
     93        }
     94
     95        inline Cost & Cost::incSign( int inc ) {
     96                if ( *this == infinity ) return *this;
     97                signCost += inc;
    9098                return *this;
    9199        }
     
    111119        inline Cost Cost::operator+( const Cost &other ) const {
    112120                if ( *this == infinity || other == infinity ) return infinity;
    113                 return Cost{ 
    114                         unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, 
    115                         varCost + other.varCost, specCost + other.specCost,
     121                return Cost{
     122                        unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost,
     123                        signCost + other.signCost, varCost + other.varCost, specCost + other.specCost,
    116124                        referenceCost + other.referenceCost };
    117         }
    118 
    119         inline Cost Cost::operator-( const Cost &other ) const {
    120                 if ( *this == infinity || other == infinity ) return infinity;
    121                 return Cost{
    122                         unsafeCost - other.unsafeCost, polyCost - other.polyCost, safeCost - other.safeCost,
    123                         varCost - other.varCost, specCost - other.specCost,
    124                         referenceCost - other.referenceCost };
    125125        }
    126126
     
    134134                polyCost += other.polyCost;
    135135                safeCost += other.safeCost;
     136                signCost += other.signCost;
    136137                varCost += other.varCost;
    137138                specCost += other.specCost;
     
    156157                } else if ( safeCost < other.safeCost ) {
    157158                        return true;
     159                } else if ( signCost > other.signCost ) {
     160                        return false;
     161                } else if ( signCost < other.signCost ) {
     162                        return true;
    158163                } else if ( varCost > other.varCost ) {
    159164                        return false;
     
    180185                c = polyCost - other.polyCost; if ( c ) return c;
    181186                c = safeCost - other.safeCost; if ( c ) return c;
     187                c = signCost - other.signCost; if ( c ) return c;
    182188                c = varCost - other.varCost; if ( c ) return c;
    183189                c = specCost - other.specCost; if ( c ) return c;
     
    189195                        && polyCost == other.polyCost
    190196                        && safeCost == other.safeCost
     197                        && signCost == other.signCost
    191198                        && varCost == other.varCost
    192199                        && specCost == other.specCost
     
    199206
    200207        inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) {
    201                 return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", "
    202                           << cost.safeCost << ", " << cost.varCost << ", " << cost.specCost << ", "
     208                return os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", "
     209                          << cost.safeCost << ", " << cost.signCost << ", "
     210                                  << cost.varCost << ", " << cost.specCost << ", "
    203211                          << cost.referenceCost << " )";
    204212        }
Note: See TracChangeset for help on using the changeset viewer.