Changeset de8a0a4


Ignore:
Timestamp:
Jan 26, 2025, 6:37:05 PM (2 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
a950021
Parents:
0f070a4 (diff), 11f92fac (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:software/cfa/cfa-cc

Files:
13 added
19 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified libcfa/src/iostream.cfa

    r0f070a4 rde8a0a4  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Oct 13 10:53:09 2024
    13 // Update Count     : 2041
     12// Last Modified On : Wed Jan 22 07:31:19 2025
     13// Update Count     : 2079
    1414//
    1515
     
    777777forall( istype & | basic_istream( istype ) ) {
    778778        istype & ?|?( istype & is, bool & b ) {
    779                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    780779                int len = -1;                                                                   // len not set if no match
    781                 // remove optional leading whitespace at start of strings.
    782                 fmt( is, " " FALSE "%n", &len );                                // try false
     780                fmt( is, " " );                                                                 // remove leading whitespace
     781                fmt( is, FALSE "%n", &len );                                    // try false, returns 0
    783782                if ( len != sizeof( FALSE ) - 1 ) {                             // -1 removes null terminate
    784                         fmt( is, " " TRUE "%n", &len );                         // try true
     783                        if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     784                        fmt( is, " " );                                                         // remove leading whitespace
     785                        fmt( is, TRUE "%n", &len );                                     // try true, returns 0
    785786                        if ( len != sizeof( TRUE ) - 1 ) throwResume ExceptionInst( missing_data );
    786787                        b = true;
     
    792793
    793794        istype & ?|?( istype & is, char & c ) {
    794                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    795795                char temp;
    796796                for () {
    797                         int args = fmt( is, "%c", &temp );
     797                        int args = fmt( is, "%c", &temp );                      // can be called with EOF on
    798798                        if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    799799                        assert( args == 1 );                                            // if not EOF => a single character must be read
     
    805805
    806806        istype & ?|?( istype & is, signed char & sc ) {
    807                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    808807                int args = fmt( is, "%hhi", &sc );                              // can be multiple characters (100)
    809808                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     809                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    810810                return is;
    811811        } // ?|?
    812812
    813813        istype & ?|?( istype & is, unsigned char & usc ) {
    814                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    815814                int args = fmt( is, "%hhi", &usc );                             // can be multiple characters (-100)
    816815                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     816                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    817817                return is;
    818818        } // ?|?
    819819
    820820        istype & ?|?( istype & is, short int & si ) {
    821                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    822                 int args = fmt( is, "%hi", &si );
     821                int args = fmt( is, "%hi", &si );                               // can be called with EOF on
    823822                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     823                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    824824                return is;
    825825        } // ?|?
    826826
    827827        istype & ?|?( istype & is, unsigned short int & usi ) {
    828                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    829                 int args = fmt( is, "%hi", &usi );
     828                int args = fmt( is, "%hi", &usi );                              // can be called with EOF on
    830829                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     830                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    831831                return is;
    832832        } // ?|?
    833833
    834834        istype & ?|?( istype & is, int & i ) {
    835                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    836                 int args = fmt( is, "%i", &i );
     835                int args = fmt( is, "%i", &i );                                 // can be called with EOF on
    837836                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     837                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    838838                return is;
    839839        } // ?|?
    840840
    841841        istype & ?|?( istype & is, unsigned int & ui ) {
    842                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    843                 int args = fmt( is, "%i", &ui );
     842                int args = fmt( is, "%i", &ui );                                // can be called with EOF on
    844843                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     844                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    845845                return is;
    846846        } // ?|?
    847847
    848848        istype & ?|?( istype & is, long int & li ) {
    849                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    850                 int args = fmt( is, "%li", &li );
     849                int args = fmt( is, "%li", &li );                               // can be called with EOF on
    851850                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     851                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    852852                return is;
    853853        } // ?|?
    854854
    855855        istype & ?|?( istype & is, unsigned long int & ulli ) {
    856                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    857                 int args = fmt( is, "%li", &ulli );
     856                int args = fmt( is, "%li", &ulli );                             // can be called with EOF on
    858857                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     858                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    859859                return is;
    860860        } // ?|?
    861861
    862862        istype & ?|?( istype & is, long long int & lli ) {
    863                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    864                 int args = fmt( is, "%lli", &lli );
     863                int args = fmt( is, "%lli", &lli );                             // can be called with EOF on
    865864                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     865                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    866866                return is;
    867867        } // ?|?
    868868
    869869        istype & ?|?( istype & is, unsigned long long int & ulli ) {
    870                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    871                 int args = fmt( is, "%lli", &ulli );
     870                int args = fmt( is, "%lli", &ulli );                    // can be called with EOF on
    872871                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     872                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    873873                return is;
    874874        } // ?|?
     
    897897
    898898        istype & ?|?( istype & is, float & f ) {
    899                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    900                 int args = fmt( is, "%f", &f );
     899                int args = fmt( is, "%f", &f );                                 // can be called with EOF on
    901900                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     901                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    902902                return is;
    903903        } // ?|?
    904904
    905905        istype & ?|?( istype & is, double & d ) {
    906                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    907                 int args = fmt( is, "%lf", &d );
     906                int args = fmt( is, "%lf", &d );                                // can be called with EOF on
    908907                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     908                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    909909                return is;
    910910        } // ?|?
    911911
    912912        istype & ?|?( istype & is, long double & ld ) {
    913                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    914                 int args = fmt( is, "%Lf", &ld );
     913                int args = fmt( is, "%Lf", &ld );                               // can be called with EOF on
    915914                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
     915                if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file );
    916916                return is;
    917917        } // ?|?
    918918
    919919        istype & ?|?( istype & is, float _Complex & fc ) {
    920                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    921920                float re, im;
    922                 int args = fmt( is, "%f%fi", &re, &im );
     921                int args = fmt( is, "%f%fi", &re, &im );                // can be called with EOF on
    923922                if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data );
     923                if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );
    924924                fc = re + im * _Complex_I;
    925925                return is;
     
    927927
    928928        istype & ?|?( istype & is, double _Complex & dc ) {
    929                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    930929                double re, im;
    931                 int args = fmt( is, "%lf%lfi", &re, &im );
     930                int args = fmt( is, "%lf%lfi", &re, &im );              // can be called with EOF on
    932931                if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data );
     932                if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );
    933933                dc = re + im * _Complex_I;
    934934                return is;
     
    936936
    937937        istype & ?|?( istype & is, long double _Complex & ldc ) {
    938                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    939938                long double re, im;
    940                 int args = fmt( is, "%Lf%Lfi", &re, &im );
     939                int args = fmt( is, "%Lf%Lfi", &re, &im );              // can be called with EOF on
    941940                if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data );
     941                if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file );
    942942                ldc = re + im * _Complex_I;
    943943                return is;
     
    945945
    946946        istype & ?|?( istype & is, const char fmt[] ) {         // match text
    947                 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    948947                size_t len = strlen( fmt );
    949948                char fmtstr[len + 16];
     
    951950                strcpy( &fmtstr[len], "%n" );
    952951                len = -1;
    953                 // scanf cursor does not move if no match
    954                 fmt( is, fmtstr, &len );
    955                 if ( len == -1 ) throwResume ExceptionInst( missing_data );
     952                // scanf cursor does not move if no match, so eof cannot be detected.
     953                fmt( is, fmtstr, &len );                                                // can be called with EOF on
     954                if ( ! eof( is ) && len == -1 ) throwResume ExceptionInst( missing_data );
     955                if ( eof( is ) && len == -1 ) throwResume ExceptionInst( end_of_file );
    956956                return is;
    957957        } // ?|?
     
    999999                        char ch;
    10001000                        for ( f.wd ) {                                                          // skip N characters
    1001                                 int args = fmt( is, "%c", &ch );
     1001                                int args = fmt( is, "%c", &ch );                // can be called with EOF on
    10021002                                if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data );
    10031003                        } // for
     
    12041204forall( istype & | istream( istype ), E | CfaEnum( E ) | Serial( E ) )
    12051205istype & ?|?( istype & is, E & e ) {
    1206 //      fprintf( stderr, "here0\n" );
    1207         if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     1206//      if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    12081207
    12091208        // Match longest input enumerator string to enumerator labels, where enumerator names are unique.
    12101209
    12111210        int N = countof( E ), lnths[N], fred = 0;
    1212 //      printf( "N %d\n", N );
    12131211        int r = 0;
    1214         // for ( s; E : r; 0~@ ) {
    12151212        for ( s; E ) {                                                                          // scan string rows gathering lengths
    12161213                lnths[r] = strlen( label( s ) );
    12171214                if ( lnths[r] > fred ) fred = lnths[r];
    1218 //              fprintf( stderr, "%s %d %d\n", label( s ), lnths[r], fred );
    12191215                r += 1;
    12201216        } // for
     
    12231219        char ch, curr = '\0', prev = '\0';
    12241220
    1225         fmt( is, " " );                                                                         // skip optional whitespace
     1221        fmt( is, " " );                                                                         // remove leading whitespace
    12261222        if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    12271223
    12281224        for ( c; fred ) {                                                                       // scan columns of the label matix (some columns missing)
    12291225                int args = fmt( is, "%c", &ch );                                // read character
    1230 //              fprintf( stderr, "fmt args: %d eof: %d\n", args, eof(is) );
    12311226          if ( eof( is ) ) {
    1232 //                      fprintf( stderr, "Eof1\n" );
    12331227                        if ( c == 0 ) return is;                                        // no characters read ?
    12341228                        clear( is );                                                            // => read something => reset EOF => detect again on next read
    1235 //                      fprintf( stderr, "Eof2\n" );
    12361229                        break;
    12371230                } // if
    12381231          if ( args != 1 ) throwResume ExceptionInst( missing_data ); // may be unnecessary since reading single character
    12391232
    1240 //              printf( "read '%c'\n", ch );
    12411233                for ( r; N ) {                                                                  // scan enumeration strings for matching character in current column
    1242 //                      printf( "%d %d %d\n", c, r, lnths[r] );
    12431234                        if ( c < lnths[r] ) {                                           // string long enough for this column check ?
    12441235                                char match = label( fromInt( r ) )[c];  // optimization
    1245 //                              printf( "%c '%c'\n", match, ch );
    12461236                                // Stop on first match, could be other matches.
    12471237                                if ( (match == ch) && (c == 0 || curr == label( fromInt( r ) )[c - 1]) ) {
    1248 //                                      printf( "match %d %d %d '%c' '%c' '%c' '%c' 'c'\n", c, r, lnths[r], match, ch, prev, label( fromInt( r ) )[c - 1] );
    12491238                                        mcol = c;                                                       // matching column
    12501239                                        prev = curr;                                            // last matching character
     
    12541243                        } // if
    12551244                } else {
    1256 //                      fprintf( stderr, "finished mcol: %d ch: '%c' curr: '%c' prev: '%c'\n", mcol, ch, curr, prev );
    12571245                        ungetc( ch, is );                                                       // push back last unmatching character
    12581246                        if ( mcol == -1 ) throwResume ExceptionInst( missing_data ); // no matching character in first column
    12591247                        break;
    12601248                } // for
    1261 //              printf( "\n" );
    1262 //      } else {
    1263 //              fprintf( stderr, "finished2 %d\n", mcol );
    12641249        } // for
    12651250
     
    12671252                if ( mcol == lnths[c] - 1 ) {
    12681253                        char match = label( fromInt( c ) )[mcol];       // optimization
    1269 //                      printf( "finished1 mcol: %d c: %d lnth: %d match: '%c' curr: '%c' prev: '%c'\n", mcol, c, lnths[c], match, curr, prev );
    12701254                        if ( (match == curr) && (mcol == 0 || prev == label( fromInt( c ) )[mcol - 1]) ) {
    12711255                                e = fromInt( c );
     
    12741258                } // if
    12751259        } else {
    1276 //              fprintf( stderr, "finished3 %d\n", mcol );
    12771260                throwResume ExceptionInst( missing_data );              // no match in this column
    12781261        } // for
  • TabularUnified src/AST/Expr.cpp

    r0f070a4 rde8a0a4  
    283283: Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {}
    284284
    285 // --- CountExpr
    286 
    287 CountExpr::CountExpr( const CodeLocation & loc, const Expr * e )
    288 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(e), type( nullptr ) {}
    289 
    290 CountExpr::CountExpr( const CodeLocation & loc, const Type * t )
    291 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(nullptr), type( t ) {}
    292 
    293285// --- AlignofExpr
    294286
    295287AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * t )
    296288: Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {}
     289
     290// --- CountofExpr
     291
     292CountofExpr::CountofExpr( const CodeLocation & loc, const Type * t )
     293: Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), type( t ) {}
    297294
    298295// --- OffsetofExpr
  • TabularUnified src/AST/Expr.hpp

    r0f070a4 rde8a0a4  
    490490};
    491491
    492 class CountExpr final : public Expr {
    493 public:
    494         ptr<Expr> expr;
    495         ptr<Type> type;
    496 
    497         CountExpr( const CodeLocation & loc, const Expr * t );
    498         CountExpr( const CodeLocation & loc, const Type * t );
    499 
    500         const Expr * accept( Visitor & v )const override { return v.visit( this ); }
    501 private:
    502         CountExpr * clone() const override { return new CountExpr( *this ); }
    503         MUTATE_FRIEND
    504 };
    505 
    506492/// alignof expression, e.g. `alignof(int)`, `alignof 3+4`
    507493class AlignofExpr final : public Expr {
     
    514500private:
    515501        AlignofExpr * clone() const override { return new AlignofExpr{ *this }; }
     502        MUTATE_FRIEND
     503};
     504
     505/// countof expression, e.g. `countof(AnEnum)`, `countof pred(Head)`
     506class CountofExpr final : public Expr {
     507public:
     508        ptr<Type> type;
     509
     510        CountofExpr( const CodeLocation & loc, const Type * t );
     511
     512        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
     513private:
     514        CountofExpr * clone() const override { return new CountofExpr( *this ); }
    516515        MUTATE_FRIEND
    517516};
  • TabularUnified src/AST/Fwd.hpp

    r0f070a4 rde8a0a4  
    8686class ConstantExpr;
    8787class SizeofExpr;
    88 class CountExpr;
    8988class AlignofExpr;
     89class CountofExpr;
    9090class UntypedOffsetofExpr;
    9191class OffsetofExpr;
  • TabularUnified src/AST/Pass.hpp

    r0f070a4 rde8a0a4  
    173173        const ast::Expr *             visit( const ast::ConstantExpr         * ) override final;
    174174        const ast::Expr *             visit( const ast::SizeofExpr           * ) override final;
    175         const ast::Expr *             visit( const ast::CountExpr            * ) override final;
    176175        const ast::Expr *             visit( const ast::AlignofExpr          * ) override final;
     176        const ast::Expr *             visit( const ast::CountofExpr          * ) override final;
    177177        const ast::Expr *             visit( const ast::UntypedOffsetofExpr  * ) override final;
    178178        const ast::Expr *             visit( const ast::OffsetofExpr         * ) override final;
  • TabularUnified src/AST/Pass.impl.hpp

    r0f070a4 rde8a0a4  
    13501350
    13511351//--------------------------------------------------------------------------
    1352 // CountExpr
    1353 template< typename core_t >
    1354 const ast::Expr * ast::Pass< core_t >::visit( const ast::CountExpr * node ) {
    1355         VISIT_START( node );
    1356         if ( __visit_children() ) {
    1357                 {
    1358                         guard_symtab guard { *this };
    1359                         maybe_accept( node, &CountExpr::result );
    1360                 }
    1361                 if ( node->type ) {
    1362                         maybe_accept( node, &CountExpr::type );
    1363                 } else {
    1364                         maybe_accept( node, &CountExpr::expr );
    1365                 }
    1366         }
    1367         VISIT_END( Expr, node );
    1368 }
    1369 
    1370 //--------------------------------------------------------------------------
    13711352// AlignofExpr
    13721353template< typename core_t >
     
    13801361                }
    13811362                maybe_accept( node, &AlignofExpr::type );
     1363        }
     1364
     1365        VISIT_END( Expr, node );
     1366}
     1367
     1368//--------------------------------------------------------------------------
     1369// CountofExpr
     1370template< typename core_t >
     1371const ast::Expr * ast::Pass< core_t >::visit( const ast::CountofExpr * node ) {
     1372        VISIT_START( node );
     1373
     1374        if ( __visit_children() ) {
     1375                {
     1376                        guard_symtab guard { *this };
     1377                        maybe_accept( node, &CountofExpr::result );
     1378                }
     1379                maybe_accept( node, &CountofExpr::type );
    13821380        }
    13831381
  • TabularUnified src/AST/Print.cpp

    r0f070a4 rde8a0a4  
    12071207        }
    12081208
    1209         virtual const ast::Expr * visit( const ast::CountExpr * node ) override final {
     1209        virtual const ast::Expr * visit( const ast::CountofExpr * node ) override final {
    12101210                os << "Count Expression on: ";
    12111211                ++indent;
    1212                 if ( node->type ) node->type->accept( *this );
    1213                 else safe_print( node->expr );
     1212                safe_print( node->type );
    12141213                --indent;
    12151214                postprint( node );
  • TabularUnified src/AST/Visitor.hpp

    r0f070a4 rde8a0a4  
    7676    virtual const ast::Expr *             visit( const ast::ConstantExpr         * ) = 0;
    7777    virtual const ast::Expr *             visit( const ast::SizeofExpr           * ) = 0;
    78     virtual const ast::Expr *             visit( const ast::CountExpr            * ) = 0;
    7978    virtual const ast::Expr *             visit( const ast::AlignofExpr          * ) = 0;
     79    virtual const ast::Expr *             visit( const ast::CountofExpr          * ) = 0;
    8080    virtual const ast::Expr *             visit( const ast::UntypedOffsetofExpr  * ) = 0;
    8181    virtual const ast::Expr *             visit( const ast::OffsetofExpr         * ) = 0;
  • TabularUnified src/BasicTypes-gen.cpp

    r0f070a4 rde8a0a4  
    9999
    100100        { Float16, "Float16", "_FH", "_Float16", "DF16_", Floating, Float32, Float16Complex, -1, 7 },
    101         { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 7 },
    102 
    103         { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 8 },
    104         { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 8 },
    105         { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 9 },
    106         { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 9 },
    107         { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 10 },
    108         { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 10 },
    109 
    110         { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 11 },
    111         { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 11 },
    112         { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 12 },
    113         { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 12 },
    114         { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 13 },
    115         { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 13 },
    116 
    117         { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 14 },
     101        { Float16Complex, "Float16Complex", "_FHC", "_Float16 _Complex", "CDF16_", Floating, Float32Complex, -1, -1, 8 },
     102
     103        { Float32, "Float32", "_F", "_Float32", "DF32_", Floating, Float, Float32Complex, -1, 9 },
     104        { Float32Complex, "Float32Complex", "_FC", "_Float32 _Complex", "CDF32_", Floating, FloatComplex, -1, -1, 10 },
     105        { Float, "Float", "F", "float", "f", Floating, Float32x, FloatComplex, -1, 11 },
     106        { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, Float32xComplex, -1, -1, 12 },
     107        { Float32x, "Float32x", "_FX", "_Float32x", "DF32x_", Floating, Float64, Float32xComplex, -1, 13 },
     108        { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 14 },
     109
     110        { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 15 },
     111        { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 16 },
     112        { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 17 },
     113        { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 18 },
     114        { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 19 },
     115        { Float64xComplex, "Float64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, LongDoubleComplex, -1, -1, 20 },
     116
     117        { Float80, "Float80", "_F80", "__float80", "Dq", Floating, LongDouble, LongDoubleComplex, -1, 21 },
    118118        // __float80 _Complex, no complex counterpart
    119119        // gcc implements long double as float80 (12 bytes)
    120         { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 15 },
    121         { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 15 },
    122 
    123         { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 16 },
     120        { LongDouble, "LongDouble", "LD", "long double", "e", Floating, uuFloat128, LongDoubleComplex, -1, 22 },
     121        { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, Float128Complex, -1, -1, 23 },
     122
     123        { uuFloat128, "uuFloat128", "__FLD", "__float128", "g", Floating, Float128, Float128Complex, -1, 24 },
    124124        // __float128 _Complex, no complex counterpart
    125         { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 17 },
    126         { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 17 },
     125        { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 25 },
     126        { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 26 },
    127127
    128128        // may not be supported
    129         { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 18 },
    130         { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 18 }
     129        { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 27 },
     130        { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 28 }
    131131}; // graph
    132132
     
    135135static Kind commonTypeMatrix[NUMBER_OF_BASIC_TYPES][NUMBER_OF_BASIC_TYPES];
    136136
    137 // Fangren explain shortest cost algorithm.
     137// Compute the minimal conversion costs using Dijkstra's algorithm
    138138void generateCosts( int row ) {
    139139        bool seen[NUMBER_OF_BASIC_TYPES] = { false /*, ... */ };
     
    176176
    177177                // traverse children
    178                 // Fangren explain "max"
     178                // any conversion should have a cost of at least 1, even if between types of equal rank
    179179                int i = graph[col].left;
    180180                if ( i == -1 ) continue;                                                // leaf
     
    191191} // generateCosts
    192192
    193 // Fangren explain this routine if you can.
     193// Note: this algorithm is not general.
     194// It relies on the specific structure of the conversion graph.
     195// When the common type is not one of the two given types, we should always have a real and a complex floating point type,
     196// in which case the common type is the next complex type ranked higher than the real type.
    194197void generateCommonType( int row, int col ) {                   // row <= col
    195198        if ( costMatrix[row][col] >= 0 ) {
  • TabularUnified src/CodeGen/CodeGenerator.cpp

    r0f070a4 rde8a0a4  
    251251
    252252        if ( decl->init ) {
    253                 output << " = ";
     253                bool isGenericInit = options.genC || decl->init->maybeConstructed;
     254                output << ( (isGenericInit) ? " = " : " @= " );
    254255                decl->init->accept( *visitor );
    255256        }
  • TabularUnified src/Common/CodeLocationTools.cpp

    r0f070a4 rde8a0a4  
    154154    macro(ConstantExpr, Expr) \
    155155    macro(SizeofExpr, Expr) \
    156     macro(CountExpr, Expr ) \
    157156    macro(AlignofExpr, Expr) \
     157    macro(CountofExpr, Expr ) \
    158158    macro(UntypedOffsetofExpr, Expr) \
    159159    macro(OffsetofExpr, Expr) \
  • TabularUnified src/Concurrency/Keywords.cpp

    r0f070a4 rde8a0a4  
    1010// Created On       : Tue Nov 16  9:53:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 14 18:02:25 2023
    13 // Update Count     : 6
     12// Last Modified On : Sun Jan 26 15:16:16 2025
     13// Update Count     : 15
    1414//
    1515
     
    6969}
    7070
    71 // Describe that it adds the generic parameters and the uses of the generic
    72 // parameters on the function and first "this" argument.
     71// Describe that it adds the generic parameters and the uses of the generic parameters on the
     72// function and first "this" argument.
    7373ast::FunctionDecl * fixupGenerics(
    7474                const ast::FunctionDecl * func, const ast::StructDecl * decl ) {
     
    117117
    118118// --------------------------------------------------------------------------
     119
     120// This type describes the general information used to transform a generator, coroutine, monitor, or
     121// thread aggregate kind.  A pass is made over the AST in ConcurrentSueKeyword::postvisit looking
     122// for each of these kinds. When found, this data structure is filled in with the information from
     123// the specific structures below, and handleStruct is called to perform the common changes that
     124// augment the aggregate kind with fields and generate appropriate companion routines.  The location
     125// of any extra fields is specified in addField.
     126
    119127struct ConcurrentSueKeyword : public ast::WithDeclsToAdd {
    120128        ConcurrentSueKeyword(
     
    171179};
    172180
    173 // Handles thread type declarations:
     181// Handles generator type declarations:
    174182//
    175 // thread Mythread {                         struct MyThread {
    176 //  int data;                                  int data;
    177 //  a_struct_t more_data;                      a_struct_t more_data;
    178 //                                =>             thread$ __thrd_d;
     183// generator MyGenerator {                   struct MyGenerator {
     184//                                =>             int __generator_state;
     185//    int data;                                  int data;
     186//    a_struct_t more_data;                      a_struct_t more_data;
    179187// };                                        };
    180 //                                           static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }
    181188//
    182 struct ThreadKeyword final : public ConcurrentSueKeyword {
    183         ThreadKeyword() : ConcurrentSueKeyword(
    184                 "thread$",
    185                 "__thrd",
    186                 "get_thread",
    187                 "thread keyword requires threads to be in scope, add #include <thread.hfa>\n",
    188                 "ThreadCancelled",
     189struct GeneratorKeyword final : public ConcurrentSueKeyword {
     190        GeneratorKeyword() : ConcurrentSueKeyword(
     191                "generator$",
     192                "__generator_state",
     193                "get_generator",
     194                "Unable to find builtin type generator$\n",
     195                "",
    189196                true,
    190                 ast::AggregateDecl::Thread )
     197                ast::AggregateDecl::Generator )
    191198        {}
    192199
    193         virtual ~ThreadKeyword() {}
     200        virtual ~GeneratorKeyword() {}
    194201};
    195202
     
    197204//
    198205// coroutine MyCoroutine {                   struct MyCoroutine {
    199 //  int data;                                  int data;
    200 //  a_struct_t more_data;                      a_struct_t more_data;
    201206//                                =>             coroutine$ __cor_d;
     207//    int data;                                  int data;
     208//    a_struct_t more_data;                      a_struct_t more_data;
    202209// };                                        };
    203210//                                           static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
     
    220227//
    221228// monitor MyMonitor {                       struct MyMonitor {
    222 //  int data;                                  int data;
    223 //  a_struct_t more_data;                      a_struct_t more_data;
    224229//                                =>             monitor$ __mon_d;
     230//    int data;                                  int data;
     231//    a_struct_t more_data;                      a_struct_t more_data;
    225232// };                                        };
    226233//                                           static inline monitor$ * get_coroutine( MyMonitor * this ) {
     
    248255};
    249256
    250 // Handles generator type declarations:
     257// Handles thread type declarations:
    251258//
    252 // generator MyGenerator {                   struct MyGenerator {
    253 //  int data;                                  int data;
    254 //  a_struct_t more_data;                      a_struct_t more_data;
    255 //                                =>             int __generator_state;
     259// thread Mythread {                         struct MyThread {
     260//                                =>             thread$ __thrd_d;
     261//    int data;                                  int data;
     262//    a_struct_t more_data;                      a_struct_t more_data;
    256263// };                                        };
     264//                                           static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }
    257265//
    258 struct GeneratorKeyword final : public ConcurrentSueKeyword {
    259         GeneratorKeyword() : ConcurrentSueKeyword(
    260                 "generator$",
    261                 "__generator_state",
    262                 "get_generator",
    263                 "Unable to find builtin type generator$\n",
    264                 "",
     266struct ThreadKeyword final : public ConcurrentSueKeyword {
     267        ThreadKeyword() : ConcurrentSueKeyword(
     268                "thread$",
     269                "__thrd",
     270                "get_thread",
     271                "thread keyword requires threads to be in scope, add #include <thread.hfa>\n",
     272                "ThreadCancelled",
    265273                true,
    266                 ast::AggregateDecl::Generator )
     274                ast::AggregateDecl::Thread )
    267275        {}
    268276
    269         virtual ~GeneratorKeyword() {}
     277        virtual ~ThreadKeyword() {}
    270278};
    271279
     
    354362
    355363        if ( !exception_name.empty() ) {
    356                 if( !typeid_decl || !vtable_decl ) {
     364                if ( !typeid_decl || !vtable_decl ) {
    357365                        SemanticError( decl, context_error );
    358366                }
     
    419427        declsToAddBefore.push_back(
    420428                Virtual::makeTypeIdInstance( location, typeid_type ) );
    421         // If the typeid_type is going to be kept, the other reference will have
    422         // been made by now, but we also get to avoid extra mutates.
     429        // If the typeid_type is going to be kept, the other reference will have been made by now, but
     430        // we also get to avoid extra mutates.
    423431        ast::ptr<ast::StructInstType> typeid_cleanup = typeid_type;
    424432}
     
    525533
    526534        auto mutDecl = ast::mutate( decl );
     535        // Insert at start of special aggregate structures => front of vector
     536        //mutDecl->members.insert( mutDecl->members.begin(), field );
    527537        mutDecl->members.push_back( field );
    528538
     
    917927
    918928                        // If it is a monitor, then it is a monitor.
    919                         if( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) {
     929                        if ( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) {
    920930                                SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " );
    921931                        }
     
    10311041
    10321042        // Make sure that only the outer reference is mutex.
    1033         if( baseStruct->is_mutex() ) {
     1043        if ( baseStruct->is_mutex() ) {
    10341044                SemanticError( decl, "mutex keyword may only appear once per argument " );
    10351045        }
     
    11791189}
    11801190
    1181 // generates a cast to the void ptr to the appropriate lock type and dereferences it before calling lock or unlock on it
    1182 // used to undo the type erasure done by storing all the lock pointers as void
     1191// Generates a cast to the void ptr to the appropriate lock type and dereferences it before calling
     1192// lock or unlock on it used to undo the type erasure done by storing all the lock pointers as void.
    11831193ast::ExprStmt * MutexKeyword::genVirtLockUnlockExpr( const std::string & fnName, ast::ptr<ast::Expr> expr, const CodeLocation & location, ast::Expr * param ) {
    11841194        return new ast::ExprStmt( location,
  • TabularUnified src/InitTweak/GenInit.cpp

    r0f070a4 rde8a0a4  
    162162                                // FROM USER:  float a[ rand() ];
    163163                                // TO GCC:     const size_t __len_of_a = rand(); float a[ __len_of_a ];
    164 
    165                                 ast::ObjectDecl * arrayDimension = new ast::ObjectDecl(
    166                                         arrayType->dimension->location,
    167                                         dimensionName.newName(),
    168                                         dimType,
    169                                         new ast::SingleInit(
     164                                ast::ObjectDecl * arrayDimension = nullptr;
     165
     166                                const ast::TypeExpr * ty = dynamic_cast< const ast::TypeExpr * >( arrayType->dimension.get() );
     167                                if ( ty ) {
     168                                        auto inst = ty->type.as<ast::EnumInstType>();
     169                                        if ( inst ) {
     170                                                if ( inst->base->isCfa ) {
     171                                                        arrayDimension = new ast::ObjectDecl(
     172                                                                arrayType->dimension->location,
     173                                                                dimensionName.newName(),
     174                                                                new ast::BasicType( ast::BasicKind::UnsignedChar ),
     175                                                                new ast::SingleInit(
     176                                                                        arrayType->dimension->location,
     177                                                                        ast::ConstantExpr::from_int( arrayType->dimension->location, inst->base->members.size() )
     178                                                                )
     179                                                        );
     180                                                        // return arrayType;
     181                                                }
     182                                        }
     183                                }
     184                                if ( arrayDimension == nullptr ) {
     185                                        arrayDimension = new ast::ObjectDecl(
    170186                                                arrayType->dimension->location,
    171                                                 arrayType->dimension
    172                                         )
    173                                 );
     187                                                dimensionName.newName(),
     188                                                dimType,
     189                                                new ast::SingleInit(
     190                                                        arrayType->dimension->location,
     191                                                        arrayType->dimension
     192                                                )
     193                                        );
     194                                }
    174195
    175196                                ast::ArrayType * mutType = ast::mutate( arrayType );
  • TabularUnified src/Parser/parser.yy

    r0f070a4 rde8a0a4  
    946946                }
    947947        | COUNTOF unary_expression
    948                 { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuild( $2 ) ) ); }
     948                { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); }
    949949        | COUNTOF '(' type_no_function ')'
    950                 { $$ = new ExpressionNode( new ast::CountExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }
     950                { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }
    951951        ;
    952952
  • TabularUnified src/ResolvExpr/CandidateFinder.cpp

    r0f070a4 rde8a0a4  
    672672                void postvisit( const ast::SizeofExpr * sizeofExpr );
    673673                void postvisit( const ast::AlignofExpr * alignofExpr );
     674                void postvisit( const ast::CountofExpr * countExpr );
    674675                void postvisit( const ast::AddressExpr * addressExpr );
    675676                void postvisit( const ast::LabelAddressExpr * labelExpr );
     
    697698                void postvisit( const ast::UntypedInitExpr * initExpr );
    698699                void postvisit( const ast::QualifiedNameExpr * qualifiedExpr );
    699                 void postvisit( const ast::CountExpr * countExpr );
    700700
    701701                void postvisit( const ast::InitExpr * ) {
     
    941941                }
    942942        }
    943        
    944943
    945944        /// Adds aggregate member interpretations
     
    12691268                                        ? conversionCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env )
    12701269                                        : castCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env );
    1271                        
     1270
    12721271                        // Redefine enum cast
    12731272                        auto argAsEnum = fromType.as<ast::EnumInstType>();
     
    14931492        }
    14941493
    1495         void Finder::postvisit( const ast::CountExpr * countExpr ) {
    1496                 const ast::UntypedExpr * untyped = nullptr;
    1497                 if ( countExpr->type ) {
    1498                         auto enumInst = countExpr->type.as<ast::EnumInstType>();
    1499                         if ( enumInst ) {
    1500                                 addCandidate( ast::ConstantExpr::from_ulong(countExpr->location, enumInst->base->members.size()), tenv );
    1501                                 return;
    1502                         }
    1503                         auto untypedFirst = ast::UntypedExpr::createCall( countExpr->location, "lowerBound", {} );
    1504                         auto castFirst = new ast::CastExpr( countExpr->location, untypedFirst , countExpr->type );
    1505                         untyped = ast::UntypedExpr::createCall(
    1506                                 countExpr->location, "Countof", { castFirst }
    1507                         );
    1508                 }
    1509                 if (!untyped) untyped = ast::UntypedExpr::createCall(
    1510                                 countExpr->location, "Countof", { countExpr->expr }
     1494        void Finder::postvisit( const ast::CountofExpr * countExpr ) {
     1495                if ( auto enumInst = countExpr->type.as<ast::EnumInstType>() ) {
     1496                        addCandidate( ast::ConstantExpr::from_ulong( countExpr->location, enumInst->base->members.size()), tenv );
     1497                        return;
     1498                }
     1499                auto untypedFirst = ast::UntypedExpr::createCall( countExpr->location, "lowerBound", {} );
     1500                auto castFirst = new ast::CastExpr( countExpr->location, untypedFirst , countExpr->type );
     1501                const ast::UntypedExpr * untyped = ast::UntypedExpr::createCall(
     1502                        countExpr->location, "Countof", { castFirst }
    15111503                );
    15121504                CandidateFinder finder( context, tenv );
     
    15141506                CandidateList winners = findMinCost( finder.candidates );
    15151507                if ( winners.size() == 0 ) {
    1516                         SemanticError( countExpr->expr, "Countof is not implemented for operand: " );
    1517                 }
    1518                 if ( winners.size() !=  1 ) {
    1519                         SemanticError( countExpr->expr, "Ambiguous expression in countof operand: " );
     1508                        SemanticError( countExpr, "Countof is not implemented: " );
     1509                }
     1510                if ( winners.size() != 1 ) {
     1511                        SemanticError( countExpr, "Ambiguous expression in countof: " );
    15201512                }
    15211513                CandidateRef & choice = winners.front();
  • TabularUnified src/ResolvExpr/ConversionCost.cpp

    r0f070a4 rde8a0a4  
    4444                  signed long long int     unsigned long long int
    4545                  __int128                 unsigned __int128
    46                   _Float16                 _Float16 _Complex
    47                   _Float32                 _Float32 _Complex
    48                   float                    float _Complex
    49                   _Float32x                _Float32x _Complex
    50                   _Float64                 _Float64 _Complex
    51                   double                   double _Complex
    52                   _Float64x                _Float64x _Complex
     46                              _Float16
     47                     _Float16 _Complex
     48                              _Float32
     49                     _Float32 _Complex
     50                                 float
     51                        float _Complex
     52                             _Float32x
     53                    _Float32x _Complex
     54                              _Float64
     55                     _Float64 _Complex
     56                                double
     57                       double _Complex
     58                             _Float64x
     59                    _Float64x _Complex
    5360                             __float80
    54                   long double              long double _Complex
     61                           long double
     62                  long double _Complex
    5563                            __float128
    56                   _Float128                _Float128 _Complex
    57                   _Float128x               _Float128x _Complex
     64                             _Float128
     65                    _Float128 _Complex
     66                            _Float128x
     67                   _Float128x _Complex
    5868        */
    5969        // GENERATED END
     
    6373        static const int costMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
    6474                /*               B    C   SC   UC   SI  USI    I   UI   LI  ULI  LLI ULLI __ID__UID  _FH _FHC   _F  _FC    F   FC  _FX _FXC  _FD _FDC    D   DC _FDX_FDXC _F80   LD  LDC__FLD _FLD_FLDC_FLDX_FLDXC */
    65                 /*      B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  17,  18,  18, },
    66                 /*      C */ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  16,  17,  17, },
    67                 /*     SC */ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  16,  17,  17, },
    68                 /*     UC */ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  16,  17,  17, },
    69                 /*     SI */ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  15,  16,  16, },
    70                 /*    USI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  15,  16,  16, },
    71                 /*      I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  14,  15,  15, },
    72                 /*     UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  14,  15,  15, },
    73                 /*     LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  13,  14,  14, },
    74                 /*    ULI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  13,  14,  14, },
    75                 /*    LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  12,  13,  13, },
    76                 /*   ULLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  12,  13,  13, },
    77                 /*   __ID */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  11,  12,  12, },
    78                 /*  __UID */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  11,  12,  12, },
    79                 /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,  10,  11,  11, },
    80                 /*   _FHC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   8,  -1,  -1,  10,  -1,  11, },
    81                 /*     _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   9,  10,  10, },
    82                 /*    _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   7,  -1,  -1,   9,  -1,  10, },
    83                 /*      F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   8,   9,   9, },
    84                 /*     FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   6,  -1,  -1,   8,  -1,   9, },
    85                 /*    _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8, },
    86                 /*   _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   5,  -1,  -1,   7,  -1,   8, },
    87                 /*    _FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7, },
    88                 /*   _FDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,  -1,   4,  -1,  -1,   6,  -1,   7, },
    89                 /*      D */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6, },
    90                 /*     DC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,  -1,   3,  -1,  -1,   5,  -1,   6, },
    91                 /*   _FDX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5, },
    92                 /*  _FDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   2,  -1,  -1,   4,  -1,   5, },
    93                 /*   _F80 */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4, },
    94                 /*     LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3, },
    95                 /*    LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   2,  -1,   3, },
    96                 /*  __FLD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2, },
    97                 /*   _FLD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2, },
    98                 /*  _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1, },
     75                /*      B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,  28, },
     76                /*      C */ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27, },
     77                /*     SC */ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27, },
     78                /*     UC */ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27, },
     79                /*     SI */ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26, },
     80                /*    USI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26, },
     81                /*      I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25, },
     82                /*     UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25, },
     83                /*     LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24, },
     84                /*    ULI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24, },
     85                /*    LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23, },
     86                /*   ULLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23, },
     87                /*   __ID */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22, },
     88                /*  __UID */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22, },
     89                /*    _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21, },
     90                /*   _FHC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,   4,  -1,   6,  -1,   8,  -1,  10,  -1,  12,  -1,  -1,  15,  -1,  -1,  18,  -1,  20, },
     91                /*     _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19, },
     92                /*    _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,   4,  -1,   6,  -1,   8,  -1,  10,  -1,  -1,  13,  -1,  -1,  16,  -1,  18, },
     93                /*      F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17, },
     94                /*     FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,   4,  -1,   6,  -1,   8,  -1,  -1,  11,  -1,  -1,  14,  -1,  16, },
     95                /*    _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, },
     96                /*   _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,   4,  -1,   6,  -1,  -1,   9,  -1,  -1,  12,  -1,  14, },
     97                /*    _FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13, },
     98                /*   _FDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,   4,  -1,  -1,   7,  -1,  -1,  10,  -1,  12, },
     99                /*      D */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11, },
     100                /*     DC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2,  -1,  -1,   5,  -1,  -1,   8,  -1,  10, },
     101                /*   _FDX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9, },
     102                /*  _FDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   3,  -1,  -1,   6,  -1,   8, },
     103                /*   _F80 */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6,   7, },
     104                /*     LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4,   5,   6, },
     105                /*    LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,   3,  -1,   5, },
     106                /*  __FLD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3,   4, },
     107                /*   _FLD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   3, },
     108                /*  _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   2, },
    99109                /*  _FLDX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1, },
    100110                /* _FLDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0, },
    101111        }; // costMatrix
    102         static const int maxIntCost = 15;
     112        static const int maxIntCost = 25;
    103113        // GENERATED END
    104114        static_assert(
  • TabularUnified tests/arithmeticConversions.cfa

    r0f070a4 rde8a0a4  
    9898        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    9999                ST(f64xc), SZ(f64xc), SZ(f64xc + c), SZ(f64xc + sc), SZ(f64xc + uc), SZ(f64xc + ssi), SZ(f64xc + usi), SZ(f64xc + si), SZ(f64xc + ui), SZ(f64xc + sli), SZ(f64xc + ulli), SZ(f64xc + ulli), SZ(f64xc + ulli) );
    100 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     100
     101        #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    101102        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    102103                ST(f80), SZ(f80), SZ(f80 + c), SZ(f80 + sc), SZ(f80 + uc), SZ(f80 + ssi), SZ(f80 + usi), SZ(f80 + si), SZ(f80 + ui), SZ(f80 + sli), SZ(f80 + ulli), SZ(f80 + ulli), SZ(f80 + ulli) );
    103 #endif
     104        #endif
     105
    104106        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    105107                ST(ld), SZ(ld), SZ(ld + c), SZ(ld + sc), SZ(ld + uc), SZ(ld + ssi), SZ(ld + usi), SZ(ld + si), SZ(ld + ui), SZ(ld + sli), SZ(ld + ulli), SZ(ld + ulli), SZ(ld + ulli) );
    106108        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    107109                ST(ldc), SZ(ldc), SZ(ldc + c), SZ(ldc + sc), SZ(ldc + uc), SZ(ldc + ssi), SZ(ldc + usi), SZ(ldc + si), SZ(ldc + ui), SZ(ldc + sli), SZ(ldc + ulli), SZ(ldc + ulli), SZ(ldc + ulli) );
    108 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     110
     111        #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    109112        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    110113                ST(uuf128), SZ(uuf128), SZ(uuf128 + c), SZ(uuf128 + sc), SZ(uuf128 + uc), SZ(uuf128 + ssi), SZ(uuf128 + usi), SZ(uuf128 + si), SZ(uuf128 + ui), SZ(uuf128 + sli), SZ(uuf128 + ulli), SZ(uuf128 + ulli), SZ(uuf128 + ulli) );
    111 #endif
     114        #endif
     115
    112116        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    113117                ST(f128), SZ(f128), SZ(f128 + c), SZ(f128 + sc), SZ(f128 + uc), SZ(f128 + ssi), SZ(f128 + usi), SZ(f128 + si), SZ(f128 + ui), SZ(f128 + sli), SZ(f128 + ulli), SZ(f128 + ulli), SZ(f128 + ulli) );
     
    146150        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    147151                ST(f64xc), SZ(f64xc), SZ(f64xc + f32), SZ(f64xc + f32c), SZ(f64xc + f), SZ(f64xc + fc), SZ(f64xc + f32x), SZ(f64xc + f32xc), SZ(f64xc + f64), SZ(f64xc + f64c), SZ(f64xc + d), SZ(f64xc + dc), SZ(f64xc + f64x), SZ(f64xc + f64xc) OPT2(, SZ(f64xc + f80)), SZ(f64xc + ld), SZ(f64xc + ldc) OPT2(, SZ(f64xc + uuf128)), SZ(f64xc + f128), SZ(f64xc + f128c) );
    148 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     152
     153        #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    149154        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n",
    150155                        ST(f80), SZ(f80), SZ(f80 + f32), SZ(f80 + f32c), SZ(f80 + f), SZ(f80 + fc), SZ(f80 + f32x), SZ(f80 + f32xc), SZ(f80 + f64), SZ(f80 + f64c), SZ(f80 + d), SZ(f80 + dc), SZ(f80 + f64x), SZ(f80 + f64xc), SZ(f80 + f80), SZ(f80 + ld), SZ(f80 + ldc), SZ(f80 + uuf128), SZ(f80 + f128), SZ(f80 + f128c) );
    151 #endif
     156        #endif
     157
    152158        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    153159                ST(ld), SZ(ld), SZ(ld + f32), SZ(ld + f32c), SZ(ld + f), SZ(ld + fc), SZ(ld + f32x), SZ(ld + f32xc), SZ(ld + f64), SZ(ld + f64c), SZ(ld + d), SZ(ld + dc), SZ(ld + f64x), SZ(ld + f64xc) OPT2(, SZ(ld + f80)), SZ(ld + ld), SZ(ld + ldc) OPT2(, SZ(ld + uuf128)), SZ(ld + f128), SZ(ld + f128c) );
    154160        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    155161                ST(ldc), SZ(ldc), SZ(ldc + f32), SZ(ldc + f32c), SZ(ldc + f), SZ(ldc + fc), SZ(ldc + f32x), SZ(ldc + f32xc), SZ(ldc + f64), SZ(ldc + f64c), SZ(ldc + d), SZ(ldc + dc), SZ(ldc + f64x), SZ(ldc + f64xc) OPT2(, SZ(ldc + f80)), SZ(ldc + ld), SZ(ldc + ldc) OPT2(, SZ(ldc + uuf128)), SZ(ldc + f128), SZ(ldc + f128c) );
    156 #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     162
     163        #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    157164        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n",
    158165                ST(uuf128), SZ(uuf128), SZ(uuf128 + f32), SZ(uuf128 + f32c), SZ(uuf128 + f), SZ(uuf128 + fc), SZ(uuf128 + f32x), SZ(uuf128 + f32xc), SZ(uuf128 + f64), SZ(uuf128 + f64c), SZ(uuf128 + d), SZ(uuf128 + dc), SZ(uuf128 + f64x), SZ(uuf128 + f64xc), SZ(uuf128 + f80), SZ(uuf128 + ld), SZ(uuf128 + ldc), SZ(uuf128 + uuf128), SZ(uuf128 + f128), SZ(uuf128 + f128c) );
    159 #endif
     166        #endif
     167
    160168        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    161169                ST(f128), SZ(f128), SZ(f128 + f32), SZ(f128 + f32c), SZ(f128 + f), SZ(f128 + fc), SZ(f128 + f32x), SZ(f128 + f32xc), SZ(f128 + f64), SZ(f128 + f64c), SZ(f128 + d), SZ(f128 + dc), SZ(f128 + f64x), SZ(f128 + f64xc) OPT2(, SZ(f128 + f80)), SZ(f128 + ld), SZ(f128 + ldc) OPT2(, SZ(f128 + uuf128)), SZ(f128 + f128), SZ(f128 + f128c) );
  • TabularUnified tests/array-collections/boxed.bookend.cfa

    r0f070a4 rde8a0a4  
    2727static char * bookend_hi = 0p;
    2828
     29// bookend pointers are set to stack addresses and compared (but not dereferenced)
     30// after their functions exit; they are "dangling"
     31#pragma GCC diagnostic push
     32#pragma GCC diagnostic ignored "-Wpragmas" // -Wdangling-pointer unrecognized until GCC 12
     33#pragma GCC diagnostic ignored "-Wdangling-pointer"
     34
    2935void bookendInner( void ) {
    3036    char var = 'x';
     
    3541#define TC(...)
    3642#define TR( TRID, SZS, SZV, ETG, ACCS, SPS, OVLD ) \
    37     F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) {                                  \
     43    F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) {                         \
    3844        char var = 'x';                                                              \
    3945        (void) var;                                                                  \
    4046        bookend_hi = & var;                                                          \
    41         return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart );     \
     47        return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart );      \
    4248    }
    4349#include "boxed.cases.hfa"
    4450#undef TC
    4551#undef TR
     52
     53#pragma GCC diagnostic pop
    4654
    4755void resetBookends( void ) {
  • TabularUnified tests/malloc.cfa

    r0f070a4 rde8a0a4  
    6464        free( ip );
    6565
     66  #pragma GCC diagnostic push
     67  #pragma GCC diagnostic ignored "-Wpragmas" // -Walloc-size unrecognized until GCC 14
     68  #pragma GCC diagnostic ignored "-Walloc-size"
    6669        ip = (int *)malloc( 0 );
     70  #pragma GCC diagnostic pop
    6771        test_base( ip, 0, libAlign );
    6872        test_use( ip );
Note: See TracChangeset for help on using the changeset viewer.