Changeset de8a0a4
- Timestamp:
- Jan 26, 2025, 6:37:05 PM (2 months ago)
- 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. - Files:
-
- 13 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/iostream.cfa ¶
r0f070a4 rde8a0a4 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 13 10:53:09 202413 // Update Count : 20 4112 // Last Modified On : Wed Jan 22 07:31:19 2025 13 // Update Count : 2079 14 14 // 15 15 … … 777 777 forall( istype & | basic_istream( istype ) ) { 778 778 istype & ?|?( istype & is, bool & b ) { 779 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );780 779 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 false780 fmt( is, " " ); // remove leading whitespace 781 fmt( is, FALSE "%n", &len ); // try false, returns 0 783 782 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 785 786 if ( len != sizeof( TRUE ) - 1 ) throwResume ExceptionInst( missing_data ); 786 787 b = true; … … 792 793 793 794 istype & ?|?( istype & is, char & c ) { 794 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );795 795 char temp; 796 796 for () { 797 int args = fmt( is, "%c", &temp ); 797 int args = fmt( is, "%c", &temp ); // can be called with EOF on 798 798 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 799 799 assert( args == 1 ); // if not EOF => a single character must be read … … 805 805 806 806 istype & ?|?( istype & is, signed char & sc ) { 807 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );808 807 int args = fmt( is, "%hhi", &sc ); // can be multiple characters (100) 809 808 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 809 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 810 810 return is; 811 811 } // ?|? 812 812 813 813 istype & ?|?( istype & is, unsigned char & usc ) { 814 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );815 814 int args = fmt( is, "%hhi", &usc ); // can be multiple characters (-100) 816 815 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 816 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 817 817 return is; 818 818 } // ?|? 819 819 820 820 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 823 822 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 823 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 824 824 return is; 825 825 } // ?|? 826 826 827 827 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 830 829 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 830 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 831 831 return is; 832 832 } // ?|? 833 833 834 834 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 837 836 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 837 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 838 838 return is; 839 839 } // ?|? 840 840 841 841 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 844 843 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 844 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 845 845 return is; 846 846 } // ?|? 847 847 848 848 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 851 850 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 851 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 852 852 return is; 853 853 } // ?|? 854 854 855 855 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 858 857 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 858 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 859 859 return is; 860 860 } // ?|? 861 861 862 862 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 865 864 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 865 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 866 866 return is; 867 867 } // ?|? 868 868 869 869 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 872 871 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 872 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 873 873 return is; 874 874 } // ?|? … … 897 897 898 898 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 901 900 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 901 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 902 902 return is; 903 903 } // ?|? 904 904 905 905 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 908 907 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 908 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 909 909 return is; 910 910 } // ?|? 911 911 912 912 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 915 914 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 915 if ( eof( is ) && args != 1 ) throwResume ExceptionInst( end_of_file ); 916 916 return is; 917 917 } // ?|? 918 918 919 919 istype & ?|?( istype & is, float _Complex & fc ) { 920 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );921 920 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 923 922 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 923 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file ); 924 924 fc = re + im * _Complex_I; 925 925 return is; … … 927 927 928 928 istype & ?|?( istype & is, double _Complex & dc ) { 929 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );930 929 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 932 931 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 932 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file ); 933 933 dc = re + im * _Complex_I; 934 934 return is; … … 936 936 937 937 istype & ?|?( istype & is, long double _Complex & ldc ) { 938 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );939 938 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 941 940 if ( ! eof( is ) && args != 2 ) throwResume ExceptionInst( missing_data ); 941 if ( eof( is ) && args != 2 ) throwResume ExceptionInst( end_of_file ); 942 942 ldc = re + im * _Complex_I; 943 943 return is; … … 945 945 946 946 istype & ?|?( istype & is, const char fmt[] ) { // match text 947 if ( eof( is ) ) throwResume ExceptionInst( end_of_file );948 947 size_t len = strlen( fmt ); 949 948 char fmtstr[len + 16]; … … 951 950 strcpy( &fmtstr[len], "%n" ); 952 951 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 ); 956 956 return is; 957 957 } // ?|? … … 999 999 char ch; 1000 1000 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 1002 1002 if ( ! eof( is ) && args != 1 ) throwResume ExceptionInst( missing_data ); 1003 1003 } // for … … 1204 1204 forall( istype & | istream( istype ), E | CfaEnum( E ) | Serial( E ) ) 1205 1205 istype & ?|?( 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 ); 1208 1207 1209 1208 // Match longest input enumerator string to enumerator labels, where enumerator names are unique. 1210 1209 1211 1210 int N = countof( E ), lnths[N], fred = 0; 1212 // printf( "N %d\n", N );1213 1211 int r = 0; 1214 // for ( s; E : r; 0~@ ) {1215 1212 for ( s; E ) { // scan string rows gathering lengths 1216 1213 lnths[r] = strlen( label( s ) ); 1217 1214 if ( lnths[r] > fred ) fred = lnths[r]; 1218 // fprintf( stderr, "%s %d %d\n", label( s ), lnths[r], fred );1219 1215 r += 1; 1220 1216 } // for … … 1223 1219 char ch, curr = '\0', prev = '\0'; 1224 1220 1225 fmt( is, " " ); // skip optionalwhitespace1221 fmt( is, " " ); // remove leading whitespace 1226 1222 if ( eof( is ) ) throwResume ExceptionInst( end_of_file ); 1227 1223 1228 1224 for ( c; fred ) { // scan columns of the label matix (some columns missing) 1229 1225 int args = fmt( is, "%c", &ch ); // read character 1230 // fprintf( stderr, "fmt args: %d eof: %d\n", args, eof(is) );1231 1226 if ( eof( is ) ) { 1232 // fprintf( stderr, "Eof1\n" );1233 1227 if ( c == 0 ) return is; // no characters read ? 1234 1228 clear( is ); // => read something => reset EOF => detect again on next read 1235 // fprintf( stderr, "Eof2\n" );1236 1229 break; 1237 1230 } // if 1238 1231 if ( args != 1 ) throwResume ExceptionInst( missing_data ); // may be unnecessary since reading single character 1239 1232 1240 // printf( "read '%c'\n", ch );1241 1233 for ( r; N ) { // scan enumeration strings for matching character in current column 1242 // printf( "%d %d %d\n", c, r, lnths[r] );1243 1234 if ( c < lnths[r] ) { // string long enough for this column check ? 1244 1235 char match = label( fromInt( r ) )[c]; // optimization 1245 // printf( "%c '%c'\n", match, ch );1246 1236 // Stop on first match, could be other matches. 1247 1237 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] );1249 1238 mcol = c; // matching column 1250 1239 prev = curr; // last matching character … … 1254 1243 } // if 1255 1244 } else { 1256 // fprintf( stderr, "finished mcol: %d ch: '%c' curr: '%c' prev: '%c'\n", mcol, ch, curr, prev );1257 1245 ungetc( ch, is ); // push back last unmatching character 1258 1246 if ( mcol == -1 ) throwResume ExceptionInst( missing_data ); // no matching character in first column 1259 1247 break; 1260 1248 } // for 1261 // printf( "\n" );1262 // } else {1263 // fprintf( stderr, "finished2 %d\n", mcol );1264 1249 } // for 1265 1250 … … 1267 1252 if ( mcol == lnths[c] - 1 ) { 1268 1253 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 );1270 1254 if ( (match == curr) && (mcol == 0 || prev == label( fromInt( c ) )[mcol - 1]) ) { 1271 1255 e = fromInt( c ); … … 1274 1258 } // if 1275 1259 } else { 1276 // fprintf( stderr, "finished3 %d\n", mcol );1277 1260 throwResume ExceptionInst( missing_data ); // no match in this column 1278 1261 } // for -
TabularUnified src/AST/Expr.cpp ¶
r0f070a4 rde8a0a4 283 283 : Expr( loc, new BasicType{ BasicKind::LongUnsignedInt } ), type( t ) {} 284 284 285 // --- CountExpr286 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 293 285 // --- AlignofExpr 294 286 295 287 AlignofExpr::AlignofExpr( const CodeLocation & loc, const Type * t ) 296 288 : 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 ) {} 297 294 298 295 // --- OffsetofExpr -
TabularUnified src/AST/Expr.hpp ¶
r0f070a4 rde8a0a4 490 490 }; 491 491 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_FRIEND504 };505 506 492 /// alignof expression, e.g. `alignof(int)`, `alignof 3+4` 507 493 class AlignofExpr final : public Expr { … … 514 500 private: 515 501 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 ); } 516 515 MUTATE_FRIEND 517 516 }; -
TabularUnified src/AST/Fwd.hpp ¶
r0f070a4 rde8a0a4 86 86 class ConstantExpr; 87 87 class SizeofExpr; 88 class CountExpr;89 88 class AlignofExpr; 89 class CountofExpr; 90 90 class UntypedOffsetofExpr; 91 91 class OffsetofExpr; -
TabularUnified src/AST/Pass.hpp ¶
r0f070a4 rde8a0a4 173 173 const ast::Expr * visit( const ast::ConstantExpr * ) override final; 174 174 const ast::Expr * visit( const ast::SizeofExpr * ) override final; 175 const ast::Expr * visit( const ast::CountExpr * ) override final;176 175 const ast::Expr * visit( const ast::AlignofExpr * ) override final; 176 const ast::Expr * visit( const ast::CountofExpr * ) override final; 177 177 const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) override final; 178 178 const ast::Expr * visit( const ast::OffsetofExpr * ) override final; -
TabularUnified src/AST/Pass.impl.hpp ¶
r0f070a4 rde8a0a4 1350 1350 1351 1351 //-------------------------------------------------------------------------- 1352 // CountExpr1353 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 //--------------------------------------------------------------------------1371 1352 // AlignofExpr 1372 1353 template< typename core_t > … … 1380 1361 } 1381 1362 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 ); 1382 1380 } 1383 1381 -
TabularUnified src/AST/Print.cpp ¶
r0f070a4 rde8a0a4 1207 1207 } 1208 1208 1209 virtual const ast::Expr * visit( const ast::Count Expr * node ) override final {1209 virtual const ast::Expr * visit( const ast::CountofExpr * node ) override final { 1210 1210 os << "Count Expression on: "; 1211 1211 ++indent; 1212 if ( node->type ) node->type->accept( *this ); 1213 else safe_print( node->expr ); 1212 safe_print( node->type ); 1214 1213 --indent; 1215 1214 postprint( node ); -
TabularUnified src/AST/Visitor.hpp ¶
r0f070a4 rde8a0a4 76 76 virtual const ast::Expr * visit( const ast::ConstantExpr * ) = 0; 77 77 virtual const ast::Expr * visit( const ast::SizeofExpr * ) = 0; 78 virtual const ast::Expr * visit( const ast::CountExpr * ) = 0;79 78 virtual const ast::Expr * visit( const ast::AlignofExpr * ) = 0; 79 virtual const ast::Expr * visit( const ast::CountofExpr * ) = 0; 80 80 virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) = 0; 81 81 virtual const ast::Expr * visit( const ast::OffsetofExpr * ) = 0; -
TabularUnified src/BasicTypes-gen.cpp ¶
r0f070a4 rde8a0a4 99 99 100 100 { 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, 1 0},108 { Float32xComplex, "Float32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, Float64Complex, -1, -1, 1 0},109 110 { Float64, "Float64", "_FD", "_Float64", "DF64_", Floating, Double, Float64Complex, -1, 1 1},111 { Float64Complex, "Float64Complex", "_FDC", "_Float64 _Complex", "CDF64_", Floating, DoubleComplex, -1, -1, 1 1},112 { Double, "Double", "D", "double", "d", Floating, Float64x, DoubleComplex, -1, 1 2},113 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, Float64xComplex, -1, -1, 1 2},114 { Float64x, "Float64x", "_FDX", "_Float64x", "DF64x_", Floating, Float80, Float64xComplex, -1, 1 3},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 }, 118 118 // __float80 _Complex, no complex counterpart 119 119 // 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 }, 124 124 // __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 }, 127 127 128 128 // 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 } 131 131 }; // graph 132 132 … … 135 135 static Kind commonTypeMatrix[NUMBER_OF_BASIC_TYPES][NUMBER_OF_BASIC_TYPES]; 136 136 137 // Fangren explain shortest cost algorithm.137 // Compute the minimal conversion costs using Dijkstra's algorithm 138 138 void generateCosts( int row ) { 139 139 bool seen[NUMBER_OF_BASIC_TYPES] = { false /*, ... */ }; … … 176 176 177 177 // traverse children 178 // Fangren explain "max"178 // any conversion should have a cost of at least 1, even if between types of equal rank 179 179 int i = graph[col].left; 180 180 if ( i == -1 ) continue; // leaf … … 191 191 } // generateCosts 192 192 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. 194 197 void generateCommonType( int row, int col ) { // row <= col 195 198 if ( costMatrix[row][col] >= 0 ) { -
TabularUnified src/CodeGen/CodeGenerator.cpp ¶
r0f070a4 rde8a0a4 251 251 252 252 if ( decl->init ) { 253 output << " = "; 253 bool isGenericInit = options.genC || decl->init->maybeConstructed; 254 output << ( (isGenericInit) ? " = " : " @= " ); 254 255 decl->init->accept( *visitor ); 255 256 } -
TabularUnified src/Common/CodeLocationTools.cpp ¶
r0f070a4 rde8a0a4 154 154 macro(ConstantExpr, Expr) \ 155 155 macro(SizeofExpr, Expr) \ 156 macro(CountExpr, Expr ) \157 156 macro(AlignofExpr, Expr) \ 157 macro(CountofExpr, Expr ) \ 158 158 macro(UntypedOffsetofExpr, Expr) \ 159 159 macro(OffsetofExpr, Expr) \ -
TabularUnified src/Concurrency/Keywords.cpp ¶
r0f070a4 rde8a0a4 10 10 // Created On : Tue Nov 16 9:53:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 14 18:02:25 202313 // Update Count : 612 // Last Modified On : Sun Jan 26 15:16:16 2025 13 // Update Count : 15 14 14 // 15 15 … … 69 69 } 70 70 71 // Describe that it adds the generic parameters and the uses of the generic 72 // parameters on thefunction 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. 73 73 ast::FunctionDecl * fixupGenerics( 74 74 const ast::FunctionDecl * func, const ast::StructDecl * decl ) { … … 117 117 118 118 // -------------------------------------------------------------------------- 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 119 127 struct ConcurrentSueKeyword : public ast::WithDeclsToAdd { 120 128 ConcurrentSueKeyword( … … 171 179 }; 172 180 173 // Handles threadtype declarations:181 // Handles generator type declarations: 174 182 // 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; 179 187 // }; }; 180 // static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; }181 188 // 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",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 "", 189 196 true, 190 ast::AggregateDecl:: Thread)197 ast::AggregateDecl::Generator ) 191 198 {} 192 199 193 virtual ~ ThreadKeyword() {}200 virtual ~GeneratorKeyword() {} 194 201 }; 195 202 … … 197 204 // 198 205 // coroutine MyCoroutine { struct MyCoroutine { 199 // int data; int data;200 // a_struct_t more_data; a_struct_t more_data;201 206 // => coroutine$ __cor_d; 207 // int data; int data; 208 // a_struct_t more_data; a_struct_t more_data; 202 209 // }; }; 203 210 // static inline coroutine$ * get_coroutine( MyCoroutine * this ) { return &this->__cor_d; } … … 220 227 // 221 228 // monitor MyMonitor { struct MyMonitor { 222 // int data; int data;223 // a_struct_t more_data; a_struct_t more_data;224 229 // => monitor$ __mon_d; 230 // int data; int data; 231 // a_struct_t more_data; a_struct_t more_data; 225 232 // }; }; 226 233 // static inline monitor$ * get_coroutine( MyMonitor * this ) { … … 248 255 }; 249 256 250 // Handles generatortype declarations:257 // Handles thread type declarations: 251 258 // 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; 256 263 // }; }; 264 // static inline thread$ * get_thread( MyThread * this ) { return &this->__thrd_d; } 257 265 // 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 " ",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", 265 273 true, 266 ast::AggregateDecl:: Generator)274 ast::AggregateDecl::Thread ) 267 275 {} 268 276 269 virtual ~ GeneratorKeyword() {}277 virtual ~ThreadKeyword() {} 270 278 }; 271 279 … … 354 362 355 363 if ( !exception_name.empty() ) { 356 if ( !typeid_decl || !vtable_decl ) {364 if ( !typeid_decl || !vtable_decl ) { 357 365 SemanticError( decl, context_error ); 358 366 } … … 419 427 declsToAddBefore.push_back( 420 428 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, butwe 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. 423 431 ast::ptr<ast::StructInstType> typeid_cleanup = typeid_type; 424 432 } … … 525 533 526 534 auto mutDecl = ast::mutate( decl ); 535 // Insert at start of special aggregate structures => front of vector 536 //mutDecl->members.insert( mutDecl->members.begin(), field ); 527 537 mutDecl->members.push_back( field ); 528 538 … … 917 927 918 928 // 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() ) { 920 930 SemanticError( decl, "destructors for structures declared as \"monitor\" must use mutex parameters " ); 921 931 } … … 1031 1041 1032 1042 // Make sure that only the outer reference is mutex. 1033 if ( baseStruct->is_mutex() ) {1043 if ( baseStruct->is_mutex() ) { 1034 1044 SemanticError( decl, "mutex keyword may only appear once per argument " ); 1035 1045 } … … 1179 1189 } 1180 1190 1181 // generates a cast to the void ptr to the appropriate lock type and dereferences it before calling lock or unlock on it1182 // used to undo the type erasure done by storing all the lock pointers as void1191 // 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. 1183 1193 ast::ExprStmt * MutexKeyword::genVirtLockUnlockExpr( const std::string & fnName, ast::ptr<ast::Expr> expr, const CodeLocation & location, ast::Expr * param ) { 1184 1194 return new ast::ExprStmt( location, -
TabularUnified src/InitTweak/GenInit.cpp ¶
r0f070a4 rde8a0a4 162 162 // FROM USER: float a[ rand() ]; 163 163 // 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( 170 186 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 } 174 195 175 196 ast::ArrayType * mutType = ast::mutate( arrayType ); -
TabularUnified src/Parser/parser.yy ¶
r0f070a4 rde8a0a4 946 946 } 947 947 | COUNTOF unary_expression 948 { $$ = new ExpressionNode( new ast::Count Expr( yylloc, maybeMoveBuild( $2) ) ); }948 { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); } 949 949 | COUNTOF '(' type_no_function ')' 950 { $$ = new ExpressionNode( new ast::Count Expr( yylloc, maybeMoveBuildType( $3 ) ) ); }950 { $$ = new ExpressionNode( new ast::CountofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 951 951 ; 952 952 -
TabularUnified src/ResolvExpr/CandidateFinder.cpp ¶
r0f070a4 rde8a0a4 672 672 void postvisit( const ast::SizeofExpr * sizeofExpr ); 673 673 void postvisit( const ast::AlignofExpr * alignofExpr ); 674 void postvisit( const ast::CountofExpr * countExpr ); 674 675 void postvisit( const ast::AddressExpr * addressExpr ); 675 676 void postvisit( const ast::LabelAddressExpr * labelExpr ); … … 697 698 void postvisit( const ast::UntypedInitExpr * initExpr ); 698 699 void postvisit( const ast::QualifiedNameExpr * qualifiedExpr ); 699 void postvisit( const ast::CountExpr * countExpr );700 700 701 701 void postvisit( const ast::InitExpr * ) { … … 941 941 } 942 942 } 943 944 943 945 944 /// Adds aggregate member interpretations … … 1269 1268 ? conversionCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env ) 1270 1269 : castCost( fromType, toType, cand->expr->get_lvalue(), symtab, cand->env ); 1271 1270 1272 1271 // Redefine enum cast 1273 1272 auto argAsEnum = fromType.as<ast::EnumInstType>(); … … 1493 1492 } 1494 1493 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 } 1511 1503 ); 1512 1504 CandidateFinder finder( context, tenv ); … … 1514 1506 CandidateList winners = findMinCost( finder.candidates ); 1515 1507 if ( winners.size() == 0 ) { 1516 SemanticError( countExpr ->expr, "Countof is not implemented for operand: " );1517 } 1518 if ( winners.size() != 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: " ); 1520 1512 } 1521 1513 CandidateRef & choice = winners.front(); -
TabularUnified src/ResolvExpr/ConversionCost.cpp ¶
r0f070a4 rde8a0a4 44 44 signed long long int unsigned long long int 45 45 __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 53 60 __float80 54 long double long double _Complex 61 long double 62 long double _Complex 55 63 __float128 56 _Float128 _Float128 _Complex 57 _Float128x _Float128x _Complex 64 _Float128 65 _Float128 _Complex 66 _Float128x 67 _Float128x _Complex 58 68 */ 59 69 // GENERATED END … … 63 73 static const int costMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 64 74 /* 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, }, 99 109 /* _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, }, 100 110 /* _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, }, 101 111 }; // costMatrix 102 static const int maxIntCost = 15;112 static const int maxIntCost = 25; 103 113 // GENERATED END 104 114 static_assert( -
TabularUnified tests/arithmeticConversions.cfa ¶
r0f070a4 rde8a0a4 98 98 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 99 99 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__) 101 102 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 102 103 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 104 106 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 105 107 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) ); 106 108 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 107 109 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__) 109 112 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 110 113 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 112 116 printf( "%6s %2zd | %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd %4zd\n", 113 117 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) ); … … 146 150 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 147 151 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__) 149 154 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n", 150 155 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 152 158 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 153 159 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) ); 154 160 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 155 161 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__) 157 164 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %6zd %5zd %5zd\n", 158 165 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 160 168 printf( "%6s %2zd | %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd %5zd" OPT1(" %5zd") " %5zd %5zd" OPT1(" %6zd") " %5zd %5zd\n", 161 169 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 27 27 static char * bookend_hi = 0p; 28 28 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 29 35 void bookendInner( void ) { 30 36 char var = 'x'; … … 35 41 #define TC(...) 36 42 #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 ) { \ 38 44 char var = 'x'; \ 39 45 (void) var; \ 40 46 bookend_hi = & var; \ 41 return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart ); \47 return CALL( allocAndAccess, TRID, SZS, n, expectedElmSz, tcid, vart ); \ 42 48 } 43 49 #include "boxed.cases.hfa" 44 50 #undef TC 45 51 #undef TR 52 53 #pragma GCC diagnostic pop 46 54 47 55 void resetBookends( void ) { -
TabularUnified tests/malloc.cfa ¶
r0f070a4 rde8a0a4 64 64 free( ip ); 65 65 66 #pragma GCC diagnostic push 67 #pragma GCC diagnostic ignored "-Wpragmas" // -Walloc-size unrecognized until GCC 14 68 #pragma GCC diagnostic ignored "-Walloc-size" 66 69 ip = (int *)malloc( 0 ); 70 #pragma GCC diagnostic pop 67 71 test_base( ip, 0, libAlign ); 68 72 test_use( ip );
Note: See TracChangeset
for help on using the changeset viewer.