Changeset 108b2c7
- Timestamp:
- Nov 27, 2024, 4:01:37 PM (3 weeks ago)
- Branches:
- master
- Children:
- 71f3d45
- Parents:
- e25ef8c
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/builtins.c
re25ef8c r108b2c7 44 44 typedef unsigned long long __cfaabi_abi_exception_type_t; 45 45 46 #include <limits.h> // CHAR_BIT47 46 #include "../src/virtual.h" 48 47 #include "../src/exception.h" … … 132 131 } // distribution 133 132 134 #define __CFA_EXP__() \ 135 if ( y == 0 ) return 1; /* convention */ \ 136 __CFA_EXP_INT__( /* special cases for integral types */ \ 137 if ( x == 1 ) return 1; /* base case */ \ 138 if ( x == 2 ) return x << (y - 1); /* positive shifting */ \ 139 if ( y >= sizeof(y) * CHAR_BIT ) return 0; /* immediate overflow, negative exponent > 2^size-1 */ \ 140 ) \ 141 typeof(x) op = 1; /* accumulate odd product */ \ 142 typeof(x) w = x; /* FIX-ME: possible bug in the box pass changing value argument through parameter */ \ 143 for ( ; y > 1; y >>= 1 ) { /* squaring exponentiation, O(log2 y) */ \ 144 if ( (y & 1) == 1 ) op = op * w; /* odd ? */ \ 145 w = w * w; \ 146 } \ 147 return w * op 148 #define __CFA_EXP_INT__(...) __VA_ARGS__ 133 int ?\?( int x, unsigned int y ); 134 long int ?\?( long int x, unsigned long int y ); 135 long long int ?\?( long long int x, unsigned long long int y ); 136 // unsigned computation may be faster and larger 137 unsigned int ?\?( unsigned int x, unsigned int y ); 138 unsigned long int ?\?( unsigned long int x, unsigned long int y ); 139 unsigned long long int ?\?( unsigned long long int x, unsigned long long int y ); 149 140 150 static inline { 151 int ?\?( int x, unsigned int y ) { __CFA_EXP__(); } 152 long int ?\?( long int x, unsigned long int y ) { __CFA_EXP__(); } 153 long long int ?\?( long long int x, unsigned long long int y ) { __CFA_EXP__(); } 154 // unsigned computation may be faster and larger 155 unsigned int ?\?( unsigned int x, unsigned int y ) { __CFA_EXP__(); } 156 unsigned long int ?\?( unsigned long int x, unsigned long int y ) { __CFA_EXP__(); } 157 unsigned long long int ?\?( unsigned long long int x, unsigned long long int y ) { __CFA_EXP__(); } 141 forall( OT | { void ?{}( OT & this, one_t ); OT ?*?( OT, OT ); } ) { 142 OT ?\?( OT x, unsigned int y ); 143 OT ?\?( OT x, unsigned long int y ); 144 OT ?\?( OT x, unsigned long long int y ); 158 145 } // distribution 159 160 #undef __CFA_EXP_INT__161 #define __CFA_EXP_INT__(...)162 163 static inline forall( OT | { void ?{}( OT & this, one_t ); OT ?*?( OT, OT ); } ) {164 OT ?\?( OT x, unsigned int y ) { __CFA_EXP__(); }165 OT ?\?( OT x, unsigned long int y ) { __CFA_EXP__(); }166 OT ?\?( OT x, unsigned long long int y ) { __CFA_EXP__(); }167 } // distribution168 169 #undef __CFA_EXP_INT__170 #undef __CFA_EXP__171 146 172 147 static inline { -
libcfa/src/Makefile.am
re25ef8c r108b2c7 47 47 gmp.hfa \ 48 48 math.trait.hfa \ 49 math.hfa \50 49 raii.hfa \ 51 50 time_t.hfa \ … … 81 80 iterator.hfa \ 82 81 limits.hfa \ 82 math.hfa \ 83 83 memory.hfa \ 84 84 parseargs.hfa \ -
tests/.expect/KRfunctions.arm64.txt
re25ef8c r108b2c7 104 104 signed int _X1bi_2; 105 105 { 106 signed int *(*_tmp_cp_ret 6)(signed int __param_0, signed int __param_1);107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret 6=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret6)));106 signed int *(*_tmp_cp_ret0)(signed int __param_0, signed int __param_1); 107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret0=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret0))); 108 108 } 109 109 -
tests/.expect/KRfunctions.x64.txt
re25ef8c r108b2c7 104 104 signed int _X1bi_2; 105 105 { 106 signed int *(*_tmp_cp_ret 6)(signed int __param_0, signed int __param_1);107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret 6=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret6)));106 signed int *(*_tmp_cp_ret0)(signed int __param_0, signed int __param_1); 107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret0=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret0))); 108 108 } 109 109 -
tests/.expect/KRfunctions.x86.txt
re25ef8c r108b2c7 104 104 signed int _X1bi_2; 105 105 { 106 signed int *(*_tmp_cp_ret 6)(signed int __param_0, signed int __param_1);107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret 6=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret6)));106 signed int *(*_tmp_cp_ret0)(signed int __param_0, signed int __param_1); 107 ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret0=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret0))); 108 108 } 109 109 -
tests/.expect/declarationSpecifier.arm64.txt
re25ef8c r108b2c7 1059 1059 } 1060 1060 1061 signed int _tmp_cp_ret 6;1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);1061 signed int _tmp_cp_ret0; 1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 1063 1063 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1064 1064 { -
tests/.expect/declarationSpecifier.x64.txt
re25ef8c r108b2c7 1059 1059 } 1060 1060 1061 signed int _tmp_cp_ret 6;1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);1061 signed int _tmp_cp_ret0; 1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 1063 1063 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1064 1064 { -
tests/.expect/declarationSpecifier.x86.txt
re25ef8c r108b2c7 1059 1059 } 1060 1060 1061 signed int _tmp_cp_ret 6;1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);1061 signed int _tmp_cp_ret0; 1062 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 1063 1063 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 1064 1064 { -
tests/.expect/extension.arm64.txt
re25ef8c r108b2c7 457 457 458 458 { 459 signed int _tmp_cp_ret 6;460 ((void)(((void)(_tmp_cp_ret 6=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret6));459 signed int _tmp_cp_ret0; 460 ((void)(((void)(_tmp_cp_ret0=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret0)); 461 461 } 462 462 -
tests/.expect/extension.x64.txt
re25ef8c r108b2c7 457 457 458 458 { 459 signed int _tmp_cp_ret 6;460 ((void)(((void)(_tmp_cp_ret 6=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret6));459 signed int _tmp_cp_ret0; 460 ((void)(((void)(_tmp_cp_ret0=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret0)); 461 461 } 462 462 -
tests/.expect/extension.x86.txt
re25ef8c r108b2c7 457 457 458 458 { 459 signed int _tmp_cp_ret 6;460 ((void)(((void)(_tmp_cp_ret 6=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret6));459 signed int _tmp_cp_ret0; 460 ((void)(((void)(_tmp_cp_ret0=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret0)); 461 461 } 462 462 -
tests/.expect/gccExtensions.arm64.txt
re25ef8c r108b2c7 339 339 } 340 340 341 signed int _tmp_cp_ret 6;342 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);341 signed int _tmp_cp_ret0; 342 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 343 343 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 344 344 { -
tests/.expect/gccExtensions.x64.txt
re25ef8c r108b2c7 339 339 } 340 340 341 signed int _tmp_cp_ret 6;342 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);341 signed int _tmp_cp_ret0; 342 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 343 343 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 344 344 { -
tests/.expect/gccExtensions.x86.txt
re25ef8c r108b2c7 317 317 } 318 318 319 signed int _tmp_cp_ret 6;320 signed int _X3reti_2 = (((void)(_tmp_cp_ret 6=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret6);319 signed int _tmp_cp_ret0; 320 signed int _X3reti_2 = (((void)(_tmp_cp_ret0=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret0); 321 321 if ( ((&_X17cfa_main_returnedi_1)!=((signed int *)0)) ) { 322 322 {
Note: See TracChangeset
for help on using the changeset viewer.