Changes in / [de8a0a4b:0f070a4]


Ignore:
Files:
13 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    rde8a0a4b r0f070a4  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 22 07:31:19 2025
    13 // Update Count     : 2079
     12// Last Modified On : Sun Oct 13 10:53:09 2024
     13// Update Count     : 2041
    1414//
    1515
     
    777777forall( istype & | basic_istream( istype ) ) {
    778778        istype & ?|?( istype & is, bool & b ) {
     779                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    779780                int len = -1;                                                                   // len not set if no match
    780                 fmt( is, " " );                                                                 // remove leading whitespace
    781                 fmt( is, FALSE "%n", &len );                                    // try false, returns 0
     781                // remove optional leading whitespace at start of strings.
     782                fmt( is, " " FALSE "%n", &len );                                // try false
    782783                if ( len != sizeof( FALSE ) - 1 ) {                             // -1 removes null terminate
    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
     784                        fmt( is, " " TRUE "%n", &len );                         // try true
    786785                        if ( len != sizeof( TRUE ) - 1 ) throwResume ExceptionInst( missing_data );
    787786                        b = true;
     
    793792
    794793        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 );                      // can be called with EOF on
     797                        int args = fmt( is, "%c", &temp );
    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 );
    807808                int args = fmt( is, "%hhi", &sc );                              // can be multiple characters (100)
    808809                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 );
    814815                int args = fmt( is, "%hhi", &usc );                             // can be multiple characters (-100)
    815816                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                 int args = fmt( is, "%hi", &si );                               // can be called with EOF on
     821                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     822                int args = fmt( is, "%hi", &si );
    822823                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                 int args = fmt( is, "%hi", &usi );                              // can be called with EOF on
     828                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     829                int args = fmt( is, "%hi", &usi );
    829830                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                 int args = fmt( is, "%i", &i );                                 // can be called with EOF on
     835                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     836                int args = fmt( is, "%i", &i );
    836837                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                 int args = fmt( is, "%i", &ui );                                // can be called with EOF on
     842                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     843                int args = fmt( is, "%i", &ui );
    843844                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                 int args = fmt( is, "%li", &li );                               // can be called with EOF on
     849                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     850                int args = fmt( is, "%li", &li );
    850851                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                 int args = fmt( is, "%li", &ulli );                             // can be called with EOF on
     856                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     857                int args = fmt( is, "%li", &ulli );
    857858                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                 int args = fmt( is, "%lli", &lli );                             // can be called with EOF on
     863                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     864                int args = fmt( is, "%lli", &lli );
    864865                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                 int args = fmt( is, "%lli", &ulli );                    // can be called with EOF on
     870                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     871                int args = fmt( is, "%lli", &ulli );
    871872                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                 int args = fmt( is, "%f", &f );                                 // can be called with EOF on
     899                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     900                int args = fmt( is, "%f", &f );
    900901                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                 int args = fmt( is, "%lf", &d );                                // can be called with EOF on
     906                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     907                int args = fmt( is, "%lf", &d );
    907908                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                 int args = fmt( is, "%Lf", &ld );                               // can be called with EOF on
     913                if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     914                int args = fmt( is, "%Lf", &ld );
    914915                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 );
    920921                float re, im;
    921                 int args = fmt( is, "%f%fi", &re, &im );                // can be called with EOF on
     922                int args = fmt( is, "%f%fi", &re, &im );
    922923                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 );
    929930                double re, im;
    930                 int args = fmt( is, "%lf%lfi", &re, &im );              // can be called with EOF on
     931                int args = fmt( is, "%lf%lfi", &re, &im );
    931932                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 );
    938939                long double re, im;
    939                 int args = fmt( is, "%Lf%Lfi", &re, &im );              // can be called with EOF on
     940                int args = fmt( is, "%Lf%Lfi", &re, &im );
    940941                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 );
    947948                size_t len = strlen( fmt );
    948949                char fmtstr[len + 16];
     
    950951                strcpy( &fmtstr[len], "%n" );
    951952                len = -1;
    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 );
     953                // scanf cursor does not move if no match
     954                fmt( is, fmtstr, &len );
     955                if ( len == -1 ) throwResume ExceptionInst( missing_data );
    956956                return is;
    957957        } // ?|?
     
    999999                        char ch;
    10001000                        for ( f.wd ) {                                                          // skip N characters
    1001                                 int args = fmt( is, "%c", &ch );                // can be called with EOF on
     1001                                int args = fmt( is, "%c", &ch );
    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 //      if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
     1206//      fprintf( stderr, "here0\n" );
     1207        if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    12071208
    12081209        // Match longest input enumerator string to enumerator labels, where enumerator names are unique.
    12091210
    12101211        int N = countof( E ), lnths[N], fred = 0;
     1212//      printf( "N %d\n", N );
    12111213        int r = 0;
     1214        // for ( s; E : r; 0~@ ) {
    12121215        for ( s; E ) {                                                                          // scan string rows gathering lengths
    12131216                lnths[r] = strlen( label( s ) );
    12141217                if ( lnths[r] > fred ) fred = lnths[r];
     1218//              fprintf( stderr, "%s %d %d\n", label( s ), lnths[r], fred );
    12151219                r += 1;
    12161220        } // for
     
    12191223        char ch, curr = '\0', prev = '\0';
    12201224
    1221         fmt( is, " " );                                                                         // remove leading whitespace
     1225        fmt( is, " " );                                                                         // skip optional whitespace
    12221226        if ( eof( is ) ) throwResume ExceptionInst( end_of_file );
    12231227
    12241228        for ( c; fred ) {                                                                       // scan columns of the label matix (some columns missing)
    12251229                int args = fmt( is, "%c", &ch );                                // read character
     1230//              fprintf( stderr, "fmt args: %d eof: %d\n", args, eof(is) );
    12261231          if ( eof( is ) ) {
     1232//                      fprintf( stderr, "Eof1\n" );
    12271233                        if ( c == 0 ) return is;                                        // no characters read ?
    12281234                        clear( is );                                                            // => read something => reset EOF => detect again on next read
     1235//                      fprintf( stderr, "Eof2\n" );
    12291236                        break;
    12301237                } // if
    12311238          if ( args != 1 ) throwResume ExceptionInst( missing_data ); // may be unnecessary since reading single character
    12321239
     1240//              printf( "read '%c'\n", ch );
    12331241                for ( r; N ) {                                                                  // scan enumeration strings for matching character in current column
     1242//                      printf( "%d %d %d\n", c, r, lnths[r] );
    12341243                        if ( c < lnths[r] ) {                                           // string long enough for this column check ?
    12351244                                char match = label( fromInt( r ) )[c];  // optimization
     1245//                              printf( "%c '%c'\n", match, ch );
    12361246                                // Stop on first match, could be other matches.
    12371247                                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] );
    12381249                                        mcol = c;                                                       // matching column
    12391250                                        prev = curr;                                            // last matching character
     
    12431254                        } // if
    12441255                } else {
     1256//                      fprintf( stderr, "finished mcol: %d ch: '%c' curr: '%c' prev: '%c'\n", mcol, ch, curr, prev );
    12451257                        ungetc( ch, is );                                                       // push back last unmatching character
    12461258                        if ( mcol == -1 ) throwResume ExceptionInst( missing_data ); // no matching character in first column
    12471259                        break;
    12481260                } // for
     1261//              printf( "\n" );
     1262//      } else {
     1263//              fprintf( stderr, "finished2 %d\n", mcol );
    12491264        } // for
    12501265
     
    12521267                if ( mcol == lnths[c] - 1 ) {
    12531268                        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 );
    12541270                        if ( (match == curr) && (mcol == 0 || prev == label( fromInt( c ) )[mcol - 1]) ) {
    12551271                                e = fromInt( c );
     
    12581274                } // if
    12591275        } else {
     1276//              fprintf( stderr, "finished3 %d\n", mcol );
    12601277                throwResume ExceptionInst( missing_data );              // no match in this column
    12611278        } // for
  • src/AST/Expr.cpp

    rde8a0a4b r0f070a4  
    283283: Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {}
    284284
     285// --- CountExpr
     286
     287CountExpr::CountExpr( const CodeLocation & loc, const Expr * e )
     288: Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(e), type( nullptr ) {}
     289
     290CountExpr::CountExpr( const CodeLocation & loc, const Type * t )
     291: Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), expr(nullptr), type( t ) {}
     292
    285293// --- AlignofExpr
    286294
    287295AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * t )
    288296: Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {}
    289 
    290 // --- CountofExpr
    291 
    292 CountofExpr::CountofExpr( const CodeLocation & loc, const Type * t )
    293 : Expr( loc, new BasicType( BasicKind::LongUnsignedInt) ), type( t ) {}
    294297
    295298// --- OffsetofExpr
  • src/AST/Expr.hpp

    rde8a0a4b r0f070a4  
    490490};
    491491
     492class CountExpr final : public Expr {
     493public:
     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 ); }
     501private:
     502        CountExpr * clone() const override { return new CountExpr( *this ); }
     503        MUTATE_FRIEND
     504};
     505
    492506/// alignof expression, e.g. `alignof(int)`, `alignof 3+4`
    493507class AlignofExpr final : public Expr {
     
    500514private:
    501515        AlignofExpr * clone() const override { return new AlignofExpr{ *this }; }
    502         MUTATE_FRIEND
    503 };
    504 
    505 /// countof expression, e.g. `countof(AnEnum)`, `countof pred(Head)`
    506 class CountofExpr final : public Expr {
    507 public:
    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 ); }
    513 private:
    514         CountofExpr * clone() const override { return new CountofExpr( *this ); }
    515516        MUTATE_FRIEND
    516517};
  • src/AST/Fwd.hpp

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

    rde8a0a4b r0f070a4  
    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;
    175176        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;
  • src/AST/Pass.impl.hpp

    rde8a0a4b r0f070a4  
    13501350
    13511351//--------------------------------------------------------------------------
     1352// CountExpr
     1353template< typename core_t >
     1354const 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//--------------------------------------------------------------------------
    13521371// AlignofExpr
    13531372template< typename core_t >
     
    13611380                }
    13621381                maybe_accept( node, &AlignofExpr::type );
    1363         }
    1364 
    1365         VISIT_END( Expr, node );
    1366 }
    1367 
    1368 //--------------------------------------------------------------------------
    1369 // CountofExpr
    1370 template< typename core_t >
    1371 const 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 );
    13801382        }
    13811383
  • src/AST/Print.cpp

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

    rde8a0a4b r0f070a4  
    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;
    7879    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;
  • src/BasicTypes-gen.cpp

    rde8a0a4b r0f070a4  
    9999
    100100        { Float16, "Float16", "_FH", "_Float16", "DF16_", Floating, Float32, Float16Complex, -1, 7 },
    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 },
     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 },
    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, 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 },
     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 },
    124124        // __float128 _Complex, no complex counterpart
    125         { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 25 },
    126         { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 26 },
     125        { Float128, "Float128", "_FLD", "_Float128", "DF128_", Floating, Float128x, Float128Complex, -1, 17 },
     126        { Float128Complex, "Float128Complex", "_FLDC", "_Float128 _Complex", "CDF128_", Floating, Float128xComplex, -1, -1, 17 },
    127127
    128128        // may not be supported
    129         { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 27 },
    130         { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 28 }
     129        { Float128x, "Float128x", "_FLDX", "_Float128x", "DF128x_", Floating, Float128xComplex, -1, -1, 18 },
     130        { Float128xComplex, "Float128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 18 }
    131131}; // graph
    132132
     
    135135static Kind commonTypeMatrix[NUMBER_OF_BASIC_TYPES][NUMBER_OF_BASIC_TYPES];
    136136
    137 // Compute the minimal conversion costs using Dijkstra's algorithm
     137// Fangren explain shortest cost algorithm.
    138138void generateCosts( int row ) {
    139139        bool seen[NUMBER_OF_BASIC_TYPES] = { false /*, ... */ };
     
    176176
    177177                // traverse children
    178                 // any conversion should have a cost of at least 1, even if between types of equal rank
     178                // Fangren explain "max"
    179179                int i = graph[col].left;
    180180                if ( i == -1 ) continue;                                                // leaf
     
    191191} // generateCosts
    192192
    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.
     193// Fangren explain this routine if you can.
    197194void generateCommonType( int row, int col ) {                   // row <= col
    198195        if ( costMatrix[row][col] >= 0 ) {
  • src/CodeGen/CodeGenerator.cpp

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

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

    rde8a0a4b r0f070a4  
    1010// Created On       : Tue Nov 16  9:53:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jan 26 15:16:16 2025
    13 // Update Count     : 15
     12// Last Modified On : Thu Dec 14 18:02:25 2023
     13// Update Count     : 6
    1414//
    1515
     
    6969}
    7070
    71 // Describe that it adds the generic parameters and the uses of the generic parameters on the
    72 // function and first "this" argument.
     71// Describe that it adds the generic parameters and the uses of the generic
     72// parameters on the 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 
    127119struct ConcurrentSueKeyword : public ast::WithDeclsToAdd {
    128120        ConcurrentSueKeyword(
     
    179171};
    180172
    181 // Handles generator type declarations:
     173// Handles thread type declarations:
    182174//
    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;
     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;
    187179// };                                        };
     180//                                           static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }
    188181//
    189 struct GeneratorKeyword final : public ConcurrentSueKeyword {
    190         GeneratorKeyword() : ConcurrentSueKeyword(
    191                 "generator$",
    192                 "__generator_state",
    193                 "get_generator",
    194                 "Unable to find builtin type generator$\n",
    195                 "",
     182struct 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",
    196189                true,
    197                 ast::AggregateDecl::Generator )
     190                ast::AggregateDecl::Thread )
    198191        {}
    199192
    200         virtual ~GeneratorKeyword() {}
     193        virtual ~ThreadKeyword() {}
    201194};
    202195
     
    204197//
    205198// coroutine MyCoroutine {                   struct MyCoroutine {
     199//  int data;                                  int data;
     200//  a_struct_t more_data;                      a_struct_t more_data;
    206201//                                =>             coroutine$ __cor_d;
    207 //    int data;                                  int data;
    208 //    a_struct_t more_data;                      a_struct_t more_data;
    209202// };                                        };
    210203//                                           static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; }
     
    227220//
    228221// monitor MyMonitor {                       struct MyMonitor {
     222//  int data;                                  int data;
     223//  a_struct_t more_data;                      a_struct_t more_data;
    229224//                                =>             monitor$ __mon_d;
    230 //    int data;                                  int data;
    231 //    a_struct_t more_data;                      a_struct_t more_data;
    232225// };                                        };
    233226//                                           static inline monitor$ * get_coroutine( MyMonitor * this ) {
     
    255248};
    256249
    257 // Handles thread type declarations:
     250// Handles generator type declarations:
    258251//
    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;
     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;
    263256// };                                        };
    264 //                                           static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }
    265257//
    266 struct 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",
     258struct GeneratorKeyword final : public ConcurrentSueKeyword {
     259        GeneratorKeyword() : ConcurrentSueKeyword(
     260                "generator$",
     261                "__generator_state",
     262                "get_generator",
     263                "Unable to find builtin type generator$\n",
     264                "",
    273265                true,
    274                 ast::AggregateDecl::Thread )
     266                ast::AggregateDecl::Generator )
    275267        {}
    276268
    277         virtual ~ThreadKeyword() {}
     269        virtual ~GeneratorKeyword() {}
    278270};
    279271
     
    362354
    363355        if ( !exception_name.empty() ) {
    364                 if ( !typeid_decl || !vtable_decl ) {
     356                if( !typeid_decl || !vtable_decl ) {
    365357                        SemanticError( decl, context_error );
    366358                }
     
    427419        declsToAddBefore.push_back(
    428420                Virtual::makeTypeIdInstance( location, typeid_type ) );
    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.
     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.
    431423        ast::ptr<ast::StructInstType> typeid_cleanup = typeid_type;
    432424}
     
    533525
    534526        auto mutDecl = ast::mutate( decl );
    535         // Insert at start of special aggregate structures => front of vector
    536         //mutDecl->members.insert( mutDecl->members.begin(), field );
    537527        mutDecl->members.push_back( field );
    538528
     
    927917
    928918                        // If it is a monitor, then it is a monitor.
    929                         if ( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) {
     919                        if( baseStruct->base->is_monitor() || baseStruct->base->is_thread() ) {
    930920                                SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " );
    931921                        }
     
    10411031
    10421032        // Make sure that only the outer reference is mutex.
    1043         if ( baseStruct->is_mutex() ) {
     1033        if( baseStruct->is_mutex() ) {
    10441034                SemanticError( decl, "mutex keyword may only appear once per argument " );
    10451035        }
     
    11891179}
    11901180
    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.
     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
    11931183ast::ExprStmt * MutexKeyword::genVirtLockUnlockExpr( const std::string & fnName, ast::ptr<ast::Expr> expr, const CodeLocation & location, ast::Expr * param ) {
    11941184        return new ast::ExprStmt( location,
  • src/InitTweak/GenInit.cpp

    rde8a0a4b r0f070a4  
    162162                                // FROM USER:  float a[ rand() ];
    163163                                // TO GCC:     const size_t __len_of_a = rand(); float a[ __len_of_a ];
    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(
     164
     165                                ast::ObjectDecl * arrayDimension = new ast::ObjectDecl(
     166                                        arrayType->dimension->location,
     167                                        dimensionName.newName(),
     168                                        dimType,
     169                                        new ast::SingleInit(
    186170                                                arrayType->dimension->location,
    187                                                 dimensionName.newName(),
    188                                                 dimType,
    189                                                 new ast::SingleInit(
    190                                                         arrayType->dimension->location,
    191                                                         arrayType->dimension
    192                                                 )
    193                                         );
    194                                 }
     171                                                arrayType->dimension
     172                                        )
     173                                );
    195174
    196175                                ast::ArrayType * mutType = ast::mutate( arrayType );
  • src/Parser/parser.yy

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

    rde8a0a4b r0f070a4  
    672672                void postvisit( const ast::SizeofExpr * sizeofExpr );
    673673                void postvisit( const ast::AlignofExpr * alignofExpr );
    674                 void postvisit( const ast::CountofExpr * countExpr );
    675674                void postvisit( const ast::AddressExpr * addressExpr );
    676675                void postvisit( const ast::LabelAddressExpr * labelExpr );
     
    698697                void postvisit( const ast::UntypedInitExpr * initExpr );
    699698                void postvisit( const ast::QualifiedNameExpr * qualifiedExpr );
     699                void postvisit( const ast::CountExpr * countExpr );
    700700
    701701                void postvisit( const ast::InitExpr * ) {
     
    941941                }
    942942        }
     943       
    943944
    944945        /// Adds aggregate member interpretations
     
    12681269                                        ? conversionCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env )
    12691270                                        : castCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env );
    1270 
     1271                       
    12711272                        // Redefine enum cast
    12721273                        auto argAsEnum = fromType.as<ast::EnumInstType>();
     
    14921493        }
    14931494
    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 }
     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 }
    15031511                );
    15041512                CandidateFinder finder( context, tenv );
     
    15061514                CandidateList winners = findMinCost( finder.candidates );
    15071515                if ( winners.size() == 0 ) {
    1508                         SemanticError( countExpr, "Countof is not implemented: " );
    1509                 }
    1510                 if ( winners.size() != 1 ) {
    1511                         SemanticError( countExpr, "Ambiguous expression in countof: " );
     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: " );
    15121520                }
    15131521                CandidateRef & choice = winners.front();
  • src/ResolvExpr/ConversionCost.cpp

    rde8a0a4b r0f070a4  
    4444                  signed long long int     unsigned long long int
    4545                  __int128                 unsigned __int128
    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
     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
    6053                             __float80
    61                            long double
    62                   long double _Complex
     54                  long double              long double _Complex
    6355                            __float128
    64                              _Float128
    65                     _Float128 _Complex
    66                             _Float128x
    67                    _Float128x _Complex
     56                  _Float128                _Float128 _Complex
     57                  _Float128x               _Float128x _Complex
    6858        */
    6959        // GENERATED END
     
    7363        static const int costMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
    7464                /*               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 */
    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, },
     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, },
    10999                /*  _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, },
    110100                /* _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, },
    111101        }; // costMatrix
    112         static const int maxIntCost = 25;
     102        static const int maxIntCost = 15;
    113103        // GENERATED END
    114104        static_assert(
  • tests/arithmeticConversions.cfa

    rde8a0a4b r0f070a4  
    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 
    101         #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     100#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    102101        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    103102                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) );
    104         #endif
    105 
     103#endif
    106104        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    107105                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) );
    108106        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    109107                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) );
    110 
    111         #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     108#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    112109        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    113110                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) );
    114         #endif
    115 
     111#endif
    116112        printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n",
    117113                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) );
     
    150146        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    151147                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) );
    152 
    153         #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     148#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    154149        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n",
    155150                        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) );
    156         #endif
    157 
     151#endif
    158152        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    159153                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) );
    160154        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    161155                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) );
    162 
    163         #if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
     156#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
    164157        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n",
    165158                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) );
    166         #endif
    167 
     159#endif
    168160        printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n",
    169161                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) );
  • tests/array-collections/boxed.bookend.cfa

    rde8a0a4b r0f070a4  
    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 
    3529void bookendInner( void ) {
    3630    char var = 'x';
     
    4135#define TC(...)
    4236#define TR( TRID, SZS, SZV, ETG, ACCS, SPS, OVLD ) \
    43     F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) {                         \
     37    F_SIG( bookendOuter, TRID, SZS, SZV, ACCS, SPS, OVLD ) {                                  \
    4438        char var = 'x';                                                              \
    4539        (void) var;                                                                  \
    4640        bookend_hi = & var;                                                          \
    47         return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart );      \
     41        return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart );     \
    4842    }
    4943#include "boxed.cases.hfa"
    5044#undef TC
    5145#undef TR
    52 
    53 #pragma GCC diagnostic pop
    5446
    5547void resetBookends( void ) {
  • tests/malloc.cfa

    rde8a0a4b r0f070a4  
    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"
    6966        ip = (int *)malloc( 0 );
    70   #pragma GCC diagnostic pop
    7167        test_base( ip, 0, libAlign );
    7268        test_use( ip );
Note: See TracChangeset for help on using the changeset viewer.