Changeset 054514d for src


Ignore:
Timestamp:
May 29, 2018, 3:26:31 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
3530f39a
Parents:
96812c0 (diff), da60c631 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src
Files:
7 added
46 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r96812c0 r054514d  
    119119
    120120        string CodeGenerator::mangleName( DeclarationWithType * decl ) {
    121                 if ( pretty ) return decl->get_name();
    122                 if ( decl->get_mangleName() != "" ) {
     121                // GCC builtins should always be printed unmangled
     122                if ( pretty || decl->linkage.is_gcc_builtin ) return decl->name;
     123                if ( decl->mangleName != "" ) {
    123124                        // need to incorporate scope level in order to differentiate names for destructors
    124125                        return decl->get_scopedMangleName();
    125126                } else {
    126                         return decl->get_name();
     127                        return decl->name;
    127128                } // if
    128129        }
  • src/Common/Heap.cc

    r96812c0 r054514d  
    3030#else
    3131        struct StatBlock {
    32                 const char * name = nullptr;
    33                 size_t mallocs    = 0;
    34                 size_t frees      = 0;
     32                const char * name  = nullptr;   ///< Name of this pass
     33                size_t mallocs     = 0;                 ///< Allocations in this pass
     34                size_t frees       = 0;                 ///< Frees in this pass
     35                size_t n_allocs    = 0;                 ///< Current number of live allocations
     36                size_t peak_allocs = 0;                 ///< Peak number of live allocations this pass
    3537        };
    3638
    37         StatBlock    passes[100] = {{ "Pre-Parse", 0, 0 }};
     39        StatBlock    passes[100] = {{ "Pre-Parse", 0, 0, 0, 0 }};
    3840        const size_t passes_size = sizeof(passes) / sizeof(passes[0]);
    3941        size_t       passes_cnt = 1;
     
    4345                passes[passes_cnt].mallocs = 0;
    4446                passes[passes_cnt].frees   = 0;
     47                passes[passes_cnt].n_allocs
     48                        = passes[passes_cnt].peak_allocs
     49                        = passes[passes_cnt-1].n_allocs;
    4550                passes_cnt++;
    4651
     
    5560        }
    5661
    57         void print(const StatBlock& stat, size_t nc, size_t total_mallocs, size_t total_frees) {
     62        void print(const StatBlock& stat, size_t nc, size_t total_mallocs, size_t total_frees, size_t overall_peak) {
    5863                std::cerr << std::setw(nc) << stat.name;
    5964                std::cerr << " | ";
    6065
    61                 print(stat.mallocs, total_mallocs);
    62                 print(stat.frees  , total_frees  );
     66                print(stat.mallocs,     total_mallocs);
     67                print(stat.frees,       total_frees  );
     68                print(stat.peak_allocs, overall_peak );
    6369                std::cerr << "\n";
    6470        }
     
    7581                size_t total_mallocs = 0;
    7682                size_t total_frees   = 0;
     83                size_t overall_peak  = 0;
    7784                for(size_t i = 0; i < passes_cnt; i++) {
    7885                        nc = std::max(nc, std::strlen(passes[i].name));
    7986                        total_mallocs += passes[i].mallocs;
    8087                        total_frees   += passes[i].frees;
    81                 }
    82                 size_t nct = nc + 44;
     88                        overall_peak = std::max(overall_peak, passes[i].peak_allocs);
     89                }
     90                size_t nct = nc + 65;
    8391
    8492                const char * const title = "Heap Usage Statistic";
     
    8896                print('-', nct);
    8997                std::cerr << std::setw(nc) << "Pass";
    90                 std::cerr << " |       Malloc Count |         Free Count |" << std::endl;
     98                std::cerr << " |       Malloc Count |         Free Count |        Peak Allocs |" << std::endl;
    9199
    92100                print('-', nct);
    93101                for(size_t i = 0; i < passes_cnt; i++) {
    94                         print(passes[i], nc, total_mallocs, total_frees);
     102                        print(passes[i], nc, total_mallocs, total_frees, overall_peak);
    95103                }
    96104                print('-', nct);
    97                 print({"Sum", total_mallocs, total_frees}, nc, total_mallocs, total_frees);
     105                print({"Sum", total_mallocs, total_frees, 0, overall_peak},
     106                        nc, total_mallocs, total_frees, overall_peak);
    98107
    99108        }
     
    158167                void * malloc( size_t size ) {
    159168                        static auto __malloc = reinterpret_cast<void * (*)(size_t)>(interpose_symbol( "malloc", nullptr ));
    160                         if( passes_cnt > 0 ) passes[passes_cnt - 1].mallocs++;
     169                        if( passes_cnt > 0 ) {
     170                                passes[passes_cnt - 1].mallocs++;
     171                                passes[passes_cnt - 1].n_allocs++;
     172                                passes[passes_cnt - 1].peak_allocs
     173                                        = std::max(passes[passes_cnt - 1].peak_allocs, passes[passes_cnt - 1].n_allocs);
     174                        }
    161175                        return __malloc( size );
    162176                }
     
    164178                void free( void * ptr ) {
    165179                        static auto __free = reinterpret_cast<void   (*)(void *)>(interpose_symbol( "free", nullptr ));
    166                         if( passes_cnt > 0 ) passes[passes_cnt - 1].frees++;
     180                        if( passes_cnt > 0 ) {
     181                                passes[passes_cnt - 1].frees++;
     182                                passes[passes_cnt - 1].n_allocs--;
     183                        }
    167184                        return __free( ptr );
    168185                }
     
    170187                void * calloc( size_t nelem, size_t size ) {
    171188                        static auto __calloc = reinterpret_cast<void * (*)(size_t, size_t)>(interpose_symbol( "calloc", nullptr ));
    172                         if( passes_cnt > 0 ) passes[passes_cnt - 1].mallocs++;
     189                        if( passes_cnt > 0 ) {
     190                                passes[passes_cnt - 1].mallocs++;
     191                                passes[passes_cnt - 1].n_allocs++;
     192                                passes[passes_cnt - 1].peak_allocs
     193                                        = std::max(passes[passes_cnt - 1].peak_allocs, passes[passes_cnt - 1].n_allocs);
     194                        }
    173195                        return __calloc( nelem, size );
    174196                }
  • src/Concurrency/Keywords.cc

    r96812c0 r054514d  
    191191                void postvisit(   StructDecl * decl );
    192192
    193                 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );
     193                std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first );
    194194                void validate( DeclarationWithType * );
    195195                void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
     
    441441        void MutexKeyword::postvisit(FunctionDecl* decl) {
    442442
    443                 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl );
     443                bool first = false;
     444                std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl, first );
    444445                if( mutexArgs.empty() ) return;
    445446
    446                 if( CodeGen::isConstructor(decl->name) ) SemanticError( decl, "constructors cannot have mutex parameters" );
     447                if( CodeGen::isConstructor(decl->name) && first ) SemanticError( decl, "constructors cannot have mutex parameters" );
    447448
    448449                bool isDtor = CodeGen::isDestructor( decl->name );
     
    484485        }
    485486
    486         std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) {
     487        std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl, bool & first ) {
    487488                std::list<DeclarationWithType*> mutexArgs;
    488489
     490                bool once = true;
    489491                for( auto arg : decl->get_functionType()->get_parameters()) {
    490492                        //Find mutex arguments
    491493                        Type* ty = arg->get_type();
    492494                        if( ! ty->get_mutex() ) continue;
     495
     496                        if(once) {first = true;}
     497                        once = false;
    493498
    494499                        //Append it to the list
  • src/Parser/LinkageSpec.h

    r96812c0 r054514d  
    2727                Overrideable = 1 << 2,
    2828                Builtin = 1 << 3,
     29                GccBuiltin = 1 << 4,
    2930
    30                 NoOfSpecs = 1 << 4,
     31                NoOfSpecs = 1 << 5,
    3132        };
    3233
     
    3839                        bool is_overridable : 1;
    3940                        bool is_builtin : 1;
     41                        bool is_gcc_builtin : 1;
    4042                };
    4143                constexpr Spec( unsigned int val ) : val( val ) {}
     
    6163        inline bool isOverridable( Spec spec ) { return spec.is_overridable; }
    6264        inline bool isBuiltin( Spec spec ) { return spec.is_builtin; }
     65        inline bool isGccBuiltin( Spec spec ) { return spec.is_gcc_builtin; }
    6366
    6467        // Pre-defined flag combinations:
     
    7275        constexpr Spec const AutoGen = { Mangle | Generate | Overrideable };
    7376        // gcc internal
    74         constexpr Spec const Compiler = { Builtin };
     77        constexpr Spec const Compiler = { Mangle | Builtin | GccBuiltin };
    7578        // mangled builtins
    7679        constexpr Spec const BuiltinCFA = { Mangle | Generate | Builtin };
  • src/Parser/TypeData.cc

    r96812c0 r054514d  
    575575
    576576          case DeclarationNode::Int128:
    577                 ret = td->signedness == 1 ? BasicType::UnsignedInt128 : BasicType::SignedInt128;
     577                ret = td->signedness == DeclarationNode::Unsigned ? BasicType::UnsignedInt128 : BasicType::SignedInt128;
    578578                if ( td->length != DeclarationNode::NoLength ) {
    579579                        genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
     
    599599                        genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    600600                } // if
    601                 if ( td->basictype == DeclarationNode::Float && td->length == DeclarationNode::Long ) {
     601                if ( td->basictype != DeclarationNode::Double && td->length == DeclarationNode::Long ) {
    602602                        genTSError( DeclarationNode::lengthNames[ td->length ], td->basictype );
    603603                } // if
     
    605605                        const_cast<TypeData *>(td)->basictype = DeclarationNode::LongDouble;
    606606                } // if
     607
     608                if ( td->basictype == DeclarationNode::Float80 || td->basictype == DeclarationNode::Float128 ) {
     609                        if ( td->complextype != DeclarationNode::NoComplexType ) {
     610                                genTSError( DeclarationNode::complexTypeNames[ td->complextype ], td->basictype );
     611                        }
     612                        if ( td->basictype == DeclarationNode::Float80 ) ret = BasicType::Float80;
     613                        else ret = BasicType::Float128;
     614                        break;
     615                }
    607616
    608617                ret = floattype[ td->complextype ][ td->basictype - DeclarationNode::Float ];
  • src/Parser/parser.yy

    r96812c0 r054514d  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 22 08:41:57 2018
    13 // Update Count     : 3353
     12// Last Modified On : Mon May 28 17:01:36 2018
     13// Update Count     : 3383
    1414//
    1515
     
    326326%type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr
    327327
    328 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list_opt
     328%type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_ellipsis_list_opt
    329329
    330330%type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier
     
    852852//      '[' ']'
    853853//              { $$ = new ExpressionNode( build_tuple() ); }
    854 //      '[' push assignment_expression pop ']'
     854//      | '[' push assignment_expression pop ']'
    855855//              { $$ = new ExpressionNode( build_tuple( $3 ) ); }
    856         '[' ',' tuple_expression_list ']'
    857                 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); }
    858         | '[' assignment_expression ',' tuple_expression_list ']'
    859                 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$2->set_last( $4 ) ) ); }
     856        '[' push ',' tuple_expression_list pop ']'
     857                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $4 ) ) ); }
     858        | '[' push assignment_expression ',' tuple_expression_list pop ']'
     859                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $5 ) ) ); }
    860860        ;
    861861
     
    883883        labeled_statement
    884884        | compound_statement
    885         | expression_statement                                          { $$ = $1; }
     885        | expression_statement
    886886        | selection_statement
    887887        | iteration_statement
     
    12001200        type_specifier_nobody
    12011201        | type_specifier_nobody declarator
    1202                 {
    1203                         $$ = $2->addType( $1 );
    1204                 }
     1202                { $$ = $2->addType( $1 ); }
    12051203        | type_specifier_nobody variable_abstract_declarator
    12061204                { $$ = $2->addType( $1 ); }
    12071205        | cfa_abstract_declarator_tuple no_attr_identifier      // CFA
    1208                 {
    1209                         $$ = $1->addName( $2 );
    1210                 }
     1206                { $$ = $1->addName( $2 ); }
    12111207        | cfa_abstract_declarator_tuple                                         // CFA
    12121208        ;
     
    12861282
    12871283declaration_list_opt:                                                                   // used at beginning of switch statement
    1288         pop
     1284        pop     // empty
    12891285                { $$ = nullptr; }
    12901286        | declaration_list
     
    13211317
    13221318local_label_list:                                                                               // GCC, local label
    1323         no_attr_identifier_or_type_name                         {}
    1324         | local_label_list ',' no_attr_identifier_or_type_name {}
     1319        no_attr_identifier_or_type_name
     1320        | local_label_list ',' no_attr_identifier_or_type_name
    13251321        ;
    13261322
     
    13851381        | declaration_qualifier_list type_qualifier_list cfa_function_specifier
    13861382                { $$ = $3->addQualifiers( $1 )->addQualifiers( $2 ); }
    1387         | cfa_function_declaration ',' identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
     1383        | cfa_function_declaration ',' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
    13881384                {
    13891385                        // Append the return type at the start (left-hand-side) to each identifier in the list.
    13901386                        DeclarationNode * ret = new DeclarationNode;
    13911387                        ret->type = maybeClone( $1->type->base );
    1392                         $$ = $1->appendList( DeclarationNode::newFunction( $3, ret, $5, nullptr ) );
     1388                        $$ = $1->appendList( DeclarationNode::newFunction( $3, ret, $6, nullptr ) );
    13931389                }
    13941390        ;
    13951391
    13961392cfa_function_specifier:                                                                 // CFA
    1397 //      '[' ']' identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' // S/R conflict
     1393//      '[' ']' identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')' // S/R conflict
    13981394//              {
    13991395//                      $$ = DeclarationNode::newFunction( $3, DeclarationNode::newTuple( 0 ), $6, 0, true );
    14001396//              }
    1401 //      '[' ']' identifier '(' push cfa_parameter_type_list_opt pop ')'
     1397//      '[' ']' identifier '(' push cfa_parameter_ellipsis_list_opt pop ')'
    14021398//              {
    14031399//                      typedefTable.setNextIdentifier( *$5 );
    14041400//                      $$ = DeclarationNode::newFunction( $5, DeclarationNode::newTuple( 0 ), $8, 0, true );
    14051401//              }
    1406 //      | '[' ']' TYPEDEFname '(' push cfa_parameter_type_list_opt pop ')'
     1402//      | '[' ']' TYPEDEFname '(' push cfa_parameter_ellipsis_list_opt pop ')'
    14071403//              {
    14081404//                      typedefTable.setNextIdentifier( *$5 );
     
    14121408                // identifier_or_type_name must be broken apart because of the sequence:
    14131409                //
    1414                 //   '[' ']' identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
     1410                //   '[' ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')'
    14151411                //   '[' ']' type_specifier
    14161412                //
    14171413                // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be
    14181414                // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name.
    1419         cfa_abstract_tuple identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
     1415        cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
    14201416                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    1421                 { $$ = DeclarationNode::newFunction( $2, $1, $4, 0 ); }
    1422         | cfa_function_return identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
    1423                 { $$ = DeclarationNode::newFunction( $2, $1, $4, 0 ); }
     1417                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
     1418        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_ellipsis_list_opt pop ')'
     1419                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
    14241420        ;
    14251421
    14261422cfa_function_return:                                                                    // CFA
    1427         '[' cfa_parameter_list ']'
    1428                 { $$ = DeclarationNode::newTuple( $2 ); }
    1429         | '[' cfa_parameter_list ',' cfa_abstract_parameter_list ']'
    1430                 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the
    1431                 // ']'.
    1432                 { $$ = DeclarationNode::newTuple( $2->appendList( $4 ) ); }
     1423        '[' push cfa_parameter_list pop ']'
     1424                { $$ = DeclarationNode::newTuple( $3 ); }
     1425        | '[' push cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ']'
     1426                // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the ']'.
     1427                { $$ = DeclarationNode::newTuple( $3->appendList( $7 ) ); }
    14331428        ;
    14341429
     
    16041599
    16051600forall:
    1606         FORALL '('
    1607                 {
    1608                         typedefTable.enterScope();
    1609                 }
    1610           type_parameter_list ')'                                                       // CFA
    1611                 {
    1612                         typedefTable.leaveScope();
    1613                         $$ = DeclarationNode::newForall( $4 );
    1614                 }
     1601        FORALL '(' push type_parameter_list pop ')'                                     // CFA
     1602                { $$ = DeclarationNode::newForall( $4 ); }
    16151603        ;
    16161604
     
    19801968        ;
    19811969
    1982 cfa_parameter_type_list_opt:                                                    // CFA, abstract + real
     1970cfa_parameter_ellipsis_list_opt:                                                        // CFA, abstract + real
    19831971        // empty
    19841972                { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); }
     
    19871975        | cfa_abstract_parameter_list
    19881976        | cfa_parameter_list
    1989         | cfa_parameter_list ',' cfa_abstract_parameter_list
    1990                 { $$ = $1->appendList( $3 ); }
    1991         | cfa_abstract_parameter_list ',' ELLIPSIS
     1977        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list
     1978                { $$ = $1->appendList( $5 ); }
     1979        | cfa_abstract_parameter_list pop ',' push ELLIPSIS
    19921980                { $$ = $1->addVarArgs(); }
    1993         | cfa_parameter_list ',' ELLIPSIS
     1981        | cfa_parameter_list pop ',' push ELLIPSIS
    19941982                { $$ = $1->addVarArgs(); }
    19951983        ;
     
    19991987                // factored out from cfa_parameter_list, flattening the rules to get lookahead to the ']'.
    20001988        cfa_parameter_declaration
    2001         | cfa_abstract_parameter_list ',' cfa_parameter_declaration
    2002                 { $$ = $1->appendList( $3 ); }
    2003         | cfa_parameter_list ',' cfa_parameter_declaration
    2004                 { $$ = $1->appendList( $3 ); }
    2005         | cfa_parameter_list ',' cfa_abstract_parameter_list ',' cfa_parameter_declaration
    2006                 { $$ = $1->appendList( $3 )->appendList( $5 ); }
     1989        | cfa_abstract_parameter_list pop ',' push cfa_parameter_declaration
     1990                { $$ = $1->appendList( $5 ); }
     1991        | cfa_parameter_list pop ',' push cfa_parameter_declaration
     1992                { $$ = $1->appendList( $5 ); }
     1993        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ',' push cfa_parameter_declaration
     1994                { $$ = $1->appendList( $5 )->appendList( $9 ); }
    20071995        ;
    20081996
    20091997cfa_abstract_parameter_list:                                                    // CFA, new & old style abstract
    20101998        cfa_abstract_parameter_declaration
    2011         | cfa_abstract_parameter_list ',' cfa_abstract_parameter_declaration
    2012                 { $$ = $1->appendList( $3 ); }
     1999        | cfa_abstract_parameter_list pop ',' push cfa_abstract_parameter_declaration
     2000                { $$ = $1->appendList( $5 ); }
    20132001        ;
    20142002
     
    21592147        '.' no_attr_identifier                                                          // C99, field name
    21602148                { $$ = new ExpressionNode( build_varref( $2 ) ); }
    2161         | '[' assignment_expression ']'                                         // C99, single array element
     2149        | '[' push assignment_expression pop ']'                        // C99, single array element
    21622150                // assignment_expression used instead of constant_expression because of shift/reduce conflicts with tuple.
    2163                 { $$ = $2; }
    2164         | '[' subrange ']'                                                                      // CFA, multiple array elements
    2165                 { $$ = $2; }
    2166         | '[' constant_expression ELLIPSIS constant_expression ']' // GCC, multiple array elements
    2167                 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $2 ), maybeMoveBuild< Expression >( $4 ) ) ); }
    2168         | '.' '[' field_list ']'                                                        // CFA, tuple field selector
    21692151                { $$ = $3; }
     2152        | '[' push subrange pop ']'                                                     // CFA, multiple array elements
     2153                { $$ = $3; }
     2154        | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements
     2155                { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); }
     2156        | '.' '[' push field_list pop ']'                                       // CFA, tuple field selector
     2157                { $$ = $4; }
    21702158        ;
    21712159
     
    22382226        '|' no_attr_identifier_or_type_name '(' type_list ')'
    22392227                { $$ = DeclarationNode::newTraitUse( $2, $4 ); }
    2240         | '|' '{' push trait_declaration_list '}'
     2228        | '|' '{' push trait_declaration_list pop '}'
    22412229                { $$ = $4; }
    2242         | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}' '(' type_list ')'
     2230        | '|' '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}' '(' type_list ')'
    22432231                { SemanticError( yylloc, "Generic data-type assertion is currently unimplemented." ); $$ = nullptr; }
    22442232        ;
     
    22862274        TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' '}'
    22872275                { $$ = DeclarationNode::newTrait( $2, $5, 0 ); }
    2288         | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{'
    2289                 { typedefTable.enterScope(); }
    2290           trait_declaration_list '}'
     2276        | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' push trait_declaration_list pop '}'
    22912277                { $$ = DeclarationNode::newTrait( $2, $5, $10 ); }
    22922278        ;
     
    22942280trait_declaration_list:                                                                 // CFA
    22952281        trait_declaration
    2296         | trait_declaration_list push trait_declaration
    2297                 { $$ = $1->appendList( $3 ); }
     2282        | trait_declaration_list pop push trait_declaration
     2283                { $$ = $1->appendList( $4 ); }
    22982284        ;
    22992285
    23002286trait_declaration:                                                                              // CFA
    2301         cfa_trait_declaring_list pop ';'
    2302         | trait_declaring_list pop ';'
     2287        cfa_trait_declaring_list ';'
     2288        | trait_declaring_list ';'
    23032289        ;
    23042290
    23052291cfa_trait_declaring_list:                                                               // CFA
    23062292        cfa_variable_specifier
    2307                 { $$ = $1; }
    23082293        | cfa_function_specifier
    2309                 { $$ = $1; }
    23102294        | cfa_trait_declaring_list pop ',' push identifier_or_type_name
    23112295                { $$ = $1->appendList( $1->cloneType( $5 ) ); }
     
    23662350                }
    23672351        | type_qualifier_list
    2368                 {
    2369                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2370                 }
     2352                { if ( $1->type->forall ) xxx = forall = true; } // remember generic type
    23712353          push '{' external_definition_list '}'                         // CFA, namespace
    23722354                {
     
    23812363                }
    23822364        | declaration_qualifier_list
    2383                 {
    2384                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2385                 }
     2365                { if ( $1->type->forall ) xxx = forall = true; } // remember generic type
    23862366          push '{' external_definition_list '}'                         // CFA, namespace
    23872367                {
     
    24232403                // declaration must still have a type_specifier.  OBSOLESCENT (see 1)
    24242404        | function_declarator compound_statement
    2425                 {
    2426                         typedefTable.leaveScope();
    2427                         $$ = $1->addFunctionBody( $2 );
    2428                 }
     2405                { $$ = $1->addFunctionBody( $2 ); }
    24292406        | KR_function_declarator KR_declaration_list_opt compound_statement
    2430                 {
    2431                         typedefTable.leaveScope();
    2432                         $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 );
    2433                 }
     2407                { $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); }
    24342408        ;
    24352409
     
    24442418        cfa_function_declaration with_clause_opt compound_statement     // CFA
    24452419                {
    2446                         typedefTable.leaveScope();
    24472420                        // Add the function body to the last identifier in the function definition list, i.e., foo3:
    24482421                        //   [const double] foo1(), foo2( int ), foo3( double ) { return 3.0; }
     
    24532426                {
    24542427                        rebindForall( $1, $2 );
    2455                         typedefTable.leaveScope();
    24562428                        $$ = $2->addFunctionBody( $4, $3 )->addType( $1 );
    24572429                }
     
    24592431                {
    24602432                        rebindForall( $1, $2 );
    2461                         typedefTable.leaveScope();
    24622433                        $$ = $2->addFunctionBody( $4, $3 )->addType( $1 );
    24632434                }
    24642435                // handles default int return type, OBSOLESCENT (see 1)
    24652436        | type_qualifier_list function_declarator with_clause_opt compound_statement
    2466                 {
    2467                         typedefTable.leaveScope();
    2468                         $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 );
    2469                 }
     2437                { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); }
    24702438                // handles default int return type, OBSOLESCENT (see 1)
    24712439        | declaration_qualifier_list function_declarator with_clause_opt compound_statement
    2472                 {
    2473                         typedefTable.leaveScope();
    2474                         $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 );
    2475                 }
     2440                { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); }
    24762441                // handles default int return type, OBSOLESCENT (see 1)
    24772442        | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement
    2478                 {
    2479                         typedefTable.leaveScope();
    2480                         $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 );
    2481                 }
     2443                { $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); }
    24822444
    24832445                // Old-style K&R function definition, OBSOLESCENT (see 4)
     
    24852447                {
    24862448                        rebindForall( $1, $2 );
    2487                         typedefTable.leaveScope();
    24882449                        $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addType( $1 );
    24892450                }
    24902451                // handles default int return type, OBSOLESCENT (see 1)
    24912452        | type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2492                 {
    2493                         typedefTable.leaveScope();
    2494                         $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 );
    2495                 }
     2453                { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); }
    24962454                // handles default int return type, OBSOLESCENT (see 1)
    24972455        | declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2498                 {
    2499                         typedefTable.leaveScope();
    2500                         $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 );
    2501                 }
     2456                { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); }
    25022457                // handles default int return type, OBSOLESCENT (see 1)
    25032458        | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2504                 {
    2505                         typedefTable.leaveScope();
    2506                         $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 );
    2507                 }
     2459                { $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); }
    25082460        ;
    25092461
     
    27022654        paren_identifier '(' identifier_list ')'                        // function_declarator handles empty parameter
    27032655                { $$ = $1->addIdList( $3 ); }
    2704         | '(' KR_function_ptr ')' '(' parameter_type_list_opt ')'
    2705                 { $$ = $2->addParamList( $5 ); }
     2656        | '(' KR_function_ptr ')' '(' push parameter_type_list_opt pop ')'
     2657                { $$ = $2->addParamList( $6 ); }
    27062658        | '(' KR_function_no_ptr ')'                                            // redundant parenthesis
    27072659                { $$ = $2; }
     
    28212773
    28222774identifier_parameter_function:
    2823         paren_identifier '(' parameter_type_list_opt ')'        // empty parameter list OBSOLESCENT (see 3)
    2824                 { $$ = $1->addParamList( $3 ); }
    2825         | '(' identifier_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2826                 { $$ = $2->addParamList( $5 ); }
     2775        paren_identifier '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2776                { $$ = $1->addParamList( $4 ); }
     2777        | '(' identifier_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2778                { $$ = $2->addParamList( $6 ); }
    28272779        | '(' identifier_parameter_function ')'                         // redundant parenthesis
    28282780                { $$ = $2; }
     
    28742826
    28752827type_parameter_function:
    2876         typedef '(' parameter_type_list_opt ')'                         // empty parameter list OBSOLESCENT (see 3)
    2877                 { $$ = $1->addParamList( $3 ); }
    2878         | '(' type_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2879                 { $$ = $2->addParamList( $5 ); }
     2828        typedef '(' push parameter_type_list_opt pop ')'        // empty parameter list OBSOLESCENT (see 3)
     2829                { $$ = $1->addParamList( $4 ); }
     2830        | '(' type_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2831                { $$ = $2->addParamList( $6 ); }
    28802832        ;
    28812833
     
    29242876
    29252877abstract_function:
    2926         '(' parameter_type_list_opt ')'                                         // empty parameter list OBSOLESCENT (see 3)
    2927                 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $2, nullptr ); }
    2928         | '(' abstract_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2929                 { $$ = $2->addParamList( $5 ); }
     2878        '(' push parameter_type_list_opt pop ')'                        // empty parameter list OBSOLESCENT (see 3)
     2879                { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr ); }
     2880        | '(' abstract_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2881                { $$ = $2->addParamList( $6 ); }
    29302882        | '(' abstract_function ')'                                                     // redundant parenthesis
    29312883                { $$ = $2; }
     
    29422894
    29432895multi_array_dimension:
    2944         '[' assignment_expression ']'
    2945                 { $$ = DeclarationNode::newArray( $2, 0, false ); }
    2946         | '[' '*' ']'                                                                           // C99
     2896        '[' push assignment_expression pop ']'
     2897                { $$ = DeclarationNode::newArray( $3, 0, false ); }
     2898        | '[' push '*' pop ']'                                                          // C99
    29472899                { $$ = DeclarationNode::newVarArray( 0 ); }
    2948         | multi_array_dimension '[' assignment_expression ']'
    2949                 { $$ = $1->addArray( DeclarationNode::newArray( $3, 0, false ) ); }
    2950         | multi_array_dimension '[' '*' ']'                                     // C99
     2900        | multi_array_dimension '[' push assignment_expression pop ']'
     2901                { $$ = $1->addArray( DeclarationNode::newArray( $4, 0, false ) ); }
     2902        | multi_array_dimension '[' push '*' pop ']'            // C99
    29512903                { $$ = $1->addArray( DeclarationNode::newVarArray( 0 ) ); }
    29522904        ;
     
    30152967
    30162968abstract_parameter_function:
    3017         '(' parameter_type_list_opt ')'                                         // empty parameter list OBSOLESCENT (see 3)
    3018                 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $2, nullptr ); }
    3019         | '(' abstract_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    3020                 { $$ = $2->addParamList( $5 ); }
     2969        '(' push parameter_type_list_opt pop ')'                        // empty parameter list OBSOLESCENT (see 3)
     2970                { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr ); }
     2971        | '(' abstract_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2972                { $$ = $2->addParamList( $6 ); }
    30212973        | '(' abstract_parameter_function ')'                           // redundant parenthesis
    30222974                { $$ = $2; }
     
    30392991        '[' ']'
    30402992                { $$ = DeclarationNode::newArray( 0, 0, false ); }
    3041         // multi_array_dimension handles the '[' '*' ']' case
    3042         | '[' type_qualifier_list '*' ']'                                       // remaining C99
    3043                 { $$ = DeclarationNode::newVarArray( $2 ); }
    3044         | '[' type_qualifier_list ']'
    3045                 { $$ = DeclarationNode::newArray( 0, $2, false ); }
    3046         // multi_array_dimension handles the '[' assignment_expression ']' case
    3047         | '[' type_qualifier_list assignment_expression ']'
    3048                 { $$ = DeclarationNode::newArray( $3, $2, false ); }
    3049         | '[' STATIC type_qualifier_list_opt assignment_expression ']'
    3050                 { $$ = DeclarationNode::newArray( $4, $3, true ); }
    3051         | '[' type_qualifier_list STATIC assignment_expression ']'
    3052                 { $$ = DeclarationNode::newArray( $4, $2, true ); }
     2993                // multi_array_dimension handles the '[' '*' ']' case
     2994        | '[' push type_qualifier_list '*' pop ']'                      // remaining C99
     2995                { $$ = DeclarationNode::newVarArray( $3 ); }
     2996        | '[' push type_qualifier_list pop ']'
     2997                { $$ = DeclarationNode::newArray( 0, $3, false ); }
     2998                // multi_array_dimension handles the '[' assignment_expression ']' case
     2999        | '[' push type_qualifier_list assignment_expression pop ']'
     3000                { $$ = DeclarationNode::newArray( $4, $3, false ); }
     3001        | '[' push STATIC type_qualifier_list_opt assignment_expression pop ']'
     3002                { $$ = DeclarationNode::newArray( $5, $4, true ); }
     3003        | '[' push type_qualifier_list STATIC assignment_expression pop ']'
     3004                { $$ = DeclarationNode::newArray( $5, $3, true ); }
    30533005        ;
    30543006
     
    30943046
    30953047variable_abstract_function:
    3096         '(' variable_abstract_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    3097                 { $$ = $2->addParamList( $5 ); }
     3048        '(' variable_abstract_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     3049                { $$ = $2->addParamList( $6 ); }
    30983050        | '(' variable_abstract_function ')'                            // redundant parenthesis
    30993051                { $$ = $2; }
     
    31583110
    31593111cfa_array_parameter_1st_dimension:
    3160         '[' type_qualifier_list '*' ']'                                         // remaining C99
    3161                 { $$ = DeclarationNode::newVarArray( $2 ); }
    3162         | '[' type_qualifier_list assignment_expression ']'
    3163                 { $$ = DeclarationNode::newArray( $3, $2, false ); }
    3164         | '[' declaration_qualifier_list assignment_expression ']'
     3112        '[' push type_qualifier_list '*' pop ']'                        // remaining C99
     3113                { $$ = DeclarationNode::newVarArray( $3 ); }
     3114        | '[' push type_qualifier_list assignment_expression pop ']'
     3115                { $$ = DeclarationNode::newArray( $4, $3, false ); }
     3116        | '[' push declaration_qualifier_list assignment_expression pop ']'
    31653117                // declaration_qualifier_list must be used because of shift/reduce conflict with
    31663118                // assignment_expression, so a semantic check is necessary to preclude them as a type_qualifier cannot
    31673119                // appear in this context.
    3168                 { $$ = DeclarationNode::newArray( $3, $2, true ); }
    3169         | '[' declaration_qualifier_list type_qualifier_list assignment_expression ']'
    3170                 { $$ = DeclarationNode::newArray( $4, $3->addQualifiers( $3 ), true ); }
     3120                { $$ = DeclarationNode::newArray( $4, $3, true ); }
     3121        | '[' push declaration_qualifier_list type_qualifier_list assignment_expression pop ']'
     3122                { $$ = DeclarationNode::newArray( $5, $4->addQualifiers( $3 ), true ); }
    31713123        ;
    31723124
     
    31803132//
    31813133//              cfa_abstract_tuple identifier_or_type_name
    3182 //              '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
     3134//              '[' cfa_parameter_list ']' identifier_or_type_name '(' cfa_parameter_ellipsis_list_opt ')'
    31833135//
    31843136// since a function return type can be syntactically identical to a tuple type:
     
    32373189
    32383190cfa_abstract_tuple:                                                                             // CFA
    3239         '[' cfa_abstract_parameter_list ']'
    3240                 { $$ = DeclarationNode::newTuple( $2 ); }
     3191        '[' push cfa_abstract_parameter_list pop ']'
     3192                { $$ = DeclarationNode::newTuple( $3 ); }
     3193        | '[' push type_specifier_nobody ELLIPSIS ']'
     3194                { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; }
     3195        | '[' push type_specifier_nobody ELLIPSIS constant_expression ']'
     3196                { SemanticError( yylloc, "Tuple array currently unimplemented." ); $$ = nullptr; }
    32413197        ;
    32423198
    32433199cfa_abstract_function:                                                                  // CFA
    3244 //      '[' ']' '(' cfa_parameter_type_list_opt ')'
     3200//      '[' ']' '(' cfa_parameter_ellipsis_list_opt ')'
    32453201//              { $$ = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), $4, nullptr ); }
    3246         cfa_abstract_tuple '(' cfa_parameter_type_list_opt ')'
    3247                 { $$ = DeclarationNode::newFunction( nullptr, $1, $3, nullptr ); }
    3248         | cfa_function_return '(' cfa_parameter_type_list_opt ')'
    3249                 { $$ = DeclarationNode::newFunction( nullptr, $1, $3, nullptr ); }
     3202        cfa_abstract_tuple '(' push cfa_parameter_ellipsis_list_opt pop ')'
     3203                { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); }
     3204        | cfa_function_return '(' push cfa_parameter_ellipsis_list_opt pop ')'
     3205                { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); }
    32503206        ;
    32513207
  • src/ResolvExpr/CommonType.cc

    r96812c0 r054514d  
    176176        }
    177177
    178         static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
     178        static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] =
    179179        {
    180 /*              Bool            Char    SignedChar      UnsignedChar    ShortSignedInt  ShortUnsignedInt        SignedInt       UnsignedInt     LongSignedInt   LongUnsignedInt LongLongSignedInt       LongLongUnsignedInt     Float   Double  LongDouble      FloatComplex    DoubleComplex   LongDoubleComplex       FloatImaginary  DoubleImaginary LongDoubleImaginary   SignedInt128   UnsignedInt128 */
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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, },
    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 },
    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, },
    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, },
     180/*              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 },
    204206        };
     207        static_assert(
     208                sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
     209                "Each basic type kind should have a corresponding row in the combined type matrix"
     210        );
    205211
    206212        CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
  • src/ResolvExpr/ConversionCost.cc

    r96812c0 r054514d  
    230230*/
    231231
    232         static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
    233         /* Src \ Dest:  Bool    Char    SChar   UChar   Short   UShort  Int     UInt    Long    ULong   LLong   ULLong  Float   Double  LDbl    FCplex  DCplex  LDCplex FImag   DImag   LDImag  I128,   U128 */
    234                 /* Bool */      { 0,    1,              1,              2,              3,              4,              5,              6,              6,              7,              8,              9,              12,             13,             14,             12,             13,             14,             -1,             -1,             -1,             10,             11,     },
    235                 /* Char */      { -1,   0,              -1,             1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,     },
    236                 /* SChar */ { -1,       -1,             0,              1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,     },
    237                 /* UChar */ { -1,       -1,             -1,             0,              1,              2,              3,              4,              4,              5,              6,              7,              10,             11,             12,             10,             11,             12,             -1,             -1,             -1,             8,              9,      },
    238                 /* Short */ { -1,       -1,             -1,             -1,             0,              1,              2,              3,              3,              4,              5,              6,              9,              10,             11,             9,              10,             11,             -1,             -1,             -1,             7,              8,      },
    239                 /* UShort */{ -1,       -1,             -1,             -1,             -1,             0,              1,              2,              2,              3,              4,              5,              8,              9,              10,             8,              9,              10,             -1,             -1,             -1,             6,              7,      },
    240                 /* Int */       { -1,   -1,             -1,             -1,             -1,             -1,             0,              1,              1,              2,              3,              4,              7,              8,              9,              7,              8,              9,              -1,             -1,             -1,             5,              6,      },
    241                 /* UInt */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,      },
    242                 /* Long */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,      },
    243                 /* ULong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              5,              6,              7,              5,              6,              7,              -1,             -1,             -1,             3,              4,      },
    244                 /* LLong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              4,              5,              6,              4,              5,              6,              -1,             -1,             -1,             2,              3,      },
    245                 /* ULLong */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              3,              4,              5,              3,              4,              5,              -1,             -1,             -1,             1,              2,      },
    246 
    247                 /* Float */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              1,              2,              3,              -1,             -1,             -1,             -1,             -1,     },
    248                 /* Double */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             1,              2,              -1,             -1,             -1,             -1,             -1,     },
    249                 /* LDbl */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,     },
    250                 /* FCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              -1,             -1,             -1,             -1,             -1,     },
    251                 /* DCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             -1,             -1,             -1,             -1,     },
    252                 /* LDCplex */{ -1,      -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             -1,             -1,             -1,     },
    253                 /* FImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              0,              1,              2,              -1,             -1,     },
    254                 /* DImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              -1,             0,              1,              -1,             -1,     },
    255                 /* LDImag */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              -1,             -1,             0,              -1,             -1,     },
    256 
    257                 /* I128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             2,              3,              4,              3,              4,              5,              -1,             -1,             -1,             0,              1,      },
    258                 /* U128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              2,              3,              4,              -1,             -1,             -1,             -1,             0,      },
     232        static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
     233        /* Src \ Dest:  Bool    Char    SChar   UChar   Short   UShort  Int     UInt    Long    ULong   LLong   ULLong  Float   Double  LDbl    FCplex  DCplex  LDCplex FImag   DImag   LDImag  I128,   U128, F80, F128 */
     234                /* Bool */      { 0,    1,              1,              2,              3,              4,              5,              6,              6,              7,              8,              9,              12,             13,             14,             12,             13,             14,             -1,             -1,             -1,             10,             11,       14,   15},
     235                /* Char */      { -1,   0,              -1,             1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,       13,   14},
     236                /* SChar */ { -1,       -1,             0,              1,              2,              3,              4,              5,              5,              6,              7,              8,              11,             12,             13,             11,             12,             13,             -1,             -1,             -1,             9,              10,       13,   14},
     237                /* UChar */ { -1,       -1,             -1,             0,              1,              2,              3,              4,              4,              5,              6,              7,              10,             11,             12,             10,             11,             12,             -1,             -1,             -1,             8,              9,        12,   13},
     238                /* Short */ { -1,       -1,             -1,             -1,             0,              1,              2,              3,              3,              4,              5,              6,              9,              10,             11,             9,              10,             11,             -1,             -1,             -1,             7,              8,        11,   12},
     239                /* UShort */{ -1,       -1,             -1,             -1,             -1,             0,              1,              2,              2,              3,              4,              5,              8,              9,              10,             8,              9,              10,             -1,             -1,             -1,             6,              7,        10,   11},
     240                /* Int */       { -1,   -1,             -1,             -1,             -1,             -1,             0,              1,              1,              2,              3,              4,              7,              8,              9,              7,              8,              9,              -1,             -1,             -1,             5,              6,        9,    10},
     241                /* UInt */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,        8,    9},
     242                /* Long */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              3,              6,              7,              8,              6,              7,              8,              -1,             -1,             -1,             4,              5,        8,    9},
     243                /* ULong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              5,              6,              7,              5,              6,              7,              -1,             -1,             -1,             3,              4,        7,    8},
     244                /* LLong */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              4,              5,              6,              4,              5,              6,              -1,             -1,             -1,             2,              3,        6,    7},
     245                /* ULLong */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              3,              4,              5,              3,              4,              5,              -1,             -1,             -1,             1,              2,        5,    6},
     246
     247                /* Float */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              1,              2,              3,              -1,             -1,             -1,             -1,             -1,       2,    3},
     248                /* Double */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             1,              2,              -1,             -1,             -1,             -1,             -1,       1,    2},
     249                /* LDbl */      { -1,   -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             1,              -1,             -1,             -1,             -1,             -1,       -1,   1},
     250                /* FCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              2,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
     251                /* DCplex */{ -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              1,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
     252                /* LDCplex */{ -1,      -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             0,              -1,             -1,             -1,             -1,             -1,       -1,   -1},
     253                /* FImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              0,              1,              2,              -1,             -1,       -1,   -1},
     254                /* DImag */ { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              -1,             0,              1,              -1,             -1,       -1,   -1},
     255                /* LDImag */{ -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},
     256
     257                /* I128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             2,              3,              4,              3,              4,              5,              -1,             -1,             -1,             0,              1,        4,    4},
     258                /* U128 */  { -1,       -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             -1,             1,              2,              3,              2,              3,              4,              -1,             -1,             -1,             -1,             0,        3,    3},
     259
     260                /* F80 */       { -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},
     261                /* F128 */      { -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},
    259262        };
     263        static_assert(
     264                sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
     265                "Each basic type kind should have a corresponding row in the cost matrix"
     266        );
     267
    260268
    261269        void ConversionCost::postvisit( VoidType * ) {
  • src/SymTab/Mangler.cc

    r96812c0 r054514d  
    171171                                        "w",    // SignedInt128
    172172                                        "Uw",   // UnsignedInt128
     173                                        "a",   // Float80
     174                                        "A",   // Float128
    173175                                };
     176                                static_assert(
     177                                        sizeof(btLetter)/sizeof(btLetter[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
     178                                        "Each basic type kind should have a corresponding mangler letter"
     179                                );
    174180
    175181                                printQualifiers( basicType );
     182                                assert( basicType->get_kind() < sizeof(btLetter)/sizeof(btLetter[0]) );
    176183                                mangleName << btLetter[ basicType->get_kind() ];
    177184                        }
  • src/SynTree/BasicType.cc

    r96812c0 r054514d  
    5555          case DoubleImaginary:
    5656          case LongDoubleImaginary:
     57          case Float80:
     58          case Float128:
    5759                return false;
    5860          case NUMBER_OF_BASIC_TYPES:
  • src/SynTree/Type.cc

    r96812c0 r054514d  
    2424using namespace std;
    2525
    26 const char *BasicType::typeNames[BasicType::NUMBER_OF_BASIC_TYPES] = {
     26const char *BasicType::typeNames[] = {
    2727        "_Bool",
    2828        "char",
     
    4848        "__int128",
    4949        "unsigned __int128",
     50        "__float80",
     51        "__float128"
    5052};
     53static_assert(
     54        sizeof(BasicType::typeNames)/sizeof(BasicType::typeNames[0]) == BasicType::NUMBER_OF_BASIC_TYPES,
     55        "Each basic type name should have a corresponding kind enum value"
     56);
    5157
    5258Type::Type( const Qualifiers &tq, const std::list< Attribute * > & attributes ) : tq( tq ), attributes( attributes ) {}
  • src/SynTree/Type.h

    r96812c0 r054514d  
    231231                SignedInt128,
    232232                UnsignedInt128,
     233                Float80,
     234                Float128,
    233235                NUMBER_OF_BASIC_TYPES
    234236        } kind;
  • src/libcfa/bits/locks.h

    r96812c0 r054514d  
    3939#endif
    4040
    41 #if __SIZEOF_SIZE_T__ == 8
    42         #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0
    43         #define __lock_release( lock ) __sync_lock_release_8( &(lock) );
    44 #elif __SIZEOF_SIZE_T__ == 4
    45         #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0
    46         #define __lock_release( lock ) __sync_lock_release_4( &(lock) );
    47 #else
    48         #error unsupported architecture
    49 #endif
    50 
    5141struct __spinlock_t {
    52         __ALIGN__ volatile size_t lock;
     42        // Wrap in struct to prevent false sharing with debug info
     43        struct {
     44                // Align lock on 128-bit boundary
     45                __ALIGN__ volatile _Bool lock;
     46        };
    5347        #ifdef __CFA_DEBUG__
     48                // previous function to acquire the lock
    5449                const char * prev_name;
     50                // previous thread to acquire the lock
    5551                void* prev_thrd;
    5652        #endif
     
    7874        // Lock the spinlock, return false if already acquired
    7975        static inline _Bool try_lock  ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    80                 _Bool result = __lock_test_and_test_and_set( this.lock );
     76                _Bool result = (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0);
    8177                if( result ) {
    8278                        disable_interrupts();
     
    9490
    9591                for ( unsigned int i = 1;; i += 1 ) {
    96                         if ( __lock_test_and_test_and_set( this.lock ) ) break;
     92                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
    9793                        #ifndef NOEXPBACK
    9894                                // exponential spin
     
    112108        }
    113109
    114         // // Lock the spinlock, yield if already acquired
    115         // static inline void lock_yield( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {
    116         //      for ( unsigned int i = 1;; i += 1 ) {
    117         //              if ( __lock_test_and_test_and_set( this.lock ) ) break;
    118         //              yield( i );
    119         //      }
    120         //      disable_interrupts();
    121         //      __cfaabi_dbg_debug_do(
    122         //              this.prev_name = caller;
    123         //              this.prev_thrd = this_thread;
    124         //      )
    125         // }
    126 
    127110        static inline void unlock( __spinlock_t & this ) {
    128111                enable_interrupts_noPoll();
    129                 __lock_release( this.lock );
     112                __atomic_clear( &this.lock, __ATOMIC_RELEASE );
    130113        }
    131114#endif
  • src/libcfa/concurrency/alarm.c

    r96812c0 r054514d  
    1010// Created On       : Fri Jun 2 11:31:25 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr  9 13:36:18 2018
    13 // Update Count     : 61
     12// Last Modified On : Fri May 25 06:25:47 2018
     13// Update Count     : 67
    1414//
    1515
     
    3737
    3838void __kernel_set_timer( Duration alarm ) {
    39         verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%luns)", alarm.tv);
     39        verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%jins)", alarm.tv);
    4040        setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
    4141}
  • src/libcfa/concurrency/preemption.c

    r96812c0 r054514d  
    161161        void disable_interrupts() {
    162162                with( kernelTLS.preemption_state ) {
    163                         enabled = false;
     163                        #if GCC_VERSION > 50000
     164                        static_assert(__atomic_always_lock_free(sizeof(enabled), &enabled), "Must be lock-free");
     165                        #endif
     166
     167                        // Set enabled flag to false
     168                        // should be atomic to avoid preemption in the middle of the operation.
     169                        // use memory order RELAXED since there is no inter-thread on this variable requirements
     170                        __atomic_store_n(&enabled, false, __ATOMIC_RELAXED);
     171
     172                        // Signal the compiler that a fence is needed but only for signal handlers
     173                        __atomic_signal_fence(__ATOMIC_ACQUIRE);
     174
    164175                        __attribute__((unused)) unsigned short new_val = disable_count + 1;
    165176                        disable_count = new_val;
     
    171182        // If counter reaches 0, execute any pending CtxSwitch
    172183        void enable_interrupts( __cfaabi_dbg_ctx_param ) {
    173                 processor   * proc = kernelTLS.this_processor; // Cache the processor now since interrupts can start happening after the atomic add
    174                 thread_desc * thrd = kernelTLS.this_thread;       // Cache the thread now since interrupts can start happening after the atomic add
     184                processor   * proc = kernelTLS.this_processor; // Cache the processor now since interrupts can start happening after the atomic store
     185                thread_desc * thrd = kernelTLS.this_thread;       // Cache the thread now since interrupts can start happening after the atomic store
    175186
    176187                with( kernelTLS.preemption_state ){
     
    181192                        // Check if we need to prempt the thread because an interrupt was missed
    182193                        if( prev == 1 ) {
    183                                 enabled = true;
     194                                #if GCC_VERSION > 50000
     195                                static_assert(__atomic_always_lock_free(sizeof(enabled), &enabled), "Must be lock-free");
     196                                #endif
     197
     198                                // Set enabled flag to true
     199                                // should be atomic to avoid preemption in the middle of the operation.
     200                                // use memory order RELAXED since there is no inter-thread on this variable requirements
     201                                __atomic_store_n(&enabled, true, __ATOMIC_RELAXED);
     202
     203                                // Signal the compiler that a fence is needed but only for signal handlers
     204                                __atomic_signal_fence(__ATOMIC_RELEASE);
    184205                                if( proc->pending_preemption ) {
    185206                                        proc->pending_preemption = false;
     
    200221                verifyf( prev != 0u, "Incremented from %u\n", prev );                     // If this triggers someone is enabled already enabled interrupts
    201222                if( prev == 1 ) {
    202                         kernelTLS.preemption_state.enabled = true;
     223                        #if GCC_VERSION > 50000
     224                        static_assert(__atomic_always_lock_free(sizeof(kernelTLS.preemption_state.enabled), &kernelTLS.preemption_state.enabled), "Must be lock-free");
     225                        #endif
     226                        // Set enabled flag to true
     227                        // should be atomic to avoid preemption in the middle of the operation.
     228                        // use memory order RELAXED since there is no inter-thread on this variable requirements
     229                        __atomic_store_n(&kernelTLS.preemption_state.enabled, true, __ATOMIC_RELAXED);
     230
     231                        // Signal the compiler that a fence is needed but only for signal handlers
     232                        __atomic_signal_fence(__ATOMIC_RELEASE);
    203233                }
    204234        }
     
    352382
    353383        // Clear sighandler mask before context switching.
     384        #if GCC_VERSION > 50000
    354385        static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" );
     386        #endif
    355387        if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), NULL ) == -1 ) {
    356388                abort( "internal error, sigprocmask" );
  • src/prelude/Makefile.am

    r96812c0 r054514d  
    3737# create forward declarations for gcc builtins
    3838gcc-builtins.cf : gcc-builtins.c prototypes.sed
    39         ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
     39        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E -P $< | sed -r -f prototypes.sed > $@
    4040
    41 gcc-builtins.c : builtins.def prototypes.awk
    42         ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
     41gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
     42        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E prototypes.c | awk -f prototypes.awk > $@
    4343
    4444builtins.def :
  • src/prelude/Makefile.in

    r96812c0 r054514d  
    506506# create forward declarations for gcc builtins
    507507gcc-builtins.cf : gcc-builtins.c prototypes.sed
    508         ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
    509 
    510 gcc-builtins.c : builtins.def prototypes.awk
    511         ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
     508        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E -P $< | sed -r -f prototypes.sed > $@
     509
     510gcc-builtins.c : builtins.def prototypes.awk sync-builtins.cf
     511        ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -E prototypes.c | awk -f prototypes.awk > $@
    512512
    513513builtins.def :
  • src/prelude/builtins.def

    r96812c0 r054514d  
    190190
    191191/* Builtin used by implementation of Cilk Plus.  Most of these are decomposed
    192    by the compiler but a few are implemented in libcilkrts.  */ 
     192   by the compiler but a few are implemented in libcilkrts.  */
    193193#undef DEF_CILK_BUILTIN_STUB
    194194#define DEF_CILK_BUILTIN_STUB(ENUM, NAME) \
     
    204204
    205205/* Builtin used by the implementation of libsanitizer. These
    206    functions are mapped to the actual implementation of the 
     206   functions are mapped to the actual implementation of the
    207207   libtsan library. */
    208208#undef DEF_SANITIZER_BUILTIN
     
    217217#define DEF_CILKPLUS_BUILTIN(ENUM, NAME, TYPE, ATTRS)  \
    218218  DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, BT_FN_INT_VAR, BT_LAST, \
    219                false, false, false, ATTRS, false, flag_cilkplus) 
     219               false, false, false, ATTRS, false, flag_cilkplus)
    220220
    221221/* Builtin used by the implementation of Pointer Bounds Checker.  */
     
    927927DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
    928928
     929#if 0 //Ifdefed out because we hard-coded the proper overloadings of the atomic built-ins
    929930/* Synchronization Primitives.  */
    930931#include "sync-builtins.def"
    931932
    932 #if 0
    933933/* Offloading and Multi Processing builtins.  */
    934934#include "omp-builtins.def"
  • src/prelude/prototypes.awk

    r96812c0 r054514d  
    55# file "LICENCE" distributed with Cforall.
    66#
    7 # prototypes.awk -- 
     7# prototypes.awk --
    88#
    99# Author           : Peter A. Buhr
     
    1212# Last Modified On : Tue Jul  5 14:32:52 2016
    1313# Update Count     : 32
    14 # 
     14#
    1515
    1616# http://llvm.org/svn/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def
     
    8383} # BEGIN
    8484
    85 /BT_FN/ { 
     85/BT_FN/ {
    8686    for (i = 1; i <= NF; i++) {
    8787      if( match($i, "BT_FN") != 0 ) {
     
    116116
    117117      # generate function return type as macro
    118       for ( t = 0; t < N; t += 1 ) {                                    # find longest match 
     118      for ( t = 0; t < N; t += 1 ) {                                    # find longest match
    119119        type = types[t];
    120120        if ( index( prototype, type ) == 1 ) {          # found match
     
    150150        # extras
    151151        printf( "\n#include \"builtins.def\"\n\n" );
     152        printf( "\n#include \"sync-builtins.cf\"\n\n" );
    152153        printf( "extern const char *__PRETTY_FUNCTION__;\n" );
    153154} # END
  • src/prelude/prototypes.sed

    r96812c0 r054514d  
    22/targetm/s/.*//                         #Remove targetm declarations
    33/__Unsupported/s/.*//                   #Remove Unsupported types declarations
    4 s/void (const char \*)0();//            #Remove void (const char \*)0();
     4s/void \(const char \*\)0\(\);//        #Remove void (const char \*)0();
    55s/\"//g                                         #Remove extraenous quotes in declarations
    6 /__builtin_/s/_ /_/g                    #Remove extraenous spaces in declarations
     6/__builtin_/s/_ /_/g                    #Remove extraenous spaces in declarations
     7
     8#Fix gcc overloading
     9# various sed rules for the gcc sync builtins which are overloaded
     10# kept here because they generate an acceptable approximate of the correct prototypes
     11
     12#/__sync_/s/_[0-9][0-9]*\(.*\)/\(\);/g  #hack since it will accept any parameters
     13#/__atomic_/s/_[0-9][0-9]*\(.*\)/\(\);/g        #hack since it will accept any parameters
     14
     15#/_16/s/void \*/__int128 \*/g
     16#/_8/s/void \*/long long int \*/g
     17#/_4/s/void \*/int \*/g
     18#/_2/s/void \*/short \*/g
     19#/_1/s/void \*/char \*/g
     20
     21#s/([a-zA-Z0-9_ ]+)\s+__sync([a-z_]+)_([0-9]+)\((.*)\);/\1 __sync\2\(\4\,...); \1 __sync\2_\3\(\4\,...);/
     22#s/([a-zA-Z0-9_ ]+)\s+__atomic([a-z_]+)_([0-9]+)\((.*)\);/\1 __atomic\2\(\4\); \1 __atomic\2_\3\(\4\);/
  • src/tests/.expect/io2.txt

    r96812c0 r054514d  
    1 9 6 28 0 7 1 2
    2 1 2 3
    3 123
    4 123
    5 
    6 opening delimiters
    7 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    8 
    9 closing delimiters
    10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
    11 
    12 opening/closing delimiters
    13 x`1`x'2'x"3"x:4:x 5 x   6       x
    14 7
    15 x
    16 8
    17 x
    18 9
    19 x
    20 10
    21 x
    22 
    23 override opening/closing delimiters
    24 x ( 1 ) x 2 , x 3 :x: 4
    25 
    261input bacis types
    272
  • src/tests/.expect/math1.x64.txt

    r96812c0 r054514d  
    1212\ 16 256
    1313\ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    14 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    15 log2:3 3 3
    16 log10:2 2 2
    17 log1p:0.693147 0.693147180559945 0.693147180559945309
    18 ilogb:0 0 0
    19 logb:3 3 3
    20 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    21 cbrt:3 3 3
    22 hypot:1.41421 1.4142135623731 1.41421356237309505
  • src/tests/.expect/math1.x86.txt

    r96812c0 r054514d  
    1212\ 16 256
    1313\ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    14 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    15 log2:3 3 3
    16 log10:2 2 2
    17 log1p:0.693147 0.693147180559945 0.693147180559945309
    18 ilogb:0 0 0
    19 logb:3 3 3
    20 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    21 cbrt:3 3 3
    22 hypot:1.41421 1.4142135623731 1.41421356237309505
  • src/tests/.expect/math2.x64.txt

    r96812c0 r054514d  
     1log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3 3 3
     3log10:2 2 2
     4log1p:0.693147 0.693147180559945 0.693147180559945309
     5ilogb:0 0 0
     6logb:3 3 3
     7sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3 3 3
     9hypot:1.41421 1.4142135623731 1.41421356237309505
    110sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    211cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     
    615atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    716atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
    8 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    9 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    10 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    11 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    12 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    13 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    14 erf:0.842701 0.842700792949715 0.842700792949714869
    15 erfc:0.157299 0.157299207050285 0.157299207050285131
    16 lgamma:1.79176 1.79175946922805 1.791759469228055
    17 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    18 tgamma:6 6 6
  • src/tests/.expect/math2.x86.txt

    r96812c0 r054514d  
     1log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3 3 3
     3log10:2 2 2
     4log1p:0.693147 0.693147180559945 0.693147180559945309
     5ilogb:0 0 0
     6logb:3 3 3
     7sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3 3 3
     9hypot:1.41421 1.4142135623731 1.41421356237309505
    110sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    211cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     
    615atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    716atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
    8 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    9 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    10 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    11 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    12 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    13 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    14 erf:0.842701 0.842700792949715 0.842700792949714869
    15 erfc:0.157299 0.157299207050285 0.157299207050285131
    16 lgamma:1.79176 1.79175946922805 1.791759469228055
    17 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    18 tgamma:6 6 6
  • src/tests/.expect/math3.x64.txt

    r96812c0 r054514d  
    1 floor:1 1 1
    2 ceil:2 2 2
    3 trunc:3 3 3
    4 rint:2 2 2
    5 rint:2 2 2
    6 rint:2 2 2
    7 lrint:2 2 2
    8 llrint:2 2 2
    9 nearbyint:4 4 4
    10 round:2 2 2
    11 round:2 2 2
    12 round:2 2 2
    13 lround:2 2 2
    14 llround:2 2 2
    15 copysign:-1 -1 -1
    16 frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8 8 8
    18 modf:2 0.3 2 0.3 2 0.3
    19 modf:2, 0.3 2, 0.3 2, 0.3
    20 nextafter:2 2 2
    21 nexttoward:2 2 2
    22 scalbn:16 16 16
    23 scalbln:16 16 16
     1sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     2cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     3tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     4acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     5asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     6atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     7erf:0.842701 0.842700792949715 0.842700792949714869
     8erfc:0.157299 0.157299207050285 0.157299207050285131
     9lgamma:1.79176 1.79175946922805 1.791759469228055
     10lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
     11tgamma:6 6 6
  • src/tests/.expect/math3.x86.txt

    r96812c0 r054514d  
    1 floor:1 1 1
    2 ceil:2 2 2
    3 trunc:3 3 3
    4 rint:2 2 2
    5 rint:2 2 2
    6 rint:2 2 2
    7 lrint:2 2 2
    8 llrint:2 2 2
    9 nearbyint:4 4 4
    10 round:2 2 2
    11 round:2 2 2
    12 round:2 2 2
    13 lround:2 2 2
    14 llround:2 2 2
    15 copysign:-1 -1 -1
    16 frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8 8 8
    18 modf:2 0.3 2 0.3 2 0.3
    19 modf:2, 0.3 2, 0.3 2, 0.3
    20 nextafter:2 2 2
    21 nexttoward:2 2 2
    22 scalbn:16 16 16
    23 scalbln:16 16 16
     1sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     2cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     3tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     4acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     5asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     6atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     7erf:0.842701 0.842700792949715 0.842700792949714869
     8erfc:0.157299 0.157299207050285 0.157299207050285131
     9lgamma:1.79176 1.79175946922805 1.791759469228055
     10lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
     11tgamma:6 6 6
  • src/tests/Makefile.am

    r96812c0 r054514d  
    129129warnings/self-assignment: warnings/self-assignment.c @CFA_BINDIR@/@CFA_NAME@
    130130        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     131
     132#builtins
     133builtins/sync: builtins/sync.c @CFA_BINDIR@/@CFA_NAME@
     134        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
  • src/tests/Makefile.in

    r96812c0 r054514d  
    807807        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
    808808
     809#builtins
     810builtins/sync: builtins/sync.c @CFA_BINDIR@/@CFA_NAME@
     811        ${CC} ${AM_CFLAGS} ${CFLAGS} ${<} 2> ${@} -fsyntax-only
     812
    809813# Tell versions [3.59,3.63) of GNU make to not export all variables.
    810814# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/tests/concurrent/coroutineYield.c

    r96812c0 r054514d  
    33#include <stdlib>
    44#include <thread>
     5#include <time>
     6
     7#ifndef PREEMPTION_RATE
     8#define PREEMPTION_RATE 10`ms
     9#endif
     10
     11Duration default_preemption() {
     12        return PREEMPTION_RATE;
     13}
    514
    615#ifdef LONG_TEST
  • src/tests/concurrent/examples/datingService.c

    r96812c0 r054514d  
    88// Created On       : Mon Oct 30 12:56:20 2017
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Wed Mar 14 22:48:40 2018
    11 // Update Count     : 23
     10// Last Modified On : Sun May 27 09:05:18 2018
     11// Update Count     : 26
    1212//
    1313
     
    1818#include <unistd.h>                                                                             // getpid
    1919
    20 enum { NoOfPairs = 20 };
     20enum { CompCodes = 20 };                                                                // number of compatibility codes
    2121
    2222monitor DatingService {
    23         condition Girls[NoOfPairs], Boys[NoOfPairs];
     23        condition Girls[CompCodes], Boys[CompCodes];
    2424        unsigned int GirlPhoneNo, BoyPhoneNo;
    2525}; // DatingService
     
    4747} // DatingService boy
    4848
    49 unsigned int girlck[NoOfPairs];
    50 unsigned int boyck[NoOfPairs];
     49unsigned int girlck[CompCodes];
     50unsigned int boyck[CompCodes];
    5151
    5252thread Girl {
     
    8888int main() {
    8989        DatingService TheExchange;
    90         Girl * girls[NoOfPairs];
    91         Boy  * boys[NoOfPairs];
     90        Girl * girls[CompCodes];
     91        Boy  * boys[CompCodes];
    9292
    9393        srandom( /*getpid()*/ 103 );
    9494
    95         for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {
     95        for ( unsigned int i = 0; i < CompCodes; i += 1 ) {
    9696                girls[i] = new( &TheExchange, i, i );
    97                 boys[i]  = new( &TheExchange, i, NoOfPairs - ( i + 1 ) );
     97                boys[i]  = new( &TheExchange, i, CompCodes - ( i + 1 ) );
    9898        } // for
    9999
    100         for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {
     100        for ( unsigned int i = 0; i < CompCodes; i += 1 ) {
    101101                delete( boys[i] );
    102102                delete( girls[i] );
    103103        } // for
    104104
    105         for ( unsigned int i = 0; i < NoOfPairs; i += 1 ) {
     105        for ( unsigned int i = 0; i < CompCodes; i += 1 ) {
    106106                if ( girlck[ boyck[i] ] != boyck[ girlck[i] ] ) abort();
    107107        } // for
  • src/tests/concurrent/examples/matrixSum.c

    r96812c0 r054514d  
    1111// Created On       : Mon Oct  9 08:29:28 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Dec  5 22:56:46 2017
    14 // Update Count     : 4
     13// Last Modified On : Fri May 25 09:34:27 2018
     14// Update Count     : 10
    1515//
    1616
     
    2020
    2121thread Adder {
    22     int * row, cols, * subtotal;                                                // communication
     22        int * row, cols, & subtotal;                                            // communication
    2323};
    2424
    2525void ?{}( Adder & adder, int row[], int cols, int & subtotal ) {
    26     adder.row = row;
    27     adder.cols = cols;
    28     adder.subtotal = &subtotal;
     26        adder.[ row, cols ] = [ row, cols ];                            // expression disallowed in multi-member access
     27        &adder.subtotal = &subtotal;
    2928}
    3029
    31 void main( Adder & adder ) with( adder ) {
    32     *subtotal = 0;
    33     for ( int c = 0; c < cols; c += 1 ) {
    34                 *subtotal += row[c];
    35     } // for
     30void main( Adder & adder ) with( adder ) {                              // thread starts here
     31        subtotal = 0;
     32        for ( int c = 0; c < cols; c += 1 ) {
     33                subtotal += row[c];
     34        } // for
    3635}
    3736
    3837int main() {
    39     const int rows = 10, cols = 1000;
    40     int matrix[rows][cols], subtotals[rows], total = 0;
    41     processor p;                                                                                // extra kernel thread
     38        const int rows = 10, cols = 1000;
     39        int matrix[rows][cols], subtotals[rows], total = 0;
     40        processor p;                                                                            // add kernel thread
    4241
    43     for ( int r = 0; r < rows; r += 1 ) {
     42        for ( int r = 0; r < rows; r += 1 ) {
    4443                for ( int c = 0; c < cols; c += 1 ) {
    4544                        matrix[r][c] = 1;
    4645                } // for
    47     } // for
    48     Adder * adders[rows];
    49     for ( int r = 0; r < rows; r += 1 ) {                               // start threads to sum rows
     46        } // for
     47        Adder * adders[rows];
     48        for ( int r = 0; r < rows; r += 1 ) {                           // start threads to sum rows
    5049                adders[r] = &(*malloc()){ matrix[r], cols, subtotals[r] };
    5150//              adders[r] = new( matrix[r], cols, &subtotals[r] );
    52     } // for
    53     for ( int r = 0; r < rows; r += 1 ) {                               // wait for threads to finish
     51        } // for
     52        for ( int r = 0; r < rows; r += 1 ) {                           // wait for threads to finish
    5453                delete( adders[r] );
    5554                total += subtotals[r];                                                  // total subtotals
    56     } // for
    57     sout | total | endl;
     55        } // for
     56        sout | total | endl;
    5857}
    5958
  • src/tests/concurrent/signal/block.c

    r96812c0 r054514d  
    1414#include <time>
    1515
    16 #ifdef LONG_TEST
    17 static const unsigned long N = 150_000ul;
    18 #else
    19 static const unsigned long N = 5_000ul;
    20 #endif
    21 
    2216#ifndef PREEMPTION_RATE
    2317#define PREEMPTION_RATE 10`ms
     
    2721        return PREEMPTION_RATE;
    2822}
     23
     24#ifdef LONG_TEST
     25static const unsigned long N = 150_000ul;
     26#else
     27static const unsigned long N = 5_000ul;
     28#endif
    2929
    3030enum state_t { WAITED, SIGNAL, BARGE };
  • src/tests/concurrent/signal/disjoint.c

    r96812c0 r054514d  
    44#include <thread>
    55#include <time>
    6 
    7 #ifdef LONG_TEST
    8 static const unsigned long N = 300_000ul;
    9 #else
    10 static const unsigned long N = 10_000ul;
    11 #endif
    126
    137#ifndef PREEMPTION_RATE
     
    1812        return PREEMPTION_RATE;
    1913}
     14
     15#ifdef LONG_TEST
     16static const unsigned long N = 300_000ul;
     17#else
     18static const unsigned long N = 10_000ul;
     19#endif
    2020
    2121enum state_t { WAIT, SIGNAL, BARGE };
  • src/tests/concurrent/signal/wait.c

    r96812c0 r054514d  
    1212#include <time>
    1313
    14 #ifdef LONG_TEST
    15 static const unsigned long N = 375_000ul;
    16 #else
    17 static const unsigned long N = 2_500ul;
    18 #endif
    19 
    2014#ifndef PREEMPTION_RATE
    2115#define PREEMPTION_RATE 10`ms
     
    2519        return PREEMPTION_RATE;
    2620}
     21
     22#ifdef LONG_TEST
     23static const unsigned long N = 375_000ul;
     24#else
     25static const unsigned long N = 2_500ul;
     26#endif
    2727
    2828monitor global_t {};
  • src/tests/io2.c

    r96812c0 r054514d  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // io.c --
     7// io2.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 26 15:19:34 2018
    13 // Update Count     : 100
     12// Last Modified On : Thu May 24 21:17:41 2018
     13// Update Count     : 103
    1414//
    1515
     
    3737        enum { size = 10 };
    3838        char s1[size], s2[size];
    39 
    40         int x = 3, y = 5, z = 7;
    41         sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
    42         sout | 1 | 2 | 3 | endl;
    43         sout | '1' | '2' | '3' | endl;
    44         sout | 1 | "" | 2 | "" | 3 | endl;
    45         sout | endl;
    46 
    47         sout | "opening delimiters" | endl;
    48         sout
    49                  | "x (" | 1
    50                  | "x [" | 2
    51                  | "x {" | 3
    52                  | "x =" | 4
    53                  | "x $" | 5
    54                  | "x £" | 6
    55                  | "x ¥" | 7
    56                  | "x ¡" | 8
    57                  | "x ¿" | 9
    58                  | "x «" | 10
    59                  | endl | endl;
    60 
    61         sout | "closing delimiters" | endl;
    62         sout
    63                  | 1 | ", x"
    64                  | 2 | ". x"
    65                  | 3 | "; x"
    66                  | 4 | "! x"
    67                  | 5 | "? x"
    68                  | 6 | "% x"
    69                  | 7 | "¢ x"
    70                  | 8 | "» x"
    71                  | 9 | ") x"
    72                  | 10 | "] x"
    73                  | 11 | "} x"
    74                  | endl | endl;
    75 
    76         sout | "opening/closing delimiters" | endl;
    77         sout
    78                  | "x`" | 1 | "`x'" | 2
    79                  | "'x\"" | 3 | "\"x:" | 4
    80                  | ":x " | 5 | " x\t" | 6
    81                  | "\tx\f" | 7 | "\fx\v" | 8
    82                  | "\vx\n" | 9 | "\nx\r" | 10
    83                  | "\rx"
    84                  | endl | endl;
    85 
    86         sout | "override opening/closing delimiters" | endl;
    87         sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;
    88         sout | endl;
    8939
    9040        ifstream in = { "io.data" };                                            // create / open file
     
    181131// Local Variables: //
    182132// tab-width: 4 //
    183 // compile-command: "cfa io.c" //
     133// compile-command: "cfa io2.c" //
    184134// End: //
  • src/tests/math1.c

    r96812c0 r054514d  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:16:41 2017
    13 // Update Count     : 84
     12// Last Modified On : Thu May 24 21:01:15 2018
     13// Update Count     : 85
    1414//
    1515
     
    4848    sout | "\\" | b | b \ e | endl;
    4949    sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi) | endl;
    50 
    51         //---------------------- Logarithm ----------------------
    52 
    53         sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;
    54         sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;
    55         sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;
    56         sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;
    57         sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;
    58         sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;
    59 
    60         sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;
    61         sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;
    62         sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;
    6350} // main
    6451
  • src/tests/math2.c

    r96812c0 r054514d  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:40:04 2017
    13 // Update Count     : 81
     12// Last Modified On : Thu May 24 21:06:10 2018
     13// Update Count     : 82
    1414//
    1515
     
    2121        double d;
    2222        long double l;
     23
     24        //---------------------- Logarithm ----------------------
     25
     26        sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;
     27        sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;
     28        sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;
     29        sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;
     30        sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;
     31        sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;
     32
     33        sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;
     34        sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;
     35        sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;
    2336
    2437        //---------------------- Trigonometric ----------------------
     
    3245        sout | "atan2:" | atan2( 1.0F, 1.0F ) | atan2( 1.0D, 1.0D ) | atan2( 1.0L, 1.0L );
    3346        sout | "atan:" | atan( 1.0F, 1.0F ) | atan( 1.0D, 1.0D ) | atan( 1.0L, 1.0L ) | endl;
    34 
    35         //---------------------- Hyperbolic ----------------------
    36 
    37         sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
    38         sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
    39         sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
    40         sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
    41         sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
    42         sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
    43 
    44         //---------------------- Error / Gamma ----------------------
    45 
    46         sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
    47         sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
    48         sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
    49         int sign;
    50         f = lgamma( 4.0F, &sign );
    51         sout | "lgamma:" | f | sign;
    52         d = lgamma( 4.0D, &sign );
    53         sout | d | sign;
    54         l = lgamma( 4.0L, &sign );
    55         sout | l | sign | endl;
    56         sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
    5747} // main
    5848
  • src/tests/math3.c

    r96812c0 r054514d  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:40:03 2017
    13 // Update Count     : 81
     12// Last Modified On : Thu May 24 21:06:12 2018
     13// Update Count     : 82
    1414//
    1515
     
    2222        long double l;
    2323
    24         //---------------------- Nearest Integer ----------------------
     24        //---------------------- Hyperbolic ----------------------
    2525
    26         sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl;
    27         sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl;
    28         sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl;
    29         sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl;
    30         sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl;
    31         sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl;
    32         sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl;
    33         sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl;
    34         sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl;
    35         sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl;
    36         sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl;
    37         sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl;
    38         sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl;
    39         sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl;
     26        sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
     27        sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
     28        sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
     29        sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
     30        sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
     31        sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
    4032
    41         //---------------------- Manipulation ----------------------
     33        //---------------------- Error / Gamma ----------------------
    4234
    43         sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl;
    44         int exp;
    45         f = frexp( 4.0F, &exp );
    46         sout | "frexp:" | f | exp;
    47         d = frexp( 4.0D, &exp );
    48         sout | d | exp;
    49         l = frexp( 4.0L, &exp );
    50         sout | l | exp | endl;
    51         sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl;
    52         float fi;
    53         double di;
    54         long double ldi;
    55         f = modf( 2.3F, &fi );
    56         sout | "modf:" | fi | f;
    57         d = modf( 2.3D, &di );
    58         sout | di | d;
    59         l = modf( 2.3L, &ldi );
    60         sout | ldi | l | endl;
    61         sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ) | endl;
    62         sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl;
    63         sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl;
    64 
    65         sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl;
    66         sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl;
     35        sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
     36        sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
     37        sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
     38        int sign;
     39        f = lgamma( 4.0F, &sign );
     40        sout | "lgamma:" | f | sign;
     41        d = lgamma( 4.0D, &sign );
     42        sout | d | sign;
     43        l = lgamma( 4.0L, &sign );
     44        sout | l | sign | endl;
     45        sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
    6746} // main
    6847
  • src/tests/preempt_longrun/Makefile.am

    r96812c0 r054514d  
    1717repeats=10
    1818max_time=600
    19 preempt=1_000ul
     19preempt=10ul\`ms
    2020debug=-debug
    2121
  • src/tests/preempt_longrun/Makefile.in

    r96812c0 r054514d  
    450450repeats = 10
    451451max_time = 600
    452 preempt = 1_000ul
     452preempt = 10ul\`ms
    453453debug = -debug
    454454REPEAT = ${abs_top_srcdir}/tools/repeat
  • src/tests/preempt_longrun/create.c

    r96812c0 r054514d  
    11#include <kernel>
    22#include <thread>
    3 
    4 static const unsigned long N = 60_000ul;
     3#include <time>
    54
    65#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     6#error PREEMPTION_RATE not defined in makefile
    87#endif
    98
     
    1110        return PREEMPTION_RATE;
    1211}
     12
     13static const unsigned long N = 60_000ul;
    1314
    1415thread worker_t {};
  • src/tests/preempt_longrun/enter.c

    r96812c0 r054514d  
    22#include <monitor>
    33#include <thread>
    4 
    5 static const unsigned long N  = 2_100_000ul;
     4#include <time>
    65
    76#ifndef PREEMPTION_RATE
    8 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    98#endif
    109
     
    1211        return PREEMPTION_RATE;
    1312}
     13
     14static const unsigned long N  = 2_100_000ul;
    1415
    1516monitor mon_t {};
  • src/tests/preempt_longrun/enter3.c

    r96812c0 r054514d  
    22#include <monitor>
    33#include <thread>
    4 
    5 static const unsigned long N  = 500_000ul;
     4#include <time>
    65
    76#ifndef PREEMPTION_RATE
    8 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    98#endif
    109
     
    1211        return PREEMPTION_RATE;
    1312}
     13
     14static const unsigned long N  = 500_000ul;
    1415
    1516monitor mon_t {};
  • src/tests/preempt_longrun/processor.c

    r96812c0 r054514d  
    11#include <kernel>
    22#include <thread>
    3 
    4 static const unsigned long N = 5_000ul;
     3#include <time>
    54
    65#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     6#error PREEMPTION_RATE not defined in makefile
    87#endif
    98
     
    1110        return PREEMPTION_RATE;
    1211}
     12
     13static const unsigned long N = 5_000ul;
    1314
    1415int main(int argc, char* argv[]) {
  • src/tests/preempt_longrun/stack.c

    r96812c0 r054514d  
    11#include <kernel>
     2#include <math>
    23#include <thread>
    3 
    4 #include <math>
     4#include <time>
    55
    66#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    88#endif
    99
  • src/tests/preempt_longrun/yield.c

    r96812c0 r054514d  
    11#include <kernel>
    22#include <thread>
     3#include <time>
     4
     5#ifndef PREEMPTION_RATE
     6#error PREEMPTION_RATE not defined in makefile
     7#endif
     8
     9Duration default_preemption() {
     10        return PREEMPTION_RATE;
     11}
    312
    413#ifdef LONG_TEST
     
    716static const unsigned long N = 325_000ul;
    817#endif
    9 
    10 #ifndef PREEMPTION_RATE
    11 #define PREEMPTION_RATE 10`ms
    12 #endif
    13 
    14 Duration default_preemption() {
    15         return PREEMPTION_RATE;
    16 }
    1718
    1819thread worker_t {};
  • src/tests/test.py

    r96812c0 r054514d  
    7878                        else :
    7979                                print('ERROR: No expected file for test %s, ignoring it' % testname, file=sys.stderr)
    80 
    81         # make sure we have at least some test to run
    82         if not tests :
    83                 print('ERROR: No valid test to run', file=sys.stderr)
    84                 sys.exit(1)
    8580
    8681        return tests
     
    266261                tests = validTests( options )
    267262
     263        # make sure we have at least some test to run
     264        if not tests :
     265                print('ERROR: No valid test to run', file=sys.stderr)
     266                sys.exit(1)
     267
     268
    268269        # sort the test alphabetically for convenience
    269270        tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
Note: See TracChangeset for help on using the changeset viewer.